diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06c9837d8..788574a71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,12 +32,12 @@ repos: - id: python-check-blanket-noqa - id: python-check-blanket-type-ignore - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.1.3 + rev: v0.1.4 hooks: - id: ruff args: @@ -48,7 +48,7 @@ repos: hooks: - id: poetry-sort - repo: https://github.com/python-poetry/poetry - rev: "1.6.0" + rev: "1.7.0" hooks: - id: poetry-check diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0a866c24c..5f6343113 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,6 @@ { "recommendations": [ "editorconfig.editorconfig", - "ms-python.isort", "ms-python.python", "ms-python.vscode-pylance", "redhat.vscode-yaml", diff --git a/README.md b/README.md index 601bfc9f1..7f7006bc7 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,11 @@ Roadmap: How-to: ============= +- [pyConnectWise - An API library for ConnectWise Manage and ConnectWise Automate, written in Python](#pyconnectwise---an-api-library-for-connectwise-manage-and-connectwise-automate-written-in-python) +- [Features:](#features) +- [Known Issues:](#known-issues) +- [Roadmap:](#roadmap) +- [How-to:](#how-to) - [Install](#install) - [Initializing the API Clients](#initializing-the-api-clients) - [ConnectWise Manage](#connectwise-manage) @@ -60,6 +65,7 @@ How-to: - [Quick dependencies install on apt-based systems (using pipx to manage python tools)](#quick-dependencies-install-on-apt-based-systems-using-pipx-to-manage-python-tools) - [Setting up your development environment](#setting-up-your-development-environment) - [Testing](#testing) + - [Running code generation](#running-code-generation) - [Supporting the project](#supporting-the-project) # Install @@ -254,6 +260,11 @@ pre-commit install poetry run pytest ``` +## Running code generation +```bash +poetry run python -m pyconnectwise_generator +``` + # Supporting the project :heart: the project and would like to show your support? Please consider donating to the following charities: - [Black Dog](https://donate.blackdoginstitute.org.au/) diff --git a/generate_models.sh b/generate_models.sh deleted file mode 100644 index d5a5381dd..000000000 --- a/generate_models.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -source venv/scripts/activate - -echo Enter JSON path -read jsonPath -echo Enter output filename/directory -read output - -datamodel-codegen --input ${jsonPath} --output ${output} --target-python-version 3.10 --collapse-root-models --reuse-model --output-model-type pydantic_v2.BaseModel --base-class pyconnectwise.models.base.connectwise_model.ConnectWiseModel --use-union-operator --use-field-description --use-default --snake-case-field --disable-timestamp --use-standard-collections --use-schema-description --remove-special-field-name-prefix --capitalise-enum-members --set-default-enum-member --enum-field-as-literal all --use-default-kwarg --field-constraints diff --git a/poetry.lock b/poetry.lock index c281a5378..630086384 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. [[package]] name = "annotated-types" @@ -11,6 +11,20 @@ files = [ {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, ] +[[package]] +name = "argcomplete" +version = "3.1.4" +description = "Bash tab completion for argparse" +optional = false +python-versions = ">=3.8" +files = [ + {file = "argcomplete-3.1.4-py3-none-any.whl", hash = "sha256:fbe56f8cda08aa9a04b307d8482ea703e96a6a801611acb4be9bf3942017989f"}, + {file = "argcomplete-3.1.4.tar.gz", hash = "sha256:72558ba729e4c468572609817226fb0a6e7e9a0a7d477b882be168c0b4a62b94"}, +] + +[package.extras] +test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] + [[package]] name = "astunparse" version = "1.6.3" @@ -26,6 +40,24 @@ files = [ six = ">=1.6.1,<2.0" wheel = ">=0.23.0,<1.0" +[[package]] +name = "attrs" +version = "23.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, +] + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] + [[package]] name = "black" version = "23.10.1" @@ -79,6 +111,17 @@ files = [ {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] +[[package]] +name = "chardet" +version = "5.2.0" +description = "Universal encoding detector for Python 3" +optional = false +python-versions = ">=3.7" +files = [ + {file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"}, + {file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"}, +] + [[package]] name = "charset-normalizer" version = "3.3.2" @@ -203,6 +246,72 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "datamodel-code-generator" +version = "0.23.0" +description = "Datamodel Code Generator" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "datamodel_code_generator-0.23.0-py3-none-any.whl", hash = "sha256:fceb1dd264cd4739edd89a5439fcc23c7dfaf21473aefd873f6e8be8304260bc"}, + {file = "datamodel_code_generator-0.23.0.tar.gz", hash = "sha256:a6ba58b6c2539e676cf6a72114fb9d0e0020e7a0ae3883eb3d34e8cafb504c01"}, +] + +[package.dependencies] +argcomplete = ">=1.10,<4.0" +black = ">=19.10b0" +genson = ">=1.2.1,<2.0" +inflect = ">=4.1.0,<6.0" +isort = ">=4.3.21,<6.0" +jinja2 = ">=2.10.1,<4.0" +openapi-spec-validator = ">=0.2.8,<0.7.0" +packaging = "*" +prance = ">=0.18.2" +pydantic = [ + {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""}, + {version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=1.9.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, +] +PySnooper = ">=0.4.1,<2.0.0" +toml = ">=0.10.0,<1.0.0" + +[package.extras] +http = ["httpx"] + +[[package]] +name = "dnspython" +version = "2.4.2" +description = "DNS toolkit" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "dnspython-2.4.2-py3-none-any.whl", hash = "sha256:57c6fbaaeaaf39c891292012060beb141791735dbb4004798328fc2c467402d8"}, + {file = "dnspython-2.4.2.tar.gz", hash = "sha256:8dcfae8c7460a2f84b4072e26f1c9f4101ca20c071649cb7c34e8b6a93d58984"}, +] + +[package.extras] +dnssec = ["cryptography (>=2.6,<42.0)"] +doh = ["h2 (>=4.1.0)", "httpcore (>=0.17.3)", "httpx (>=0.24.1)"] +doq = ["aioquic (>=0.9.20)"] +idna = ["idna (>=2.1,<4.0)"] +trio = ["trio (>=0.14,<0.23)"] +wmi = ["wmi (>=1.5.1,<2.0.0)"] + +[[package]] +name = "email-validator" +version = "2.1.0.post1" +description = "A robust email address syntax and deliverability validation library." +optional = false +python-versions = ">=3.8" +files = [ + {file = "email_validator-2.1.0.post1-py3-none-any.whl", hash = "sha256:c973053efbeddfef924dc0bd93f6e77a1ea7ee0fce935aea7103c7a3d6d2d637"}, + {file = "email_validator-2.1.0.post1.tar.gz", hash = "sha256:a4b0bd1cf55f073b924258d19321b1f3aa74b4b5a71a42c305575dba920e1a44"}, +] + +[package.dependencies] +dnspython = ">=2.0.0" +idna = ">=2.0.0" + [[package]] name = "exceptiongroup" version = "1.1.3" @@ -217,6 +326,16 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "genson" +version = "1.2.2" +description = "GenSON is a powerful, user-friendly JSON Schema generator." +optional = false +python-versions = "*" +files = [ + {file = "genson-1.2.2.tar.gz", hash = "sha256:8caf69aa10af7aee0e1a1351d1d06801f4696e005f06cedef438635384346a16"}, +] + [[package]] name = "idna" version = "3.4" @@ -228,6 +347,21 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] +[[package]] +name = "inflect" +version = "5.6.2" +description = "Correctly generate plurals, singular nouns, ordinals, indefinite articles; convert numbers to words" +optional = false +python-versions = ">=3.7" +files = [ + {file = "inflect-5.6.2-py3-none-any.whl", hash = "sha256:b45d91a4a28a4e617ff1821117439b06eaa86e2a4573154af0149e9be6687238"}, + {file = "inflect-5.6.2.tar.gz", hash = "sha256:aadc7ed73928f5e014129794bbac03058cca35d0a973a5fc4eb45c7fa26005f9"}, +] + +[package.extras] +docs = ["jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx"] +testing = ["pygments", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] + [[package]] name = "iniconfig" version = "2.0.0" @@ -273,6 +407,103 @@ MarkupSafe = ">=2.0" [package.extras] i18n = ["Babel (>=2.7)"] +[[package]] +name = "jsonschema" +version = "4.19.2" +description = "An implementation of JSON Schema validation for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "jsonschema-4.19.2-py3-none-any.whl", hash = "sha256:eee9e502c788e89cb166d4d37f43084e3b64ab405c795c03d343a4dbc2c810fc"}, + {file = "jsonschema-4.19.2.tar.gz", hash = "sha256:c9ff4d7447eed9592c23a12ccee508baf0dd0d59650615e847feb6cdca74f392"}, +] + +[package.dependencies] +attrs = ">=22.2.0" +jsonschema-specifications = ">=2023.03.6" +referencing = ">=0.28.4" +rpds-py = ">=0.7.1" + +[package.extras] +format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] +format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] + +[[package]] +name = "jsonschema-spec" +version = "0.2.4" +description = "JSONSchema Spec with object-oriented paths" +optional = false +python-versions = ">=3.8.0,<4.0.0" +files = [ + {file = "jsonschema_spec-0.2.4-py3-none-any.whl", hash = "sha256:e6dcf7056734ec6854f7888da6c08ce6c421f28aeeddce96bb90de0fb6d711ef"}, + {file = "jsonschema_spec-0.2.4.tar.gz", hash = "sha256:873e396ad1ba6edf9f52d6174c110d4fafb7b5f5894744246a53fe75e5251ec2"}, +] + +[package.dependencies] +pathable = ">=0.4.1,<0.5.0" +PyYAML = ">=5.1" +referencing = ">=0.28.0,<0.31.0" +requests = ">=2.31.0,<3.0.0" + +[[package]] +name = "jsonschema-specifications" +version = "2023.7.1" +description = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry" +optional = false +python-versions = ">=3.8" +files = [ + {file = "jsonschema_specifications-2023.7.1-py3-none-any.whl", hash = "sha256:05adf340b659828a004220a9613be00fa3f223f2b82002e273dee62fd50524b1"}, + {file = "jsonschema_specifications-2023.7.1.tar.gz", hash = "sha256:c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb"}, +] + +[package.dependencies] +referencing = ">=0.28.0" + +[[package]] +name = "lazy-object-proxy" +version = "1.9.0" +description = "A fast and thorough lazy object proxy." +optional = false +python-versions = ">=3.7" +files = [ + {file = "lazy-object-proxy-1.9.0.tar.gz", hash = "sha256:659fb5809fa4629b8a1ac5106f669cfc7bef26fbb389dda53b3e010d1ac4ebae"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b40387277b0ed2d0602b8293b94d7257e17d1479e257b4de114ea11a8cb7f2d7"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8c6cfb338b133fbdbc5cfaa10fe3c6aeea827db80c978dbd13bc9dd8526b7d4"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:721532711daa7db0d8b779b0bb0318fa87af1c10d7fe5e52ef30f8eff254d0cd"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:66a3de4a3ec06cd8af3f61b8e1ec67614fbb7c995d02fa224813cb7afefee701"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1aa3de4088c89a1b69f8ec0dcc169aa725b0ff017899ac568fe44ddc1396df46"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-win32.whl", hash = "sha256:f0705c376533ed2a9e5e97aacdbfe04cecd71e0aa84c7c0595d02ef93b6e4455"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:ea806fd4c37bf7e7ad82537b0757999264d5f70c45468447bb2b91afdbe73a6e"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:946d27deaff6cf8452ed0dba83ba38839a87f4f7a9732e8f9fd4107b21e6ff07"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79a31b086e7e68b24b99b23d57723ef7e2c6d81ed21007b6281ebcd1688acb0a"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f699ac1c768270c9e384e4cbd268d6e67aebcfae6cd623b4d7c3bfde5a35db59"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bfb38f9ffb53b942f2b5954e0f610f1e721ccebe9cce9025a38c8ccf4a5183a4"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:189bbd5d41ae7a498397287c408617fe5c48633e7755287b21d741f7db2706a9"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-win32.whl", hash = "sha256:81fc4d08b062b535d95c9ea70dbe8a335c45c04029878e62d744bdced5141586"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:f2457189d8257dd41ae9b434ba33298aec198e30adf2dcdaaa3a28b9994f6adb"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d9e25ef10a39e8afe59a5c348a4dbf29b4868ab76269f81ce1674494e2565a6e"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cbf9b082426036e19c6924a9ce90c740a9861e2bdc27a4834fd0a910742ac1e8"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f5fa4a61ce2438267163891961cfd5e32ec97a2c444e5b842d574251ade27d2"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:8fa02eaab317b1e9e03f69aab1f91e120e7899b392c4fc19807a8278a07a97e8"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e7c21c95cae3c05c14aafffe2865bbd5e377cfc1348c4f7751d9dc9a48ca4bda"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win32.whl", hash = "sha256:f12ad7126ae0c98d601a7ee504c1122bcef553d1d5e0c3bfa77b16b3968d2734"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win_amd64.whl", hash = "sha256:edd20c5a55acb67c7ed471fa2b5fb66cb17f61430b7a6b9c3b4a1e40293b1671"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0daa332786cf3bb49e10dc6a17a52f6a8f9601b4cf5c295a4f85854d61de63"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cd077f3d04a58e83d04b20e334f678c2b0ff9879b9375ed107d5d07ff160171"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:660c94ea760b3ce47d1855a30984c78327500493d396eac4dfd8bd82041b22be"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:212774e4dfa851e74d393a2370871e174d7ff0ebc980907723bb67d25c8a7c30"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f0117049dd1d5635bbff65444496c90e0baa48ea405125c088e93d9cf4525b11"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-win32.whl", hash = "sha256:0a891e4e41b54fd5b8313b96399f8b0e173bbbfc03c7631f01efbe29bb0bcf82"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:9990d8e71b9f6488e91ad25f322898c136b008d87bf852ff65391b004da5e17b"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9e7551208b2aded9c1447453ee366f1c4070602b3d932ace044715d89666899b"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f83ac4d83ef0ab017683d715ed356e30dd48a93746309c8f3517e1287523ef4"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7322c3d6f1766d4ef1e51a465f47955f1e8123caee67dd641e67d539a534d006"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:18b78ec83edbbeb69efdc0e9c1cb41a3b1b1ed11ddd8ded602464c3fc6020494"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:09763491ce220c0299688940f8dc2c5d05fd1f45af1e42e636b2e8b2303e4382"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-win32.whl", hash = "sha256:9090d8e53235aa280fc9239a86ae3ea8ac58eff66a705fa6aa2ec4968b95c821"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:db1c1722726f47e10e0b5fdbf15ac3b8adb58c091d12b3ab713965795036985f"}, +] + [[package]] name = "markupsafe" version = "2.1.3" @@ -343,6 +574,39 @@ files = [ {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] +[[package]] +name = "openapi-schema-validator" +version = "0.6.2" +description = "OpenAPI schema validation for Python" +optional = false +python-versions = ">=3.8.0,<4.0.0" +files = [ + {file = "openapi_schema_validator-0.6.2-py3-none-any.whl", hash = "sha256:c4887c1347c669eb7cded9090f4438b710845cd0f90d1fb9e1b3303fb37339f8"}, + {file = "openapi_schema_validator-0.6.2.tar.gz", hash = "sha256:11a95c9c9017912964e3e5f2545a5b11c3814880681fcacfb73b1759bb4f2804"}, +] + +[package.dependencies] +jsonschema = ">=4.19.1,<5.0.0" +jsonschema-specifications = ">=2023.5.2,<2024.0.0" +rfc3339-validator = "*" + +[[package]] +name = "openapi-spec-validator" +version = "0.6.0" +description = "OpenAPI 2.0 (aka Swagger) and OpenAPI 3 spec validator" +optional = false +python-versions = ">=3.8.0,<4.0.0" +files = [ + {file = "openapi_spec_validator-0.6.0-py3-none-any.whl", hash = "sha256:675f1a3c0d0d8eff9116694acde88bcd4613a95bf5240270724d9d78c78f26d6"}, + {file = "openapi_spec_validator-0.6.0.tar.gz", hash = "sha256:68c4c212c88ef14c6b1a591b895bf742c455783c7ebba2507abd7dbc1365a616"}, +] + +[package.dependencies] +jsonschema = ">=4.18.0,<5.0.0" +jsonschema-spec = ">=0.2.3,<0.3.0" +lazy-object-proxy = ">=1.7.1,<2.0.0" +openapi-schema-validator = ">=0.6.0,<0.7.0" + [[package]] name = "packaging" version = "23.2" @@ -354,6 +618,17 @@ files = [ {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] +[[package]] +name = "pathable" +version = "0.4.3" +description = "Object-oriented paths" +optional = false +python-versions = ">=3.7.0,<4.0.0" +files = [ + {file = "pathable-0.4.3-py3-none-any.whl", hash = "sha256:cdd7b1f9d7d5c8b8d3315dbf5a86b2596053ae845f056f57d97c0eefff84da14"}, + {file = "pathable-0.4.3.tar.gz", hash = "sha256:5c869d315be50776cc8a993f3af43e0c60dc01506b399643f919034ebf4cdcab"}, +] + [[package]] name = "pathspec" version = "0.11.2" @@ -395,6 +670,32 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "prance" +version = "23.6.21.0" +description = "Resolving Swagger/OpenAPI 2.0 and 3.0.0 Parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "prance-23.6.21.0-py3-none-any.whl", hash = "sha256:6a4276fa07ed9f22feda4331097d7503c4adc3097e46ffae97425f2c1026bd9f"}, + {file = "prance-23.6.21.0.tar.gz", hash = "sha256:d8c15f8ac34019751cc4945f866d8d964d7888016d10de3592e339567177cabe"}, +] + +[package.dependencies] +chardet = ">=3.0" +packaging = ">=21.3" +requests = ">=2.25" +"ruamel.yaml" = ">=0.17.10" +six = ">=1.15,<2.0" + +[package.extras] +cli = ["click (>=7.0)"] +dev = ["bumpversion (>=0.6)", "pytest (>=6.1)", "pytest-cov (>=2.11)", "sphinx (>=3.4)", "towncrier (>=19.2)", "tox (>=3.4)"] +flex = ["flex (>=6.13,<7.0)"] +icu = ["PyICU (>=2.4,<3.0)"] +osv = ["openapi-spec-validator (>=0.5.1,<0.6.0)"] +ssv = ["swagger-spec-validator (>=2.4,<3.0)"] + [[package]] name = "pydantic" version = "2.4.2" @@ -408,6 +709,7 @@ files = [ [package.dependencies] annotated-types = ">=0.4.0" +email-validator = {version = ">=2.0.0", optional = true, markers = "extra == \"email\""} pydantic-core = "2.10.1" typing-extensions = ">=4.6.1" @@ -532,6 +834,20 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" +[[package]] +name = "pysnooper" +version = "1.2.0" +description = "A poor man's debugger for Python." +optional = false +python-versions = "*" +files = [ + {file = "PySnooper-1.2.0-py2.py3-none-any.whl", hash = "sha256:aa859aa9a746cffc1f35e4ee469d49c3cc5185b5fc0c571feb3af3c94d2eb625"}, + {file = "PySnooper-1.2.0.tar.gz", hash = "sha256:810669e162a250a066d8662e573adbc5af770e937c5b5578f28bb7355d1c859b"}, +] + +[package.extras] +tests = ["pytest"] + [[package]] name = "pytest" version = "7.4.3" @@ -568,6 +884,70 @@ files = [ [package.dependencies] pytest = ">=5.0.0" +[[package]] +name = "pyyaml" +version = "6.0.1" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, +] + +[[package]] +name = "referencing" +version = "0.30.2" +description = "JSON Referencing + Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "referencing-0.30.2-py3-none-any.whl", hash = "sha256:449b6669b6121a9e96a7f9e410b245d471e8d48964c67113ce9afe50c8dd7bdf"}, + {file = "referencing-0.30.2.tar.gz", hash = "sha256:794ad8003c65938edcdbc027f1933215e0d0ccc0291e3ce20a4d87432b59efc0"}, +] + +[package.dependencies] +attrs = ">=22.2.0" +rpds-py = ">=0.7.0" + [[package]] name = "requests" version = "2.31.0" @@ -608,6 +988,205 @@ six = "*" fixture = ["fixtures"] test = ["fixtures", "mock", "purl", "pytest", "requests-futures", "sphinx", "testtools"] +[[package]] +name = "rfc3339-validator" +version = "0.1.4" +description = "A pure python RFC3339 validator" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "rfc3339_validator-0.1.4-py2.py3-none-any.whl", hash = "sha256:24f6ec1eda14ef823da9e36ec7113124b39c04d50a4d3d3a3c2859577e7791fa"}, + {file = "rfc3339_validator-0.1.4.tar.gz", hash = "sha256:138a2abdf93304ad60530167e51d2dfb9549521a836871b88d7f4695d0022f6b"}, +] + +[package.dependencies] +six = "*" + +[[package]] +name = "rpds-py" +version = "0.12.0" +description = "Python bindings to Rust's persistent data structures (rpds)" +optional = false +python-versions = ">=3.8" +files = [ + {file = "rpds_py-0.12.0-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:c694bee70ece3b232df4678448fdda245fd3b1bb4ba481fb6cd20e13bb784c46"}, + {file = "rpds_py-0.12.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:30e5ce9f501fb1f970e4a59098028cf20676dee64fc496d55c33e04bbbee097d"}, + {file = "rpds_py-0.12.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d72a4315514e5a0b9837a086cb433b004eea630afb0cc129de76d77654a9606f"}, + {file = "rpds_py-0.12.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eebaf8c76c39604d52852366249ab807fe6f7a3ffb0dd5484b9944917244cdbe"}, + {file = "rpds_py-0.12.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a239303acb0315091d54c7ff36712dba24554993b9a93941cf301391d8a997ee"}, + {file = "rpds_py-0.12.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ced40cdbb6dd47a032725a038896cceae9ce267d340f59508b23537f05455431"}, + {file = "rpds_py-0.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c8c0226c71bd0ce9892eaf6afa77ae8f43a3d9313124a03df0b389c01f832de"}, + {file = "rpds_py-0.12.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b8e11715178f3608874508f08e990d3771e0b8c66c73eb4e183038d600a9b274"}, + {file = "rpds_py-0.12.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5210a0018c7e09c75fa788648617ebba861ae242944111d3079034e14498223f"}, + {file = "rpds_py-0.12.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:171d9a159f1b2f42a42a64a985e4ba46fc7268c78299272ceba970743a67ee50"}, + {file = "rpds_py-0.12.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:57ec6baec231bb19bb5fd5fc7bae21231860a1605174b11585660236627e390e"}, + {file = "rpds_py-0.12.0-cp310-none-win32.whl", hash = "sha256:7188ddc1a8887194f984fa4110d5a3d5b9b5cd35f6bafdff1b649049cbc0ce29"}, + {file = "rpds_py-0.12.0-cp310-none-win_amd64.whl", hash = "sha256:1e04581c6117ad9479b6cfae313e212fe0dfa226ac727755f0d539cd54792963"}, + {file = "rpds_py-0.12.0-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:0a38612d07a36138507d69646c470aedbfe2b75b43a4643f7bd8e51e52779624"}, + {file = "rpds_py-0.12.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f12d69d568f5647ec503b64932874dade5a20255736c89936bf690951a5e79f5"}, + {file = "rpds_py-0.12.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f8a1d990dc198a6c68ec3d9a637ba1ce489b38cbfb65440a27901afbc5df575"}, + {file = "rpds_py-0.12.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8c567c664fc2f44130a20edac73e0a867f8e012bf7370276f15c6adc3586c37c"}, + {file = "rpds_py-0.12.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0e9e976e0dbed4f51c56db10831c9623d0fd67aac02853fe5476262e5a22acb7"}, + {file = "rpds_py-0.12.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:efddca2d02254a52078c35cadad34762adbae3ff01c6b0c7787b59d038b63e0d"}, + {file = "rpds_py-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d9e7f29c00577aff6b318681e730a519b235af292732a149337f6aaa4d1c5e31"}, + {file = "rpds_py-0.12.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:389c0e38358fdc4e38e9995e7291269a3aead7acfcf8942010ee7bc5baee091c"}, + {file = "rpds_py-0.12.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:33ab498f9ac30598b6406e2be1b45fd231195b83d948ebd4bd77f337cb6a2bff"}, + {file = "rpds_py-0.12.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:d56b1cd606ba4cedd64bb43479d56580e147c6ef3f5d1c5e64203a1adab784a2"}, + {file = "rpds_py-0.12.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1fa73ed22c40a1bec98d7c93b5659cd35abcfa5a0a95ce876b91adbda170537c"}, + {file = "rpds_py-0.12.0-cp311-none-win32.whl", hash = "sha256:dbc25baa6abb205766fb8606f8263b02c3503a55957fcb4576a6bb0a59d37d10"}, + {file = "rpds_py-0.12.0-cp311-none-win_amd64.whl", hash = "sha256:c6b52b7028b547866c2413f614ee306c2d4eafdd444b1ff656bf3295bf1484aa"}, + {file = "rpds_py-0.12.0-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:9620650c364c01ed5b497dcae7c3d4b948daeae6e1883ae185fef1c927b6b534"}, + {file = "rpds_py-0.12.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2124f9e645a94ab7c853bc0a3644e0ca8ffbe5bb2d72db49aef8f9ec1c285733"}, + {file = "rpds_py-0.12.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:281c8b219d4f4b3581b918b816764098d04964915b2f272d1476654143801aa2"}, + {file = "rpds_py-0.12.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:27ccc93c7457ef890b0dd31564d2a05e1aca330623c942b7e818e9e7c2669ee4"}, + {file = "rpds_py-0.12.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d1c562a9bb72244fa767d1c1ab55ca1d92dd5f7c4d77878fee5483a22ffac808"}, + {file = "rpds_py-0.12.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e57919c32ee295a2fca458bb73e4b20b05c115627f96f95a10f9f5acbd61172d"}, + {file = "rpds_py-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa35ad36440aaf1ac8332b4a4a433d4acd28f1613f0d480995f5cfd3580e90b7"}, + {file = "rpds_py-0.12.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e6aea5c0eb5b0faf52c7b5c4a47c8bb64437173be97227c819ffa31801fa4e34"}, + {file = "rpds_py-0.12.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:81cf9d306c04df1b45971c13167dc3bad625808aa01281d55f3cf852dde0e206"}, + {file = "rpds_py-0.12.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:08e6e7ff286254016b945e1ab632ee843e43d45e40683b66dd12b73791366dd1"}, + {file = "rpds_py-0.12.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4d0a675a7acbbc16179188d8c6d0afb8628604fc1241faf41007255957335a0b"}, + {file = "rpds_py-0.12.0-cp312-none-win32.whl", hash = "sha256:b2287c09482949e0ca0c0eb68b2aca6cf57f8af8c6dfd29dcd3bc45f17b57978"}, + {file = "rpds_py-0.12.0-cp312-none-win_amd64.whl", hash = "sha256:8015835494b21aa7abd3b43fdea0614ee35ef6b03db7ecba9beb58eadf01c24f"}, + {file = "rpds_py-0.12.0-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6174d6ad6b58a6bcf67afbbf1723420a53d06c4b89f4c50763d6fa0a6ac9afd2"}, + {file = "rpds_py-0.12.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a689e1ded7137552bea36305a7a16ad2b40be511740b80748d3140614993db98"}, + {file = "rpds_py-0.12.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f45321224144c25a62052035ce96cbcf264667bcb0d81823b1bbc22c4addd194"}, + {file = "rpds_py-0.12.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aa32205358a76bf578854bf31698a86dc8b2cb591fd1d79a833283f4a403f04b"}, + {file = "rpds_py-0.12.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91bd2b7cf0f4d252eec8b7046fa6a43cee17e8acdfc00eaa8b3dbf2f9a59d061"}, + {file = "rpds_py-0.12.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3acadbab8b59f63b87b518e09c4c64b142e7286b9ca7a208107d6f9f4c393c5c"}, + {file = "rpds_py-0.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:429349a510da82c85431f0f3e66212d83efe9fd2850f50f339341b6532c62fe4"}, + {file = "rpds_py-0.12.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:05942656cb2cb4989cd50ced52df16be94d344eae5097e8583966a1d27da73a5"}, + {file = "rpds_py-0.12.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:0c5441b7626c29dbd54a3f6f3713ec8e956b009f419ffdaaa3c80eaf98ddb523"}, + {file = "rpds_py-0.12.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:b6b0e17d39d21698185097652c611f9cf30f7c56ccec189789920e3e7f1cee56"}, + {file = "rpds_py-0.12.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:3b7a64d43e2a1fa2dd46b678e00cabd9a49ebb123b339ce799204c44a593ae1c"}, + {file = "rpds_py-0.12.0-cp38-none-win32.whl", hash = "sha256:e5bbe011a2cea9060fef1bb3d668a2fd8432b8888e6d92e74c9c794d3c101595"}, + {file = "rpds_py-0.12.0-cp38-none-win_amd64.whl", hash = "sha256:bec29b801b4adbf388314c0d050e851d53762ab424af22657021ce4b6eb41543"}, + {file = "rpds_py-0.12.0-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:1096ca0bf2d3426cbe79d4ccc91dc5aaa73629b08ea2d8467375fad8447ce11a"}, + {file = "rpds_py-0.12.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:48aa98987d54a46e13e6954880056c204700c65616af4395d1f0639eba11764b"}, + {file = "rpds_py-0.12.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7979d90ee2190d000129598c2b0c82f13053dba432b94e45e68253b09bb1f0f6"}, + {file = "rpds_py-0.12.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:88857060b690a57d2ea8569bca58758143c8faa4639fb17d745ce60ff84c867e"}, + {file = "rpds_py-0.12.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4eb74d44776b0fb0782560ea84d986dffec8ddd94947f383eba2284b0f32e35e"}, + {file = "rpds_py-0.12.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f62581d7e884dd01ee1707b7c21148f61f2febb7de092ae2f108743fcbef5985"}, + {file = "rpds_py-0.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f5dcb658d597410bb7c967c1d24eaf9377b0d621358cbe9d2ff804e5dd12e81"}, + {file = "rpds_py-0.12.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9bf9acce44e967a5103fcd820fc7580c7b0ab8583eec4e2051aec560f7b31a63"}, + {file = "rpds_py-0.12.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:240687b5be0f91fbde4936a329c9b7589d9259742766f74de575e1b2046575e4"}, + {file = "rpds_py-0.12.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:25740fb56e8bd37692ed380e15ec734be44d7c71974d8993f452b4527814601e"}, + {file = "rpds_py-0.12.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a54917b7e9cd3a67e429a630e237a90b096e0ba18897bfb99ee8bd1068a5fea0"}, + {file = "rpds_py-0.12.0-cp39-none-win32.whl", hash = "sha256:b92aafcfab3d41580d54aca35a8057341f1cfc7c9af9e8bdfc652f83a20ced31"}, + {file = "rpds_py-0.12.0-cp39-none-win_amd64.whl", hash = "sha256:cd316dbcc74c76266ba94eb021b0cc090b97cca122f50bd7a845f587ff4bf03f"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:0853da3d5e9bc6a07b2486054a410b7b03f34046c123c6561b535bb48cc509e1"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:cb41ad20064e18a900dd427d7cf41cfaec83bcd1184001f3d91a1f76b3fcea4e"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b710bf7e7ae61957d5c4026b486be593ed3ec3dca3e5be15e0f6d8cf5d0a4990"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a952ae3eb460c6712388ac2ec706d24b0e651b9396d90c9a9e0a69eb27737fdc"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0bedd91ae1dd142a4dc15970ed2c729ff6c73f33a40fa84ed0cdbf55de87c777"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:761531076df51309075133a6bc1db02d98ec7f66e22b064b1d513bc909f29743"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a2baa6be130e8a00b6cbb9f18a33611ec150b4537f8563bddadb54c1b74b8193"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f05450fa1cd7c525c0b9d1a7916e595d3041ac0afbed2ff6926e5afb6a781b7f"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:81c4d1a3a564775c44732b94135d06e33417e829ff25226c164664f4a1046213"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:e888be685fa42d8b8a3d3911d5604d14db87538aa7d0b29b1a7ea80d354c732d"}, + {file = "rpds_py-0.12.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6f8d7fe73d1816eeb5378409adc658f9525ecbfaf9e1ede1e2d67a338b0c7348"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:0831d3ecdea22e4559cc1793f22e77067c9d8c451d55ae6a75bf1d116a8e7f42"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:513ccbf7420c30e283c25c82d5a8f439d625a838d3ba69e79a110c260c46813f"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:301bd744a1adaa2f6a5e06c98f1ac2b6f8dc31a5c23b838f862d65e32fca0d4b"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f8832a4f83d4782a8f5a7b831c47e8ffe164e43c2c148c8160ed9a6d630bc02a"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4b2416ed743ec5debcf61e1242e012652a4348de14ecc7df3512da072b074440"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35585a8cb5917161f42c2104567bb83a1d96194095fc54a543113ed5df9fa436"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d389ff1e95b6e46ebedccf7fd1fadd10559add595ac6a7c2ea730268325f832c"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9b007c2444705a2dc4a525964fd4dd28c3320b19b3410da6517cab28716f27d3"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:188912b22b6c8225f4c4ffa020a2baa6ad8fabb3c141a12dbe6edbb34e7f1425"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:1b4cf9ab9a0ae0cb122685209806d3f1dcb63b9fccdf1424fb42a129dc8c2faa"}, + {file = "rpds_py-0.12.0-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:2d34a5450a402b00d20aeb7632489ffa2556ca7b26f4a63c35f6fccae1977427"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:466030a42724780794dea71eb32db83cc51214d66ab3fb3156edd88b9c8f0d78"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:68172622a5a57deb079a2c78511c40f91193548e8ab342c31e8cb0764d362459"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54cdfcda59251b9c2f87a05d038c2ae02121219a04d4a1e6fc345794295bdc07"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6b75b912a0baa033350367a8a07a8b2d44fd5b90c890bfbd063a8a5f945f644b"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:47aeceb4363851d17f63069318ba5721ae695d9da55d599b4d6fb31508595278"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0525847f83f506aa1e28eb2057b696fe38217e12931c8b1b02198cfe6975e142"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efbe0b5e0fd078ed7b005faa0170da4f72666360f66f0bb2d7f73526ecfd99f9"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0fadfdda275c838cba5102c7f90a20f2abd7727bf8f4a2b654a5b617529c5c18"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:56dd500411d03c5e9927a1eb55621e906837a83b02350a9dc401247d0353717c"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:6915fc9fa6b3ec3569566832e1bb03bd801c12cea030200e68663b9a87974e76"}, + {file = "rpds_py-0.12.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:5f1519b080d8ce0a814f17ad9fb49fb3a1d4d7ce5891f5c85fc38631ca3a8dc4"}, + {file = "rpds_py-0.12.0.tar.gz", hash = "sha256:7036316cc26b93e401cedd781a579be606dad174829e6ad9e9c5a0da6e036f80"}, +] + +[[package]] +name = "ruamel-yaml" +version = "0.18.5" +description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruamel.yaml-0.18.5-py3-none-any.whl", hash = "sha256:a013ac02f99a69cdd6277d9664689eb1acba07069f912823177c5eced21a6ada"}, + {file = "ruamel.yaml-0.18.5.tar.gz", hash = "sha256:61917e3a35a569c1133a8f772e1226961bf5a1198bea7e23f06a0841dea1ab0e"}, +] + +[package.dependencies] +"ruamel.yaml.clib" = {version = ">=0.2.7", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.13\""} + +[package.extras] +docs = ["mercurial (>5.7)", "ryd"] +jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] + +[[package]] +name = "ruamel-yaml-clib" +version = "0.2.8" +description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" +optional = false +python-versions = ">=3.6" +files = [ + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b42169467c42b692c19cf539c38d4602069d8c1505e97b86387fcf7afb766e1d"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_13_0_arm64.whl", hash = "sha256:07238db9cbdf8fc1e9de2489a4f68474e70dffcb32232db7c08fa61ca0c7c462"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fff3573c2db359f091e1589c3d7c5fc2f86f5bdb6f24252c2d8e539d4e45f412"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:aa2267c6a303eb483de8d02db2871afb5c5fc15618d894300b88958f729ad74f"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:840f0c7f194986a63d2c2465ca63af8ccbbc90ab1c6001b1978f05119b5e7334"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:024cfe1fc7c7f4e1aff4a81e718109e13409767e4f871443cbff3dba3578203d"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win32.whl", hash = "sha256:c69212f63169ec1cfc9bb44723bf2917cbbd8f6191a00ef3410f5a7fe300722d"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win_amd64.whl", hash = "sha256:cabddb8d8ead485e255fe80429f833172b4cadf99274db39abc080e068cbcc31"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bef08cd86169d9eafb3ccb0a39edb11d8e25f3dae2b28f5c52fd997521133069"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:b16420e621d26fdfa949a8b4b47ade8810c56002f5389970db4ddda51dbff248"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:25c515e350e5b739842fc3228d662413ef28f295791af5e5110b543cf0b57d9b"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_24_aarch64.whl", hash = "sha256:1707814f0d9791df063f8c19bb51b0d1278b8e9a2353abbb676c2f685dee6afe"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:46d378daaac94f454b3a0e3d8d78cafd78a026b1d71443f4966c696b48a6d899"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:09b055c05697b38ecacb7ac50bdab2240bfca1a0c4872b0fd309bb07dc9aa3a9"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win32.whl", hash = "sha256:53a300ed9cea38cf5a2a9b069058137c2ca1ce658a874b79baceb8f892f915a7"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win_amd64.whl", hash = "sha256:c2a72e9109ea74e511e29032f3b670835f8a59bbdc9ce692c5b4ed91ccf1eedb"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ebc06178e8821efc9692ea7544aa5644217358490145629914d8020042c24aa1"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:edaef1c1200c4b4cb914583150dcaa3bc30e592e907c01117c08b13a07255ec2"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d176b57452ab5b7028ac47e7b3cf644bcfdc8cacfecf7e71759f7f51a59e5c92"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_24_aarch64.whl", hash = "sha256:1dc67314e7e1086c9fdf2680b7b6c2be1c0d8e3a8279f2e993ca2a7545fecf62"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3213ece08ea033eb159ac52ae052a4899b56ecc124bb80020d9bbceeb50258e9"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aab7fd643f71d7946f2ee58cc88c9b7bfc97debd71dcc93e03e2d174628e7e2d"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-win32.whl", hash = "sha256:5c365d91c88390c8d0a8545df0b5857172824b1c604e867161e6b3d59a827eaa"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-win_amd64.whl", hash = "sha256:1758ce7d8e1a29d23de54a16ae867abd370f01b5a69e1a3ba75223eaa3ca1a1b"}, + {file = "ruamel.yaml.clib-0.2.8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a5aa27bad2bb83670b71683aae140a1f52b0857a2deff56ad3f6c13a017a26ed"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c58ecd827313af6864893e7af0a3bb85fd529f862b6adbefe14643947cfe2942"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f481f16baec5290e45aebdc2a5168ebc6d35189ae6fea7a58787613a25f6e875"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:77159f5d5b5c14f7c34073862a6b7d34944075d9f93e681638f6d753606c6ce6"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7f67a1ee819dc4562d444bbafb135832b0b909f81cc90f7aa00260968c9ca1b3"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4ecbf9c3e19f9562c7fdd462e8d18dd902a47ca046a2e64dba80699f0b6c09b7"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:87ea5ff66d8064301a154b3933ae406b0863402a799b16e4a1d24d9fbbcbe0d3"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-win32.whl", hash = "sha256:75e1ed13e1f9de23c5607fe6bd1aeaae21e523b32d83bb33918245361e9cc51b"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-win_amd64.whl", hash = "sha256:3f215c5daf6a9d7bbed4a0a4f760f3113b10e82ff4c5c44bec20a68c8014f675"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1b617618914cb00bf5c34d4357c37aa15183fa229b24767259657746c9077615"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:a6a9ffd280b71ad062eae53ac1659ad86a17f59a0fdc7699fd9be40525153337"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:305889baa4043a09e5b76f8e2a51d4ffba44259f6b4c72dec8ca56207d9c6fe1"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:700e4ebb569e59e16a976857c8798aee258dceac7c7d6b50cab63e080058df91"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e2b4c44b60eadec492926a7270abb100ef9f72798e18743939bdbf037aab8c28"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e79e5db08739731b0ce4850bed599235d601701d5694c36570a99a0c5ca41a9d"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-win32.whl", hash = "sha256:955eae71ac26c1ab35924203fda6220f84dce57d6d7884f189743e2abe3a9fbe"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-win_amd64.whl", hash = "sha256:56f4252222c067b4ce51ae12cbac231bce32aee1d33fbfc9d17e5b8d6966c312"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03d1162b6d1df1caa3a4bd27aa51ce17c9afc2046c31b0ad60a0a96ec22f8001"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:bba64af9fa9cebe325a62fa398760f5c7206b215201b0ec825005f1b18b9bccf"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:a1a45e0bb052edf6a1d3a93baef85319733a888363938e1fc9924cb00c8df24c"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:da09ad1c359a728e112d60116f626cc9f29730ff3e0e7db72b9a2dbc2e4beed5"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:184565012b60405d93838167f425713180b949e9d8dd0bbc7b49f074407c5a8b"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a75879bacf2c987c003368cf14bed0ffe99e8e85acfa6c0bfffc21a090f16880"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-win32.whl", hash = "sha256:84b554931e932c46f94ab306913ad7e11bba988104c5cff26d90d03f68258cd5"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-win_amd64.whl", hash = "sha256:25ac8c08322002b06fa1d49d1646181f0b2c72f5cbc15a85e80b4c30a544bb15"}, + {file = "ruamel.yaml.clib-0.2.8.tar.gz", hash = "sha256:beb2e0404003de9a4cab9753a8805a8fe9320ee6673136ed7f04255fe60bb512"}, +] + [[package]] name = "six" version = "1.16.0" @@ -619,6 +1198,17 @@ files = [ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] + [[package]] name = "tomli" version = "2.0.1" @@ -630,6 +1220,27 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +[[package]] +name = "typer" +version = "0.9.0" +description = "Typer, build great CLIs. Easy to code. Based on Python type hints." +optional = false +python-versions = ">=3.6" +files = [ + {file = "typer-0.9.0-py3-none-any.whl", hash = "sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee"}, + {file = "typer-0.9.0.tar.gz", hash = "sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2"}, +] + +[package.dependencies] +click = ">=7.1.1,<9.0.0" +typing-extensions = ">=3.7.4.3" + +[package.extras] +all = ["colorama (>=0.4.3,<0.5.0)", "rich (>=10.11.0,<14.0.0)", "shellingham (>=1.3.0,<2.0.0)"] +dev = ["autoflake (>=1.3.1,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "pre-commit (>=2.17.0,<3.0.0)"] +doc = ["cairosvg (>=2.5.2,<3.0.0)", "mdx-include (>=1.4.1,<2.0.0)", "mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=8.1.4,<9.0.0)", "pillow (>=9.3.0,<10.0.0)"] +test = ["black (>=22.3.0,<23.0.0)", "coverage (>=6.2,<7.0)", "isort (>=5.0.6,<6.0.0)", "mypy (==0.910)", "pytest (>=4.4.0,<8.0.0)", "pytest-cov (>=2.10.0,<5.0.0)", "pytest-sugar (>=0.9.4,<0.10.0)", "pytest-xdist (>=1.32.0,<4.0.0)", "rich (>=10.11.0,<14.0.0)", "shellingham (>=1.3.0,<2.0.0)"] + [[package]] name = "typing-extensions" version = "4.8.0" @@ -675,4 +1286,4 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "9e1026f7795f3208eb33f8a310ba29a6c24e3c4904acc32fe5f81f2d42a95753" +content-hash = "8d0c5643cef5d4f3aaec6eb85446194a5c70e25ce83a6f5e5e9cea643dbd3da8" diff --git a/pyproject.toml b/pyproject.toml index b1dfb9456..7592339c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,10 @@ +[tool.black] +line-length = 120 +skip-string-normalization = false + +[tool.isort] +line_length = 120 + [tool.poetry] name = "pyconnectwise" version = "0.5.1" @@ -41,10 +48,39 @@ typing-extensions = "^4.8.0" [tool.poetry.group.dev.dependencies] astunparse = "^1.6" black = "^23.7" +datamodel-code-generator = "^0.23.0" isort = "^5.12" pytest = "^7.1" pytest-timeout = "^2.1" requests-mock = "^1.11" +typer = "^0.9.0" + +[tool.datamodel-codegen] +# These options are ordered/grouped to match documentation: +output-model-type = "pydantic_v2.BaseModel" + +# Typing customization +base-class = "pyconnectwise.models.base.connectwise_model.ConnectWiseModel" +enum-field-as-literal = "all" +field-constraints = true +set-default-enum-member = true +use-annotated = true +use-standard-collections = true +use-union-operator = true + +#Field customization +capitalise-enum-members = true +remove-special-field-name-prefix = true +snake-case-field = true +use-default = true +use-field-description = true + +# Model customization +disable-timestamp = true +collapse-rool-models = true +reuse-model = true +target-python-version = "3.10" +use-title-as-name = true [build-system] requires = ["poetry-core"] @@ -67,18 +103,29 @@ select = [ "ASYNC", "B", "C", + "C90", + "DTZ", "E", "F", + "FBT", "FIX", "FLY", + "FURB", + "I", + "INP", "N8", "PERF", + "PT", "PTH", "RET", "RUF", + "S", "SIM", + "T10", "TCH", + "TID", "TRY", + "UP", ] # ANN101,ANN102 annotating self,cls is silly # E501 is replaced by flake8-bugbear B950 @@ -87,8 +134,7 @@ ignore = ["ANN101", "ANN102", "E402", "E501", "E722"] src = ["src", "tests"] -# Match black default -line-length = 88 +line-length = 120 [tool.ruff.isort] combine-as-imports = true @@ -99,4 +145,5 @@ combine-as-imports = true "src/pyconnectwise/endpoints/**" = ["A003"] "src/pyconnectwise/models/**" = ["A003"] # Documenting return types on pytest tests is pointless -"tests/**" = ["ANN201"] +# S101 - Using assert in tests is fine +"tests/**" = ["ANN201", "S101"] diff --git a/src/pyconnectwise/clients/automate_client.py b/src/pyconnectwise/clients/automate_client.py index dddcec5dd..26ca20467 100644 --- a/src/pyconnectwise/clients/automate_client.py +++ b/src/pyconnectwise/clients/automate_client.py @@ -1,39 +1,42 @@ -from datetime import datetime +import typing +from datetime import UTC, datetime from pyconnectwise.clients.connectwise_client import ConnectWiseClient from pyconnectwise.config import Config -from pyconnectwise.endpoints.automate.ClientsEndpoint import ClientsEndpoint -from pyconnectwise.endpoints.automate.CommandsEndpoint import CommandsEndpoint -from pyconnectwise.endpoints.automate.ComputersEndpoint import ComputersEndpoint -from pyconnectwise.endpoints.automate.ContactsEndpoint import ContactsEndpoint -from pyconnectwise.endpoints.automate.DataviewfoldersEndpoint import ( - DataviewfoldersEndpoint, -) -from pyconnectwise.endpoints.automate.DataviewsEndpoint import DataviewsEndpoint -from pyconnectwise.endpoints.automate.DrivesEndpoint import DrivesEndpoint -from pyconnectwise.endpoints.automate.ExternalsystemcredentialsEndpoint import ( - ExternalsystemcredentialsEndpoint, -) -from pyconnectwise.endpoints.automate.GroupsEndpoint import GroupsEndpoint -from pyconnectwise.endpoints.automate.LocationsEndpoint import LocationsEndpoint -from pyconnectwise.endpoints.automate.LookupsEndpoint import LookupsEndpoint -from pyconnectwise.endpoints.automate.MonitorsEndpoint import MonitorsEndpoint -from pyconnectwise.endpoints.automate.NetworkdevicesEndpoint import ( - NetworkdevicesEndpoint, -) -from pyconnectwise.endpoints.automate.PatchactionsEndpoint import PatchactionsEndpoint -from pyconnectwise.endpoints.automate.PermissionsEndpoint import PermissionsEndpoint -from pyconnectwise.endpoints.automate.ProbeconfigurationEndpoint import ( - ProbeconfigurationEndpoint, -) -from pyconnectwise.endpoints.automate.ScriptfoldersEndpoint import ScriptfoldersEndpoint -from pyconnectwise.endpoints.automate.ScriptingEndpoint import ScriptingEndpoint -from pyconnectwise.endpoints.automate.ScriptsEndpoint import ScriptsEndpoint -from pyconnectwise.endpoints.automate.ServicesEndpoint import ServicesEndpoint -from pyconnectwise.endpoints.automate.StatisticsEndpoint import StatisticsEndpoint -from pyconnectwise.endpoints.automate.SystemEndpoint import SystemEndpoint -from pyconnectwise.endpoints.automate.UserclassesEndpoint import UserclassesEndpoint -from pyconnectwise.endpoints.automate.UsersEndpoint import UsersEndpoint + +if typing.TYPE_CHECKING: + from pyconnectwise.endpoints.automate.ClientsEndpoint import ClientsEndpoint + from pyconnectwise.endpoints.automate.CommandsEndpoint import CommandsEndpoint + from pyconnectwise.endpoints.automate.ComputersEndpoint import ComputersEndpoint + from pyconnectwise.endpoints.automate.ContactsEndpoint import ContactsEndpoint + from pyconnectwise.endpoints.automate.DataviewfoldersEndpoint import ( + DataviewfoldersEndpoint, + ) + from pyconnectwise.endpoints.automate.DataviewsEndpoint import DataviewsEndpoint + from pyconnectwise.endpoints.automate.DrivesEndpoint import DrivesEndpoint + from pyconnectwise.endpoints.automate.ExternalsystemcredentialsEndpoint import ( + ExternalsystemcredentialsEndpoint, + ) + from pyconnectwise.endpoints.automate.GroupsEndpoint import GroupsEndpoint + from pyconnectwise.endpoints.automate.LocationsEndpoint import LocationsEndpoint + from pyconnectwise.endpoints.automate.LookupsEndpoint import LookupsEndpoint + from pyconnectwise.endpoints.automate.MonitorsEndpoint import MonitorsEndpoint + from pyconnectwise.endpoints.automate.NetworkdevicesEndpoint import ( + NetworkdevicesEndpoint, + ) + from pyconnectwise.endpoints.automate.PatchactionsEndpoint import PatchactionsEndpoint + from pyconnectwise.endpoints.automate.PermissionsEndpoint import PermissionsEndpoint + from pyconnectwise.endpoints.automate.ProbeconfigurationEndpoint import ( + ProbeconfigurationEndpoint, + ) + from pyconnectwise.endpoints.automate.ScriptfoldersEndpoint import ScriptfoldersEndpoint + from pyconnectwise.endpoints.automate.ScriptingEndpoint import ScriptingEndpoint + from pyconnectwise.endpoints.automate.ScriptsEndpoint import ScriptsEndpoint + from pyconnectwise.endpoints.automate.ServicesEndpoint import ServicesEndpoint + from pyconnectwise.endpoints.automate.StatisticsEndpoint import StatisticsEndpoint + from pyconnectwise.endpoints.automate.SystemEndpoint import SystemEndpoint + from pyconnectwise.endpoints.automate.UserclassesEndpoint import UserclassesEndpoint + from pyconnectwise.endpoints.automate.UsersEndpoint import UsersEndpoint class ConnectWiseAutomateAPIClient(ConnectWiseClient): @@ -65,7 +68,7 @@ def __init__( self.automate_url: str = automate_url self.username: str = username self.password: str = password - self.token_expiry_time: datetime = datetime.utcnow() + self.token_expiry_time: datetime = datetime.now(tz=UTC) if config: self.config = config @@ -73,31 +76,150 @@ def __init__( # Grab first access token self.access_token: str = self._get_access_token() - # Initializing endpoints - self.commands = CommandsEndpoint(self) - self.clients = ClientsEndpoint(self) - self.computers = ComputersEndpoint(self) - self.services = ServicesEndpoint(self) - self.contacts = ContactsEndpoint(self) - self.dataviewfolders = DataviewfoldersEndpoint(self) - self.dataviews = DataviewsEndpoint(self) - self.groups = GroupsEndpoint(self) - self.monitors = MonitorsEndpoint(self) - self.networkdevices = NetworkdevicesEndpoint(self) - self.patchactions = PatchactionsEndpoint(self) - self.locations = LocationsEndpoint(self) - self.lookups = LookupsEndpoint(self) - self.probeconfiguration = ProbeconfigurationEndpoint(self) - self.scriptfolders = ScriptfoldersEndpoint(self) - self.scripting = ScriptingEndpoint(self) - self.scripts = ScriptsEndpoint(self) - self.drives = DrivesEndpoint(self) - self.statistics = StatisticsEndpoint(self) - self.system = SystemEndpoint(self) - self.externalsystemcredentials = ExternalsystemcredentialsEndpoint(self) - self.permissions = PermissionsEndpoint(self) - self.userclasses = UserclassesEndpoint(self) - self.users = UsersEndpoint(self) + # Initializing endpoints + @property + def commands(self) -> "CommandsEndpoint": + from pyconnectwise.endpoints.automate import CommandsEndpoint + + return CommandsEndpoint(self) + + @property + def clients(self) -> "ClientsEndpoint": + from pyconnectwise.endpoints.automate import ClientsEndpoint + + return ClientsEndpoint(self) + + @property + def computers(self) -> "ComputersEndpoint": + from pyconnectwise.endpoints.automate import ComputersEndpoint + + return ComputersEndpoint(self) + + @property + def services(self) -> "ServicesEndpoint": + from pyconnectwise.endpoints.automate import ServicesEndpoint + + return ServicesEndpoint(self) + + @property + def contacts(self) -> "ContactsEndpoint": + from pyconnectwise.endpoints.automate import ContactsEndpoint + + return ContactsEndpoint(self) + + @property + def dataviewfolders(self) -> "DataviewfoldersEndpoint": + from pyconnectwise.endpoints.automate import DataviewfoldersEndpoint + + return DataviewfoldersEndpoint(self) + + @property + def dataviews(self) -> "DataviewsEndpoint": + from pyconnectwise.endpoints.automate import DataviewsEndpoint + + return DataviewsEndpoint(self) + + @property + def groups(self) -> "GroupsEndpoint": + from pyconnectwise.endpoints.automate import GroupsEndpoint + + return GroupsEndpoint(self) + + @property + def monitors(self) -> "MonitorsEndpoint": + from pyconnectwise.endpoints.automate import MonitorsEndpoint + + return MonitorsEndpoint(self) + + @property + def networkdevices(self) -> "NetworkdevicesEndpoint": + from pyconnectwise.endpoints.automate import NetworkdevicesEndpoint + + return NetworkdevicesEndpoint(self) + + @property + def patchactions(self) -> "PatchactionsEndpoint": + from pyconnectwise.endpoints.automate import PatchactionsEndpoint + + return PatchactionsEndpoint(self) + + @property + def locations(self) -> "LocationsEndpoint": + from pyconnectwise.endpoints.automate import LocationsEndpoint + + return LocationsEndpoint(self) + + @property + def lookups(self) -> "LookupsEndpoint": + from pyconnectwise.endpoints.automate import LookupsEndpoint + + return LookupsEndpoint(self) + + @property + def probeconfiguration(self) -> "ProbeconfigurationEndpoint": + from pyconnectwise.endpoints.automate import ProbeconfigurationEndpoint + + return ProbeconfigurationEndpoint(self) + + @property + def scriptfolders(self) -> "ScriptfoldersEndpoint": + from pyconnectwise.endpoints.automate import ScriptfoldersEndpoint + + return ScriptfoldersEndpoint(self) + + @property + def scripting(self) -> "ScriptingEndpoint": + from pyconnectwise.endpoints.automate import ScriptingEndpoint + + return ScriptingEndpoint(self) + + @property + def scripts(self) -> "ScriptsEndpoint": + from pyconnectwise.endpoints.automate import ScriptsEndpoint + + return ScriptsEndpoint(self) + + @property + def drives(self) -> "DrivesEndpoint": + from pyconnectwise.endpoints.automate import DrivesEndpoint + + return DrivesEndpoint(self) + + @property + def statistics(self) -> "StatisticsEndpoint": + from pyconnectwise.endpoints.automate import StatisticsEndpoint + + return StatisticsEndpoint(self) + + @property + def system(self) -> "SystemEndpoint": + from pyconnectwise.endpoints.automate import SystemEndpoint + + return SystemEndpoint(self) + + @property + def externalsystemcredentials(self) -> "ExternalsystemcredentialsEndpoint": + from pyconnectwise.endpoints.automate import ExternalsystemcredentialsEndpoint + + return ExternalsystemcredentialsEndpoint(self) + + @property + def permissions(self) -> "PermissionsEndpoint": + from pyconnectwise.endpoints.automate import PermissionsEndpoint + + return PermissionsEndpoint(self) + + @property + def userclasses(self) -> "UserclassesEndpoint": + from pyconnectwise.endpoints.automate import UserclassesEndpoint + + return UserclassesEndpoint(self) + + @property + def users(self) -> "UsersEndpoint": + from pyconnectwise.endpoints.automate import UsersEndpoint + + return UsersEndpoint(self) def _get_url(self) -> str: """ @@ -120,13 +242,11 @@ def _get_access_token(self) -> str: ) auth_resp_json = auth_response.json() token = auth_resp_json["AccessToken"] - self.token_expiry_time = datetime.fromisoformat( - auth_resp_json["ExpirationDate"] - ) + self.token_expiry_time = datetime.fromisoformat(auth_resp_json["ExpirationDate"]) return token def _refresh_access_token_if_necessary(self): # noqa: ANN202 - if datetime.utcnow() > self.token_expiry_time: + if datetime.now(tz=UTC) > self.token_expiry_time: self.access_token = self._get_access_token() def _get_headers(self) -> dict[str, str]: diff --git a/src/pyconnectwise/clients/connectwise_client.py b/src/pyconnectwise/clients/connectwise_client.py index d9069b3e4..2e53e80fd 100644 --- a/src/pyconnectwise/clients/connectwise_client.py +++ b/src/pyconnectwise/clients/connectwise_client.py @@ -1,5 +1,8 @@ from __future__ import annotations +import contextlib +import json +import warnings from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, cast @@ -14,6 +17,7 @@ MalformedRequestException, MethodNotAllowedException, NotFoundException, + ObjectExistsError, PermissionsFailedException, ServerError, ) @@ -81,6 +85,21 @@ def _make_request( # noqa: C901 params=cast(dict[str, Any], params or {}), ) if not response.ok: + with contextlib.suppress(json.JSONDecodeError): + details: dict = response.json() + if response.status_code == 400: # noqa: SIM102 (Expecting to handle other codes in the future) + if details.get("code") == "InvalidObject": + errors = details.get("errors", []) + if len(errors) > 1: + warnings.warn( + "Found multiple errors - we may be masking some important error details. Please submit a Github issue with response.status_code and response.content so we can improve this error handling.", + stacklevel=1, + ) + for error in errors: + if error.get("code") == "ObjectExists": + error.pop("code") # Don't need code in message + raise ObjectExistsError(response, extra_message=json.dumps(error, indent=4)) + if response.status_code == 400: raise MalformedRequestException(response) if response.status_code == 401: @@ -101,9 +120,7 @@ def _make_request( # noqa: C901 if "timeout" in (response.text + response.reason).lower(): if retry_count < self.config.max_retries: retry_count += 1 - return self._make_request( - method, url, data, params, headers, retry_count - ) + return self._make_request(method, url, data, params, headers, retry_count) raise Timeout(response=response) raise ServerError(response) diff --git a/src/pyconnectwise/clients/manage_client.py b/src/pyconnectwise/clients/manage_client.py index 4fb02843d..2f1e348c5 100644 --- a/src/pyconnectwise/clients/manage_client.py +++ b/src/pyconnectwise/clients/manage_client.py @@ -1,19 +1,27 @@ import base64 +import typing from pyconnectwise.clients.connectwise_client import ConnectWiseClient from pyconnectwise.config import Config -from pyconnectwise.endpoints.manage.CompanyEndpoint import CompanyEndpoint -from pyconnectwise.endpoints.manage.ConfigurationsEndpoint import ConfigurationsEndpoint -from pyconnectwise.endpoints.manage.ExpenseEndpoint import ExpenseEndpoint -from pyconnectwise.endpoints.manage.FinanceEndpoint import FinanceEndpoint -from pyconnectwise.endpoints.manage.MarketingEndpoint import MarketingEndpoint -from pyconnectwise.endpoints.manage.ProcurementEndpoint import ProcurementEndpoint -from pyconnectwise.endpoints.manage.ProjectEndpoint import ProjectEndpoint -from pyconnectwise.endpoints.manage.SalesEndpoint import SalesEndpoint -from pyconnectwise.endpoints.manage.ScheduleEndpoint import ScheduleEndpoint -from pyconnectwise.endpoints.manage.ServiceEndpoint import ServiceEndpoint -from pyconnectwise.endpoints.manage.SystemEndpoint import SystemEndpoint -from pyconnectwise.endpoints.manage.TimeEndpoint import TimeEndpoint + +if typing.TYPE_CHECKING: + from pyconnectwise.endpoints.manage.CompanyEndpoint import CompanyEndpoint + from pyconnectwise.endpoints.manage.ConfigurationsEndpoint import ConfigurationsEndpoint + from pyconnectwise.endpoints.manage.ExpenseEndpoint import ExpenseEndpoint + from pyconnectwise.endpoints.manage.FinanceEndpoint import FinanceEndpoint + from pyconnectwise.endpoints.manage.MarketingEndpoint import MarketingEndpoint + from pyconnectwise.endpoints.manage.ProcurementEndpoint import ProcurementEndpoint + from pyconnectwise.endpoints.manage.ProjectEndpoint import ProjectEndpoint + from pyconnectwise.endpoints.manage.SalesEndpoint import SalesEndpoint + from pyconnectwise.endpoints.manage.ScheduleEndpoint import ScheduleEndpoint + from pyconnectwise.endpoints.manage.ServiceEndpoint import ServiceEndpoint + from pyconnectwise.endpoints.manage.SystemEndpoint import SystemEndpoint + from pyconnectwise.endpoints.manage.TimeEndpoint import TimeEndpoint + + +class ManageCodebaseError(Exception): + def __init__(self) -> None: + super().__init__("Could not retrieve codebase from API.") class ConnectWiseManageAPIClient(ConnectWiseClient): @@ -64,24 +72,81 @@ def __init__( if codebase_request is None: # we need to except here - raise Exception( # noqa: TRY002, TRY003 - "Could not retrieve codebase from API." - ) + raise ManageCodebaseError() self.codebase: str = codebase_request - # Initializing endpoints - self.company = CompanyEndpoint(self) - self.configurations = ConfigurationsEndpoint(self) - self.expense = ExpenseEndpoint(self) - self.finance = FinanceEndpoint(self) - self.marketing = MarketingEndpoint(self) - self.procurement = ProcurementEndpoint(self) - self.project = ProjectEndpoint(self) - self.sales = SalesEndpoint(self) - self.schedule = ScheduleEndpoint(self) - self.service = ServiceEndpoint(self) - self.system = SystemEndpoint(self) - self.time = TimeEndpoint(self) + # Initializing endpoints + @property + def company(self) -> "CompanyEndpoint": + from pyconnectwise.endpoints.manage.CompanyEndpoint import CompanyEndpoint + + return CompanyEndpoint(self) + + @property + def configurations(self) -> "ConfigurationsEndpoint": + from pyconnectwise.endpoints.manage.ConfigurationsEndpoint import ConfigurationsEndpoint + + return ConfigurationsEndpoint(self) + + @property + def expense(self) -> "ExpenseEndpoint": + from pyconnectwise.endpoints.manage.ExpenseEndpoint import ExpenseEndpoint + + return ExpenseEndpoint(self) + + @property + def finance(self) -> "FinanceEndpoint": + from pyconnectwise.endpoints.manage.FinanceEndpoint import FinanceEndpoint + + return FinanceEndpoint(self) + + @property + def marketing(self) -> "MarketingEndpoint": + from pyconnectwise.endpoints.manage.MarketingEndpoint import MarketingEndpoint + + return MarketingEndpoint(self) + + @property + def procurement(self) -> "ProcurementEndpoint": + from pyconnectwise.endpoints.manage.ProcurementEndpoint import ProcurementEndpoint + + return ProcurementEndpoint(self) + + @property + def project(self) -> "ProjectEndpoint": + from pyconnectwise.endpoints.manage.ProjectEndpoint import ProjectEndpoint + + return ProjectEndpoint(self) + + @property + def sales(self) -> "SalesEndpoint": + from pyconnectwise.endpoints.manage.SalesEndpoint import SalesEndpoint + + return SalesEndpoint(self) + + @property + def schedule(self) -> "ScheduleEndpoint": + from pyconnectwise.endpoints.manage.ScheduleEndpoint import ScheduleEndpoint + + return ScheduleEndpoint(self) + + @property + def service(self) -> "ServiceEndpoint": + from pyconnectwise.endpoints.manage.ServiceEndpoint import ServiceEndpoint + + return ServiceEndpoint(self) + + @property + def system(self) -> "SystemEndpoint": + from pyconnectwise.endpoints.manage.SystemEndpoint import SystemEndpoint + + return SystemEndpoint(self) + + @property + def time(self) -> "TimeEndpoint": + from pyconnectwise.endpoints.manage.TimeEndpoint import TimeEndpoint + + return TimeEndpoint(self) def _get_url(self) -> str: """ @@ -92,9 +157,7 @@ def _get_url(self) -> str: """ return f"https://{self.manage_url}/{self.codebase.strip('/')}/apis/3.0" - def _try_get_codebase_from_api( - self, manage_url: str, company_name: str, headers: dict[str, str] - ) -> str: + def _try_get_codebase_from_api(self, manage_url: str, company_name: str, headers: dict[str, str]) -> str: """ Tries to retrieve the codebase from the API using the provided company url, company name and headers. diff --git a/src/pyconnectwise/endpoints/automate/ApitokenEndpoint.py b/src/pyconnectwise/endpoints/automate/ApitokenEndpoint.py index 125a2b013..d692c3bf3 100644 --- a/src/pyconnectwise/endpoints/automate/ApitokenEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ApitokenEndpoint.py @@ -16,9 +16,7 @@ class ApitokenEndpoint( IPostable[AutomateTokenResult, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Apitoken", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Apitoken", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateAuthInformation) IPostable.__init__(self, AutomateTokenResult) diff --git a/src/pyconnectwise/endpoints/automate/ApprovalpoliciesEndpoint.py b/src/pyconnectwise/endpoints/automate/ApprovalpoliciesEndpoint.py index 5c944e068..2e49b3da9 100644 --- a/src/pyconnectwise/endpoints/automate/ApprovalpoliciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ApprovalpoliciesEndpoint.py @@ -3,6 +3,4 @@ class ApprovalpoliciesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Approvalpolicies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Approvalpolicies", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/AvtemplatepoliciesEndpoint.py b/src/pyconnectwise/endpoints/automate/AvtemplatepoliciesEndpoint.py index bf7c5e14d..058ae2107 100644 --- a/src/pyconnectwise/endpoints/automate/AvtemplatepoliciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/AvtemplatepoliciesEndpoint.py @@ -14,9 +14,7 @@ class AvtemplatepoliciesEndpoint( IPostable[LabTechAVTemplatePolicy, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Avtemplatepolicies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Avtemplatepolicies", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechAVTemplatePolicy) def post( diff --git a/src/pyconnectwise/endpoints/automate/AvtemplatepolicydataEndpoint.py b/src/pyconnectwise/endpoints/automate/AvtemplatepolicydataEndpoint.py index aa90044b5..afa49de3e 100644 --- a/src/pyconnectwise/endpoints/automate/AvtemplatepolicydataEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/AvtemplatepolicydataEndpoint.py @@ -14,9 +14,7 @@ class AvtemplatepolicydataEndpoint( IPostable[LabTechAVTemplatePolicyData, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Avtemplatepolicydata", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Avtemplatepolicydata", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechAVTemplatePolicyData) def post( diff --git a/src/pyconnectwise/endpoints/automate/ClientsEndpoint.py b/src/pyconnectwise/endpoints/automate/ClientsEndpoint.py index a533499a6..981f6aa41 100644 --- a/src/pyconnectwise/endpoints/automate/ClientsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ClientsEndpoint.py @@ -20,9 +20,7 @@ class ClientsEndpoint( IPaginateable[LabTechClient, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Clients", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Clients", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechClient]) IPostable.__init__(self, LabTechClient) IPaginateable.__init__(self, LabTechClient) @@ -84,9 +82,7 @@ def get( Returns: list[LabTechClient]: The parsed response data. """ - return self._parse_many( - LabTechClient, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LabTechClient, super()._make_request("GET", data=data, params=params).json()) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/ClientsIdDocumentsEndpoint.py b/src/pyconnectwise/endpoints/automate/ClientsIdDocumentsEndpoint.py index 54586d457..d36dc7946 100644 --- a/src/pyconnectwise/endpoints/automate/ClientsIdDocumentsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ClientsIdDocumentsEndpoint.py @@ -17,9 +17,7 @@ class ClientsIdDocumentsEndpoint( IPaginateable[LabTechDocument, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Documents", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Documents", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDocument]) IPaginateable.__init__(self, LabTechDocument) diff --git a/src/pyconnectwise/endpoints/automate/ClientsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ClientsIdEndpoint.py index de92d0713..cfbb46934 100644 --- a/src/pyconnectwise/endpoints/automate/ClientsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ClientsIdEndpoint.py @@ -29,24 +29,14 @@ class ClientsIdEndpoint( IPaginateable[LabTechClient, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechClient) IPaginateable.__init__(self, LabTechClient) - self.permissions = self._register_child_endpoint( - ClientsIdPermissionsEndpoint(client, parent_endpoint=self) - ) - self.licenses = self._register_child_endpoint( - ClientsIdLicensesEndpoint(client, parent_endpoint=self) - ) - self.documents = self._register_child_endpoint( - ClientsIdDocumentsEndpoint(client, parent_endpoint=self) - ) - self.productkeys = self._register_child_endpoint( - ClientsIdProductkeysEndpoint(client, parent_endpoint=self) - ) + self.permissions = self._register_child_endpoint(ClientsIdPermissionsEndpoint(client, parent_endpoint=self)) + self.licenses = self._register_child_endpoint(ClientsIdLicensesEndpoint(client, parent_endpoint=self)) + self.documents = self._register_child_endpoint(ClientsIdDocumentsEndpoint(client, parent_endpoint=self)) + self.productkeys = self._register_child_endpoint(ClientsIdProductkeysEndpoint(client, parent_endpoint=self)) def paginated( self, @@ -92,6 +82,4 @@ def get( Returns: LabTechClient: The parsed response data. """ - return self._parse_one( - LabTechClient, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(LabTechClient, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/automate/ClientsIdLicensesEndpoint.py b/src/pyconnectwise/endpoints/automate/ClientsIdLicensesEndpoint.py index 89db0f5a0..bcce02381 100644 --- a/src/pyconnectwise/endpoints/automate/ClientsIdLicensesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ClientsIdLicensesEndpoint.py @@ -19,9 +19,7 @@ class ClientsIdLicensesEndpoint( IPaginateable[LabTechManagedLicense, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Licenses", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Licenses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechManagedLicense]) IPostable.__init__(self, LabTechManagedLicense) IPaginateable.__init__(self, LabTechManagedLicense) diff --git a/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsEndpoint.py b/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsEndpoint.py index 61fb10684..f7ebbaf32 100644 --- a/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsEndpoint.py @@ -6,9 +6,7 @@ class ClientsIdPermissionsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Permissions", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Permissions", parent_endpoint=parent_endpoint) def id(self, id: int) -> ClientsIdPermissionsIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsIdEndpoint.py index b514869f4..9663c84a0 100644 --- a/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ClientsIdPermissionsIdEndpoint.py @@ -7,9 +7,7 @@ class ClientsIdPermissionsIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) def delete( self, diff --git a/src/pyconnectwise/endpoints/automate/ClientsIdProductkeysEndpoint.py b/src/pyconnectwise/endpoints/automate/ClientsIdProductkeysEndpoint.py index c13701ba7..257d0a8e1 100644 --- a/src/pyconnectwise/endpoints/automate/ClientsIdProductkeysEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ClientsIdProductkeysEndpoint.py @@ -19,9 +19,7 @@ class ClientsIdProductkeysEndpoint( IPaginateable[LabTechProductKey, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Productkeys", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Productkeys", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechProductKey]) IPostable.__init__(self, LabTechProductKey) IPaginateable.__init__(self, LabTechProductKey) diff --git a/src/pyconnectwise/endpoints/automate/CommandsEndpoint.py b/src/pyconnectwise/endpoints/automate/CommandsEndpoint.py index 9d013ca99..e91ab3888 100644 --- a/src/pyconnectwise/endpoints/automate/CommandsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/CommandsEndpoint.py @@ -18,9 +18,7 @@ class CommandsEndpoint( IPaginateable[LabTechCommand, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Commands", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Commands", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechCommand]) IPaginateable.__init__(self, LabTechCommand) diff --git a/src/pyconnectwise/endpoints/automate/CommandsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/CommandsIdEndpoint.py index 4b1f18e4f..3bbe4f031 100644 --- a/src/pyconnectwise/endpoints/automate/CommandsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/CommandsIdEndpoint.py @@ -17,9 +17,7 @@ class CommandsIdEndpoint( IPaginateable[LabTechCommand, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechCommand) IPaginateable.__init__(self, LabTechCommand) diff --git a/src/pyconnectwise/endpoints/automate/ComputermenusEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputermenusEndpoint.py index f7a1de1c5..96097473c 100644 --- a/src/pyconnectwise/endpoints/automate/ComputermenusEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputermenusEndpoint.py @@ -19,9 +19,7 @@ class ComputermenusEndpoint( IPaginateable[LabTechComputerMenu, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Computermenus", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Computermenus", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerMenu]) IPostable.__init__(self, LabTechComputerMenu) IPaginateable.__init__(self, LabTechComputerMenu) diff --git a/src/pyconnectwise/endpoints/automate/ComputersChassisEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersChassisEndpoint.py index 15cb20032..57fea5ea5 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersChassisEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersChassisEndpoint.py @@ -17,9 +17,7 @@ class ComputersChassisEndpoint( IPaginateable[LabTechComputerChassis, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Chassis", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Chassis", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerChassis]) IPaginateable.__init__(self, LabTechComputerChassis) diff --git a/src/pyconnectwise/endpoints/automate/ComputersDrivesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersDrivesEndpoint.py index e274096dc..713d2cf6d 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersDrivesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersDrivesEndpoint.py @@ -17,9 +17,7 @@ class ComputersDrivesEndpoint( IPaginateable[LabTechComputerDrive, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Drives", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Drives", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerDrive]) IPaginateable.__init__(self, LabTechComputerDrive) diff --git a/src/pyconnectwise/endpoints/automate/ComputersEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersEndpoint.py index ad077ad18..8333c1fa7 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersEndpoint.py @@ -33,24 +33,14 @@ class ComputersEndpoint( IPaginateable[LabTechComputer, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Computers", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Computers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputer]) IPaginateable.__init__(self, LabTechComputer) - self.memoryslots = self._register_child_endpoint( - ComputersMemoryslotsEndpoint(client, parent_endpoint=self) - ) - self.software = self._register_child_endpoint( - ComputersSoftwareEndpoint(client, parent_endpoint=self) - ) - self.drives = self._register_child_endpoint( - ComputersDrivesEndpoint(client, parent_endpoint=self) - ) - self.chassis = self._register_child_endpoint( - ComputersChassisEndpoint(client, parent_endpoint=self) - ) + self.memoryslots = self._register_child_endpoint(ComputersMemoryslotsEndpoint(client, parent_endpoint=self)) + self.software = self._register_child_endpoint(ComputersSoftwareEndpoint(client, parent_endpoint=self)) + self.drives = self._register_child_endpoint(ComputersDrivesEndpoint(client, parent_endpoint=self)) + self.chassis = self._register_child_endpoint(ComputersChassisEndpoint(client, parent_endpoint=self)) self.maintenancemodes = self._register_child_endpoint( ComputersMaintenancemodesEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsEndpoint.py index b366bd966..87040591e 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsEndpoint.py @@ -3,6 +3,4 @@ class ComputersIdAlertsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Alerts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Alerts", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsEndpoint.py index 8aa21a80a..ad37d8b01 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsEndpoint.py @@ -9,17 +9,11 @@ class ComputersIdAlertsuspensionsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Alertsuspensions", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Alertsuspensions", parent_endpoint=parent_endpoint) self.templatediversion = self._register_child_endpoint( - ComputersIdAlertsuspensionsTemplatediversionEndpoint( - client, parent_endpoint=self - ) + ComputersIdAlertsuspensionsTemplatediversionEndpoint(client, parent_endpoint=self) ) self.maintenancewindow = self._register_child_endpoint( - ComputersIdAlertsuspensionsMaintenancewindowEndpoint( - client, parent_endpoint=self - ) + ComputersIdAlertsuspensionsMaintenancewindowEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsMaintenancewindowEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsMaintenancewindowEndpoint.py index f863f7b07..16e06e941 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsMaintenancewindowEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsMaintenancewindowEndpoint.py @@ -3,6 +3,4 @@ class ComputersIdAlertsuspensionsMaintenancewindowEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Maintenancewindow", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Maintenancewindow", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsTemplatediversionEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsTemplatediversionEndpoint.py index 92a38bb58..b42ecd6bd 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsTemplatediversionEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdAlertsuspensionsTemplatediversionEndpoint.py @@ -3,6 +3,4 @@ class ComputersIdAlertsuspensionsTemplatediversionEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Templatediversion", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Templatediversion", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdBiosEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdBiosEndpoint.py index 47f91c2bf..ec5e17101 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdBiosEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdBiosEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdBiosEndpoint( IPaginateable[LabTechComputerBios, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Bios", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Bios", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechComputerBios) IPaginateable.__init__(self, LabTechComputerBios) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdCommandexecuteEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdCommandexecuteEndpoint.py index 63674e94b..d236455f3 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdCommandexecuteEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdCommandexecuteEndpoint.py @@ -19,9 +19,7 @@ class ComputersIdCommandexecuteEndpoint( IPaginateable[LabTechCommandExecute, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Commandexecute", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Commandexecute", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechCommandExecute]) IPostable.__init__(self, LabTechCommandExecute) IPaginateable.__init__(self, LabTechCommandExecute) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdCommandhistoryEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdCommandhistoryEndpoint.py index a8e8af864..aefa95f46 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdCommandhistoryEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdCommandhistoryEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdCommandhistoryEndpoint( IPaginateable[AutomateCommandHistory, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Commandhistory", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Commandhistory", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateCommandHistory]) IPaginateable.__init__(self, AutomateCommandHistory) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdComputerpatchingpoliciesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdComputerpatchingpoliciesEndpoint.py index ddb81ed3a..3121ab39e 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdComputerpatchingpoliciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdComputerpatchingpoliciesEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdComputerpatchingpoliciesEndpoint( IPaginateable[LabTechComputerPatchingPolicy, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Computerpatchingpolicies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Computerpatchingpolicies", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerPatchingPolicy]) IPaginateable.__init__(self, LabTechComputerPatchingPolicy) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdDevicesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdDevicesEndpoint.py index d16f1c5cd..81de825c9 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdDevicesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdDevicesEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdDevicesEndpoint( IPaginateable[LabTechComputerDevice, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Devices", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Devices", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerDevice]) IPaginateable.__init__(self, LabTechComputerDevice) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdDriversEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdDriversEndpoint.py index c217afea5..5d5c948d9 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdDriversEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdDriversEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdDriversEndpoint( IPaginateable[LabTechComputerDriver, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Drivers", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Drivers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerDriver]) IPaginateable.__init__(self, LabTechComputerDriver) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdDrivesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdDrivesEndpoint.py index e6b7f3a41..5624852ba 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdDrivesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdDrivesEndpoint.py @@ -6,9 +6,7 @@ class ComputersIdDrivesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Drives", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Drives", parent_endpoint=parent_endpoint) def id(self, id: int) -> ComputersIdDrivesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdEndpoint.py index 0502d3dc8..95a6acc55 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdEndpoint.py @@ -6,9 +6,7 @@ class ComputersIdDrivesIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.smartdata = self._register_child_endpoint( ComputersIdDrivesIdSmartdataEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdSmartdataEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdSmartdataEndpoint.py index d25feb665..3f00219d0 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdSmartdataEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdDrivesIdSmartdataEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdDrivesIdSmartdataEndpoint( IPaginateable[LabTechSmartData, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Smartdata", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Smartdata", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechSmartData]) IPaginateable.__init__(self, LabTechSmartData) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdEffectivepatchingpolicyEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdEffectivepatchingpolicyEndpoint.py index 15c3e43d9..5a64ff0e7 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdEffectivepatchingpolicyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdEffectivepatchingpolicyEndpoint.py @@ -14,14 +14,10 @@ class ComputersIdEffectivepatchingpolicyEndpoint( ConnectWiseEndpoint, IGettable[LabTechComputerEffectivePatchingPolicy, ConnectWiseAutomateRequestParams], - IPaginateable[ - LabTechComputerEffectivePatchingPolicy, ConnectWiseAutomateRequestParams - ], + IPaginateable[LabTechComputerEffectivePatchingPolicy, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Effectivepatchingpolicy", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Effectivepatchingpolicy", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechComputerEffectivePatchingPolicy) IPaginateable.__init__(self, LabTechComputerEffectivePatchingPolicy) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdEndpoint.py index 1f015d938..a74d847e3 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdEndpoint.py @@ -104,93 +104,61 @@ class ComputersIdEndpoint( IPaginateable[LabTechComputer, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechComputer) IPaginateable.__init__(self, LabTechComputer) - self.printers = self._register_child_endpoint( - ComputersIdPrintersEndpoint(client, parent_endpoint=self) - ) + self.printers = self._register_child_endpoint(ComputersIdPrintersEndpoint(client, parent_endpoint=self)) self.commandhistory = self._register_child_endpoint( ComputersIdCommandhistoryEndpoint(client, parent_endpoint=self) ) - self.alerts = self._register_child_endpoint( - ComputersIdAlertsEndpoint(client, parent_endpoint=self) - ) + self.alerts = self._register_child_endpoint(ComputersIdAlertsEndpoint(client, parent_endpoint=self)) self.operatingsystem = self._register_child_endpoint( ComputersIdOperatingsystemEndpoint(client, parent_endpoint=self) ) self.alertsuspensions = self._register_child_endpoint( ComputersIdAlertsuspensionsEndpoint(client, parent_endpoint=self) ) - self.drives = self._register_child_endpoint( - ComputersIdDrivesEndpoint(client, parent_endpoint=self) - ) + self.drives = self._register_child_endpoint(ComputersIdDrivesEndpoint(client, parent_endpoint=self)) self.effectivepatchingpolicy = self._register_child_endpoint( ComputersIdEffectivepatchingpolicyEndpoint(client, parent_endpoint=self) ) self.scheduledtasks = self._register_child_endpoint( ComputersIdScheduledtasksEndpoint(client, parent_endpoint=self) ) - self.patchjobs = self._register_child_endpoint( - ComputersIdPatchjobsEndpoint(client, parent_endpoint=self) - ) - self.drivers = self._register_child_endpoint( - ComputersIdDriversEndpoint(client, parent_endpoint=self) - ) - self.monitors = self._register_child_endpoint( - ComputersIdMonitorsEndpoint(client, parent_endpoint=self) - ) + self.patchjobs = self._register_child_endpoint(ComputersIdPatchjobsEndpoint(client, parent_endpoint=self)) + self.drivers = self._register_child_endpoint(ComputersIdDriversEndpoint(client, parent_endpoint=self)) + self.monitors = self._register_child_endpoint(ComputersIdMonitorsEndpoint(client, parent_endpoint=self)) self.scheduledscripts = self._register_child_endpoint( ComputersIdScheduledscriptsEndpoint(client, parent_endpoint=self) ) - self.bios = self._register_child_endpoint( - ComputersIdBiosEndpoint(client, parent_endpoint=self) - ) + self.bios = self._register_child_endpoint(ComputersIdBiosEndpoint(client, parent_endpoint=self)) self.runningscripts = self._register_child_endpoint( ComputersIdRunningscriptsEndpoint(client, parent_endpoint=self) ) self.commandexecute = self._register_child_endpoint( ComputersIdCommandexecuteEndpoint(client, parent_endpoint=self) ) - self.ups = self._register_child_endpoint( - ComputersIdUpsEndpoint(client, parent_endpoint=self) - ) - self.sensors = self._register_child_endpoint( - ComputersIdSensorsEndpoint(client, parent_endpoint=self) - ) - self.services = self._register_child_endpoint( - ComputersIdServicesEndpoint(client, parent_endpoint=self) - ) - self.systemslots = self._register_child_endpoint( - ComputersIdSystemslotsEndpoint(client, parent_endpoint=self) - ) + self.ups = self._register_child_endpoint(ComputersIdUpsEndpoint(client, parent_endpoint=self)) + self.sensors = self._register_child_endpoint(ComputersIdSensorsEndpoint(client, parent_endpoint=self)) + self.services = self._register_child_endpoint(ComputersIdServicesEndpoint(client, parent_endpoint=self)) + self.systemslots = self._register_child_endpoint(ComputersIdSystemslotsEndpoint(client, parent_endpoint=self)) self.patchingstats = self._register_child_endpoint( ComputersIdPatchingstatsEndpoint(client, parent_endpoint=self) ) - self.software = self._register_child_endpoint( - ComputersIdSoftwareEndpoint(client, parent_endpoint=self) - ) - self.videocards = self._register_child_endpoint( - ComputersIdVideocardsEndpoint(client, parent_endpoint=self) - ) + self.software = self._register_child_endpoint(ComputersIdSoftwareEndpoint(client, parent_endpoint=self)) + self.videocards = self._register_child_endpoint(ComputersIdVideocardsEndpoint(client, parent_endpoint=self)) self.microsoftupdates = self._register_child_endpoint( ComputersIdMicrosoftupdatesEndpoint(client, parent_endpoint=self) ) self.scripthistory = self._register_child_endpoint( ComputersIdScripthistoryEndpoint(client, parent_endpoint=self) ) - self.devices = self._register_child_endpoint( - ComputersIdDevicesEndpoint(client, parent_endpoint=self) - ) + self.devices = self._register_child_endpoint(ComputersIdDevicesEndpoint(client, parent_endpoint=self)) self.computerpatchingpolicies = self._register_child_endpoint( ComputersIdComputerpatchingpoliciesEndpoint(client, parent_endpoint=self) ) - self.processors = self._register_child_endpoint( - ComputersIdProcessorsEndpoint(client, parent_endpoint=self) - ) + self.processors = self._register_child_endpoint(ComputersIdProcessorsEndpoint(client, parent_endpoint=self)) self.thirdpartypatches = self._register_child_endpoint( ComputersIdThirdpartypatchesEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdMicrosoftupdatesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdMicrosoftupdatesEndpoint.py index 867a13f5e..4a9028f7e 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdMicrosoftupdatesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdMicrosoftupdatesEndpoint.py @@ -3,6 +3,4 @@ class ComputersIdMicrosoftupdatesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Microsoftupdates", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Microsoftupdates", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdMonitoralertsuspensionsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdMonitoralertsuspensionsEndpoint.py index 007ed1eb7..94cfad938 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdMonitoralertsuspensionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdMonitoralertsuspensionsEndpoint.py @@ -14,9 +14,7 @@ class ComputersIdMonitoralertsuspensionsEndpoint( IPostable[LabTechMonitorAlertSuspension, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Monitoralertsuspensions", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Monitoralertsuspensions", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechMonitorAlertSuspension) def post( diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdMonitorsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdMonitorsEndpoint.py index a33fa83ef..0599ccc1b 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdMonitorsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdMonitorsEndpoint.py @@ -3,6 +3,4 @@ class ComputersIdMonitorsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Monitors", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Monitors", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdOperatingsystemEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdOperatingsystemEndpoint.py index b7c8dc0e6..495bde17b 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdOperatingsystemEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdOperatingsystemEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdOperatingsystemEndpoint( IPaginateable[LabTechComputerOperatingSystem, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Operatingsystem", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Operatingsystem", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechComputerOperatingSystem) IPaginateable.__init__(self, LabTechComputerOperatingSystem) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdPatchingstatsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdPatchingstatsEndpoint.py index 62be93309..ca32a399f 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdPatchingstatsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdPatchingstatsEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdPatchingstatsEndpoint( IPaginateable[AutomateComputerPatchingStats, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Patchingstats", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Patchingstats", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateComputerPatchingStats) IPaginateable.__init__(self, AutomateComputerPatchingStats) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdPatchjobsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdPatchjobsEndpoint.py index b5c01b804..9831d180f 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdPatchjobsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdPatchjobsEndpoint.py @@ -3,6 +3,4 @@ class ComputersIdPatchjobsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Patchjobs", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Patchjobs", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdPrintersEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdPrintersEndpoint.py index 4f65db9bf..a142e6ece 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdPrintersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdPrintersEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdPrintersEndpoint( IPaginateable[LabTechComputerPrinter, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Printers", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Printers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerPrinter]) IPaginateable.__init__(self, LabTechComputerPrinter) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdProcessorsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdProcessorsEndpoint.py index f1d9ad5e6..b6de2fa19 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdProcessorsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdProcessorsEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdProcessorsEndpoint( IPaginateable[LabTechComputerProcessor, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Processors", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Processors", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerProcessor]) IPaginateable.__init__(self, LabTechComputerProcessor) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdRunningscriptsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdRunningscriptsEndpoint.py index 85dd3a4a9..1ef4a022d 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdRunningscriptsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdRunningscriptsEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdRunningscriptsEndpoint( IPaginateable[LabTechComputerRunningScript, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Runningscripts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Runningscripts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerRunningScript]) IPaginateable.__init__(self, LabTechComputerRunningScript) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsEndpoint.py index 34a50b65d..3920f28d0 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsEndpoint.py @@ -22,9 +22,7 @@ class ComputersIdScheduledscriptsEndpoint( IPaginateable[LabTechScheduledScript, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scheduledscripts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scheduledscripts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechScheduledScript]) IPostable.__init__(self, LabTechScheduledScript) IPaginateable.__init__(self, LabTechScheduledScript) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsIdEndpoint.py index 311f14c02..062b249e1 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdScheduledscriptsIdEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdScheduledscriptsIdEndpoint( IPaginateable[LabTechScheduledScript, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechScheduledScript) IPaginateable.__init__(self, LabTechScheduledScript) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdScheduledtasksEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdScheduledtasksEndpoint.py index 3848a3789..3a2ee9621 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdScheduledtasksEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdScheduledtasksEndpoint.py @@ -7,9 +7,7 @@ class ComputersIdScheduledtasksEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scheduledtasks", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scheduledtasks", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdScripthistoryEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdScripthistoryEndpoint.py index 6fbd916e8..db472689c 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdScripthistoryEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdScripthistoryEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdScripthistoryEndpoint( IPaginateable[LabTechComputerScriptHistory, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scripthistory", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scripthistory", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerScriptHistory]) IPaginateable.__init__(self, LabTechComputerScriptHistory) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdSensorsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdSensorsEndpoint.py index b48ff06ee..c8e3e3b8d 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdSensorsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdSensorsEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdSensorsEndpoint( IPaginateable[LabTechComputerSensor, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Sensors", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Sensors", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerSensor]) IPaginateable.__init__(self, LabTechComputerSensor) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdServicesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdServicesEndpoint.py index 5c19f3eaf..9513c78c3 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdServicesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdServicesEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdServicesEndpoint( IPaginateable[LabTechComputerService, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Services", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Services", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerService]) IPaginateable.__init__(self, LabTechComputerService) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareEndpoint.py index 072b69056..4b704374c 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareEndpoint.py @@ -20,9 +20,7 @@ class ComputersIdSoftwareEndpoint( IPaginateable[LabTechComputerSoftware, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Software", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Software", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerSoftware]) IPaginateable.__init__(self, LabTechComputerSoftware) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdEndpoint.py index c3b853415..2c5a3305f 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdEndpoint.py @@ -6,9 +6,7 @@ class ComputersIdSoftwareIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.uninstall = self._register_child_endpoint( ComputersIdSoftwareIdUninstallEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdUninstallEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdUninstallEndpoint.py index bce746d61..ec1b38510 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdUninstallEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdSoftwareIdUninstallEndpoint.py @@ -7,9 +7,7 @@ class ComputersIdSoftwareIdUninstallEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Uninstall", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Uninstall", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdSystemslotsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdSystemslotsEndpoint.py index 000145c25..8102ac6ea 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdSystemslotsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdSystemslotsEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdSystemslotsEndpoint( IPaginateable[LabTechComputerSystemSlot, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Systemslots", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Systemslots", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerSystemSlot]) IPaginateable.__init__(self, LabTechComputerSystemSlot) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdThirdpartypatchesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdThirdpartypatchesEndpoint.py index 8a191394c..5727376b4 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdThirdpartypatchesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdThirdpartypatchesEndpoint.py @@ -3,6 +3,4 @@ class ComputersIdThirdpartypatchesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Thirdpartypatches", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Thirdpartypatches", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdUpsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdUpsEndpoint.py index 5c9d5455f..1dfc04e56 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdUpsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdUpsEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdUpsEndpoint( IPaginateable[LabTechComputerUps, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Ups", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Ups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerUps]) IPaginateable.__init__(self, LabTechComputerUps) diff --git a/src/pyconnectwise/endpoints/automate/ComputersIdVideocardsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersIdVideocardsEndpoint.py index 43edd08df..5a8ba6b96 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersIdVideocardsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersIdVideocardsEndpoint.py @@ -17,9 +17,7 @@ class ComputersIdVideocardsEndpoint( IPaginateable[LabTechComputerVideoCard, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Videocards", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Videocards", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerVideoCard]) IPaginateable.__init__(self, LabTechComputerVideoCard) diff --git a/src/pyconnectwise/endpoints/automate/ComputersMaintenancemodesEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersMaintenancemodesEndpoint.py index a76311387..c73b58489 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersMaintenancemodesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersMaintenancemodesEndpoint.py @@ -17,9 +17,7 @@ class ComputersMaintenancemodesEndpoint( IPaginateable[LabTechMaintenanceMode, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Maintenancemodes", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Maintenancemodes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechMaintenanceMode]) IPaginateable.__init__(self, LabTechMaintenanceMode) diff --git a/src/pyconnectwise/endpoints/automate/ComputersMemoryslotsEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersMemoryslotsEndpoint.py index 94ef6cd70..459abc868 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersMemoryslotsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersMemoryslotsEndpoint.py @@ -17,9 +17,7 @@ class ComputersMemoryslotsEndpoint( IPaginateable[LabTechComputerMemorySlot, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Memoryslots", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Memoryslots", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerMemorySlot]) IPaginateable.__init__(self, LabTechComputerMemorySlot) diff --git a/src/pyconnectwise/endpoints/automate/ComputersSoftwareEndpoint.py b/src/pyconnectwise/endpoints/automate/ComputersSoftwareEndpoint.py index 2c1170bb9..fcd459843 100644 --- a/src/pyconnectwise/endpoints/automate/ComputersSoftwareEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ComputersSoftwareEndpoint.py @@ -17,9 +17,7 @@ class ComputersSoftwareEndpoint( IPaginateable[LabTechComputerSoftware, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Software", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Software", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechComputerSoftware]) IPaginateable.__init__(self, LabTechComputerSoftware) diff --git a/src/pyconnectwise/endpoints/automate/ContactsEndpoint.py b/src/pyconnectwise/endpoints/automate/ContactsEndpoint.py index 805e98a01..d16f3e5ba 100644 --- a/src/pyconnectwise/endpoints/automate/ContactsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ContactsEndpoint.py @@ -20,9 +20,7 @@ class ContactsEndpoint( IPaginateable[AutomateContact, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Contacts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Contacts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateContact]) IPostable.__init__(self, AutomateContact) IPaginateable.__init__(self, AutomateContact) diff --git a/src/pyconnectwise/endpoints/automate/ContactsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ContactsIdEndpoint.py index 8221e872e..ccf62b30f 100644 --- a/src/pyconnectwise/endpoints/automate/ContactsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ContactsIdEndpoint.py @@ -19,9 +19,7 @@ class ContactsIdEndpoint( IPaginateable[AutomateContact, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateContact) IPuttable.__init__(self, AutomateContact) IPaginateable.__init__(self, AutomateContact) diff --git a/src/pyconnectwise/endpoints/automate/DatabaseservertimeEndpoint.py b/src/pyconnectwise/endpoints/automate/DatabaseservertimeEndpoint.py index 252d6b8c4..0d572779d 100644 --- a/src/pyconnectwise/endpoints/automate/DatabaseservertimeEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DatabaseservertimeEndpoint.py @@ -3,6 +3,4 @@ class DatabaseservertimeEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Databaseservertime", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Databaseservertime", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/DataviewfoldersEndpoint.py b/src/pyconnectwise/endpoints/automate/DataviewfoldersEndpoint.py index b601ce65a..5d10be550 100644 --- a/src/pyconnectwise/endpoints/automate/DataviewfoldersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DataviewfoldersEndpoint.py @@ -20,9 +20,7 @@ class DataviewfoldersEndpoint( IPaginateable[LabTechDataViewFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Dataviewfolders", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Dataviewfolders", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDataViewFolder]) IPaginateable.__init__(self, LabTechDataViewFolder) diff --git a/src/pyconnectwise/endpoints/automate/DataviewfoldersIdEndpoint.py b/src/pyconnectwise/endpoints/automate/DataviewfoldersIdEndpoint.py index 93ae93cc4..a7fb95b7c 100644 --- a/src/pyconnectwise/endpoints/automate/DataviewfoldersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DataviewfoldersIdEndpoint.py @@ -17,9 +17,7 @@ class DataviewfoldersIdEndpoint( IPaginateable[LabTechDataViewFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechDataViewFolder) IPaginateable.__init__(self, LabTechDataViewFolder) diff --git a/src/pyconnectwise/endpoints/automate/DataviewsEndpoint.py b/src/pyconnectwise/endpoints/automate/DataviewsEndpoint.py index d9d7cd22c..b64d2ac33 100644 --- a/src/pyconnectwise/endpoints/automate/DataviewsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DataviewsEndpoint.py @@ -18,9 +18,7 @@ class DataviewsEndpoint( IPaginateable[LabTechDataView, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Dataviews", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Dataviews", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDataView]) IPaginateable.__init__(self, LabTechDataView) diff --git a/src/pyconnectwise/endpoints/automate/DataviewsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/DataviewsIdEndpoint.py index 8e9487c62..daccbafc9 100644 --- a/src/pyconnectwise/endpoints/automate/DataviewsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DataviewsIdEndpoint.py @@ -17,9 +17,7 @@ class DataviewsIdEndpoint( IPaginateable[LabTechDataView, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechDataView) IPaginateable.__init__(self, LabTechDataView) diff --git a/src/pyconnectwise/endpoints/automate/DrivesEndpoint.py b/src/pyconnectwise/endpoints/automate/DrivesEndpoint.py index 3c3c2dec1..56f835906 100644 --- a/src/pyconnectwise/endpoints/automate/DrivesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DrivesEndpoint.py @@ -4,9 +4,7 @@ class DrivesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Drives", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Drives", parent_endpoint=parent_endpoint) def id(self, id: int) -> DrivesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsDailyEndpoint.py b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsDailyEndpoint.py index 31fbc4c91..3a21fc315 100644 --- a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsDailyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsDailyEndpoint.py @@ -17,9 +17,7 @@ class DrivesIdDrivestatsDailyEndpoint( IPaginateable[LabTechDriveStats, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Daily", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Daily", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDriveStats]) IPaginateable.__init__(self, LabTechDriveStats) diff --git a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsEndpoint.py b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsEndpoint.py index 64ef336be..389d74007 100644 --- a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsEndpoint.py @@ -15,19 +15,9 @@ class DrivesIdDrivestatsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Drivestats", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Drivestats", parent_endpoint=parent_endpoint) - self.yearly = self._register_child_endpoint( - DrivesIdDrivestatsYearlyEndpoint(client, parent_endpoint=self) - ) - self.weekly = self._register_child_endpoint( - DrivesIdDrivestatsWeeklyEndpoint(client, parent_endpoint=self) - ) - self.monthly = self._register_child_endpoint( - DrivesIdDrivestatsMonthlyEndpoint(client, parent_endpoint=self) - ) - self.daily = self._register_child_endpoint( - DrivesIdDrivestatsDailyEndpoint(client, parent_endpoint=self) - ) + self.yearly = self._register_child_endpoint(DrivesIdDrivestatsYearlyEndpoint(client, parent_endpoint=self)) + self.weekly = self._register_child_endpoint(DrivesIdDrivestatsWeeklyEndpoint(client, parent_endpoint=self)) + self.monthly = self._register_child_endpoint(DrivesIdDrivestatsMonthlyEndpoint(client, parent_endpoint=self)) + self.daily = self._register_child_endpoint(DrivesIdDrivestatsDailyEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsMonthlyEndpoint.py b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsMonthlyEndpoint.py index c9f464fa5..c14b481a5 100644 --- a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsMonthlyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsMonthlyEndpoint.py @@ -17,9 +17,7 @@ class DrivesIdDrivestatsMonthlyEndpoint( IPaginateable[LabTechDriveStats, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Monthly", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Monthly", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDriveStats]) IPaginateable.__init__(self, LabTechDriveStats) diff --git a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsWeeklyEndpoint.py b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsWeeklyEndpoint.py index 2f1bfddb9..37c00604a 100644 --- a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsWeeklyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsWeeklyEndpoint.py @@ -17,9 +17,7 @@ class DrivesIdDrivestatsWeeklyEndpoint( IPaginateable[LabTechDriveStats, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Weekly", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Weekly", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDriveStats]) IPaginateable.__init__(self, LabTechDriveStats) diff --git a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsYearlyEndpoint.py b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsYearlyEndpoint.py index 235c68d5b..6de97a85b 100644 --- a/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsYearlyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DrivesIdDrivestatsYearlyEndpoint.py @@ -17,9 +17,7 @@ class DrivesIdDrivestatsYearlyEndpoint( IPaginateable[LabTechDriveStats, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Yearly", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Yearly", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDriveStats]) IPaginateable.__init__(self, LabTechDriveStats) diff --git a/src/pyconnectwise/endpoints/automate/DrivesIdEndpoint.py b/src/pyconnectwise/endpoints/automate/DrivesIdEndpoint.py index 80bf40c92..091036780 100644 --- a/src/pyconnectwise/endpoints/automate/DrivesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/DrivesIdEndpoint.py @@ -6,10 +6,6 @@ class DrivesIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.drivestats = self._register_child_endpoint( - DrivesIdDrivestatsEndpoint(client, parent_endpoint=self) - ) + self.drivestats = self._register_child_endpoint(DrivesIdDrivestatsEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/automate/EventlogsEndpoint.py b/src/pyconnectwise/endpoints/automate/EventlogsEndpoint.py index 4e32d192e..d240911f5 100644 --- a/src/pyconnectwise/endpoints/automate/EventlogsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/EventlogsEndpoint.py @@ -17,9 +17,7 @@ class EventlogsEndpoint( IPaginateable[LabTechEventLog, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Eventlogs", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Eventlogs", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechEventLog]) IPaginateable.__init__(self, LabTechEventLog) diff --git a/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsEndpoint.py b/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsEndpoint.py index 74c0e56e6..39b28237e 100644 --- a/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsEndpoint.py @@ -6,9 +6,7 @@ class ExternalsystemcredentialsClientsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Clients", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Clients", parent_endpoint=parent_endpoint) def id(self, id: int) -> ExternalsystemcredentialsClientsIdEndpoint: # noqa: A002 """ @@ -19,8 +17,6 @@ def id(self, id: int) -> ExternalsystemcredentialsClientsIdEndpoint: # noqa: A0 Returns: ExternalsystemcredentialsClientsIdEndpoint: The initialized ExternalsystemcredentialsClientsIdEndpoint object. """ - child = ExternalsystemcredentialsClientsIdEndpoint( - self.client, parent_endpoint=self - ) + child = ExternalsystemcredentialsClientsIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsIdEndpoint.py index ec11c9da8..cfe5c347c 100644 --- a/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsClientsIdEndpoint.py @@ -17,9 +17,7 @@ class ExternalsystemcredentialsClientsIdEndpoint( IPaginateable[LabTechExternalSystemCredentials, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechExternalSystemCredentials]) IPaginateable.__init__(self, LabTechExternalSystemCredentials) diff --git a/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsEndpoint.py b/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsEndpoint.py index 6ca6f6c43..735b53401 100644 --- a/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ExternalsystemcredentialsEndpoint.py @@ -6,9 +6,7 @@ class ExternalsystemcredentialsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Externalsystemcredentials", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Externalsystemcredentials", parent_endpoint=parent_endpoint) self.clients = self._register_child_endpoint( ExternalsystemcredentialsClientsEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/FeatureflagsEndpoint.py b/src/pyconnectwise/endpoints/automate/FeatureflagsEndpoint.py index 2886bc834..67c29da9f 100644 --- a/src/pyconnectwise/endpoints/automate/FeatureflagsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/FeatureflagsEndpoint.py @@ -9,13 +9,9 @@ ) -class FeatureflagsEndpoint( - ConnectWiseEndpoint, IPostable[LabTechFeatureFlag, ConnectWiseAutomateRequestParams] -): +class FeatureflagsEndpoint(ConnectWiseEndpoint, IPostable[LabTechFeatureFlag, ConnectWiseAutomateRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Featureflags", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Featureflags", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechFeatureFlag) def post( diff --git a/src/pyconnectwise/endpoints/automate/GrouppatchingpoliciesEndpoint.py b/src/pyconnectwise/endpoints/automate/GrouppatchingpoliciesEndpoint.py index e555d5760..b63a2da1f 100644 --- a/src/pyconnectwise/endpoints/automate/GrouppatchingpoliciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/GrouppatchingpoliciesEndpoint.py @@ -17,9 +17,7 @@ class GrouppatchingpoliciesEndpoint( IPaginateable[AutomateGroupPatchingPolicy, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Grouppatchingpolicies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Grouppatchingpolicies", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateGroupPatchingPolicy]) IPaginateable.__init__(self, AutomateGroupPatchingPolicy) diff --git a/src/pyconnectwise/endpoints/automate/GroupsEndpoint.py b/src/pyconnectwise/endpoints/automate/GroupsEndpoint.py index 3216a957a..97fd9a3aa 100644 --- a/src/pyconnectwise/endpoints/automate/GroupsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/GroupsEndpoint.py @@ -20,9 +20,7 @@ class GroupsEndpoint( IPaginateable[LabTechGroup, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Groups", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Groups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechGroup]) IPostable.__init__(self, LabTechGroup) IPaginateable.__init__(self, LabTechGroup) @@ -84,9 +82,7 @@ def get( Returns: list[LabTechGroup]: The parsed response data. """ - return self._parse_many( - LabTechGroup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LabTechGroup, super()._make_request("GET", data=data, params=params).json()) def post( self, @@ -102,6 +98,4 @@ def post( Returns: LabTechGroup: The parsed response data. """ - return self._parse_one( - LabTechGroup, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(LabTechGroup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/automate/GroupsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/GroupsIdEndpoint.py index f257487fd..066ce2caa 100644 --- a/src/pyconnectwise/endpoints/automate/GroupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/GroupsIdEndpoint.py @@ -17,9 +17,7 @@ class GroupsIdEndpoint( IPaginateable[LabTechGroup, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechGroup) IPaginateable.__init__(self, LabTechGroup) @@ -67,6 +65,4 @@ def get( Returns: LabTechGroup: The parsed response data. """ - return self._parse_one( - LabTechGroup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(LabTechGroup, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/automate/InternalmonitorresultsEndpoint.py b/src/pyconnectwise/endpoints/automate/InternalmonitorresultsEndpoint.py index 147bac9c1..edcf5a523 100644 --- a/src/pyconnectwise/endpoints/automate/InternalmonitorresultsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/InternalmonitorresultsEndpoint.py @@ -3,6 +3,4 @@ class InternalmonitorresultsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Internalmonitorresults", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Internalmonitorresults", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/LicensedproductsEndpoint.py b/src/pyconnectwise/endpoints/automate/LicensedproductsEndpoint.py index 71465fa45..886bc1a2b 100644 --- a/src/pyconnectwise/endpoints/automate/LicensedproductsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LicensedproductsEndpoint.py @@ -17,9 +17,7 @@ class LicensedproductsEndpoint( IPaginateable[LabTechLicensedProduct, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Licensedproducts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Licensedproducts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechLicensedProduct]) IPaginateable.__init__(self, LabTechLicensedProduct) diff --git a/src/pyconnectwise/endpoints/automate/LinksEndpoint.py b/src/pyconnectwise/endpoints/automate/LinksEndpoint.py index 41adea636..812768861 100644 --- a/src/pyconnectwise/endpoints/automate/LinksEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LinksEndpoint.py @@ -17,9 +17,7 @@ class LinksEndpoint( IPaginateable[LabTechLink, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Links", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Links", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechLink]) IPaginateable.__init__(self, LabTechLink) @@ -67,6 +65,4 @@ def get( Returns: list[LabTechLink]: The parsed response data. """ - return self._parse_many( - LabTechLink, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LabTechLink, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/automate/LocationsEndpoint.py b/src/pyconnectwise/endpoints/automate/LocationsEndpoint.py index e3d7e7f34..0aa7ca0a1 100644 --- a/src/pyconnectwise/endpoints/automate/LocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LocationsEndpoint.py @@ -20,9 +20,7 @@ class LocationsEndpoint( IPaginateable[AutomateLocation, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Locations", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Locations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateLocation]) IPostable.__init__(self, LabTechLocation) IPaginateable.__init__(self, AutomateLocation) diff --git a/src/pyconnectwise/endpoints/automate/LocationsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/LocationsIdEndpoint.py index 072614772..8adf55c71 100644 --- a/src/pyconnectwise/endpoints/automate/LocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LocationsIdEndpoint.py @@ -9,13 +9,9 @@ class LocationsIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.probeconfiguration = self._register_child_endpoint( LocationsIdProbeconfigurationEndpoint(client, parent_endpoint=self) ) - self.upgradeprobe = self._register_child_endpoint( - LocationsIdUpgradeprobeEndpoint(client, parent_endpoint=self) - ) + self.upgradeprobe = self._register_child_endpoint(LocationsIdUpgradeprobeEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/automate/LocationsIdProbeconfigurationEndpoint.py b/src/pyconnectwise/endpoints/automate/LocationsIdProbeconfigurationEndpoint.py index 0d6b0fefc..a91afd06d 100644 --- a/src/pyconnectwise/endpoints/automate/LocationsIdProbeconfigurationEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LocationsIdProbeconfigurationEndpoint.py @@ -22,9 +22,7 @@ class LocationsIdProbeconfigurationEndpoint( IPaginateable[LabTechProbeConfiguration, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Probeconfiguration", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Probeconfiguration", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechProbeConfiguration) IPostable.__init__(self, LabTechProbeConfiguration) IPatchable.__init__(self, LabTechProbeConfiguration) diff --git a/src/pyconnectwise/endpoints/automate/LocationsIdUpgradeprobeEndpoint.py b/src/pyconnectwise/endpoints/automate/LocationsIdUpgradeprobeEndpoint.py index 9ab73786c..fa255c613 100644 --- a/src/pyconnectwise/endpoints/automate/LocationsIdUpgradeprobeEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LocationsIdUpgradeprobeEndpoint.py @@ -7,9 +7,7 @@ class LocationsIdUpgradeprobeEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Upgradeprobe", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Upgradeprobe", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/LookupsEndpoint.py b/src/pyconnectwise/endpoints/automate/LookupsEndpoint.py index a4f47f7eb..2d5092148 100644 --- a/src/pyconnectwise/endpoints/automate/LookupsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LookupsEndpoint.py @@ -18,9 +18,7 @@ class LookupsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Lookups", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Lookups", parent_endpoint=parent_endpoint) self.probeeventlevels = self._register_child_endpoint( LookupsProbeeventlevelsEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/LookupsProbeeventlevelsEndpoint.py b/src/pyconnectwise/endpoints/automate/LookupsProbeeventlevelsEndpoint.py index d7a1608c3..c2b632138 100644 --- a/src/pyconnectwise/endpoints/automate/LookupsProbeeventlevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LookupsProbeeventlevelsEndpoint.py @@ -17,9 +17,7 @@ class LookupsProbeeventlevelsEndpoint( IPaginateable[LabTechProbeEventLevel, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Probeeventlevels", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Probeeventlevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechProbeEventLevel]) IPaginateable.__init__(self, LabTechProbeEventLevel) diff --git a/src/pyconnectwise/endpoints/automate/LookupsScanfrequenciesEndpoint.py b/src/pyconnectwise/endpoints/automate/LookupsScanfrequenciesEndpoint.py index c3905b0c6..2fffc07d8 100644 --- a/src/pyconnectwise/endpoints/automate/LookupsScanfrequenciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LookupsScanfrequenciesEndpoint.py @@ -17,9 +17,7 @@ class LookupsScanfrequenciesEndpoint( IPaginateable[LabTechScanFrequency, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scanfrequencies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scanfrequencies", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechScanFrequency]) IPaginateable.__init__(self, LabTechScanFrequency) diff --git a/src/pyconnectwise/endpoints/automate/LookupsSnmpencryptionmethodsEndpoint.py b/src/pyconnectwise/endpoints/automate/LookupsSnmpencryptionmethodsEndpoint.py index 82f98de5b..b3fded734 100644 --- a/src/pyconnectwise/endpoints/automate/LookupsSnmpencryptionmethodsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LookupsSnmpencryptionmethodsEndpoint.py @@ -17,9 +17,7 @@ class LookupsSnmpencryptionmethodsEndpoint( IPaginateable[LabTechEncryptionMethod, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Snmpencryptionmethods", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Snmpencryptionmethods", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechEncryptionMethod]) IPaginateable.__init__(self, LabTechEncryptionMethod) diff --git a/src/pyconnectwise/endpoints/automate/LookupsSnmphashmethodsEndpoint.py b/src/pyconnectwise/endpoints/automate/LookupsSnmphashmethodsEndpoint.py index 3c443c94d..e60a45b08 100644 --- a/src/pyconnectwise/endpoints/automate/LookupsSnmphashmethodsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LookupsSnmphashmethodsEndpoint.py @@ -17,9 +17,7 @@ class LookupsSnmphashmethodsEndpoint( IPaginateable[LabTechHashMethod, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Snmphashmethods", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Snmphashmethods", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechHashMethod]) IPaginateable.__init__(self, LabTechHashMethod) diff --git a/src/pyconnectwise/endpoints/automate/LookupsStatusscannetworkportoptionsEndpoint.py b/src/pyconnectwise/endpoints/automate/LookupsStatusscannetworkportoptionsEndpoint.py index 556765fad..3dc8781f9 100644 --- a/src/pyconnectwise/endpoints/automate/LookupsStatusscannetworkportoptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/LookupsStatusscannetworkportoptionsEndpoint.py @@ -13,9 +13,7 @@ class LookupsStatusscannetworkportoptionsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[LabTechStatusScanNetworkPortOption], ConnectWiseAutomateRequestParams - ], + IGettable[list[LabTechStatusScanNetworkPortOption], ConnectWiseAutomateRequestParams], IPaginateable[LabTechStatusScanNetworkPortOption, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 diff --git a/src/pyconnectwise/endpoints/automate/MaintenancewindowdefinitionsEndpoint.py b/src/pyconnectwise/endpoints/automate/MaintenancewindowdefinitionsEndpoint.py index 7b10e57e2..b29df7254 100644 --- a/src/pyconnectwise/endpoints/automate/MaintenancewindowdefinitionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MaintenancewindowdefinitionsEndpoint.py @@ -13,12 +13,8 @@ class MaintenancewindowdefinitionsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[AutomateMaintenanceWindowDefinition], ConnectWiseAutomateRequestParams - ], - IPaginateable[ - AutomateMaintenanceWindowDefinition, ConnectWiseAutomateRequestParams - ], + IGettable[list[AutomateMaintenanceWindowDefinition], ConnectWiseAutomateRequestParams], + IPaginateable[AutomateMaintenanceWindowDefinition, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ConnectWiseEndpoint.__init__( diff --git a/src/pyconnectwise/endpoints/automate/MicrosoftupdatepoliciesEndpoint.py b/src/pyconnectwise/endpoints/automate/MicrosoftupdatepoliciesEndpoint.py index 1293629cd..a3cf2c348 100644 --- a/src/pyconnectwise/endpoints/automate/MicrosoftupdatepoliciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MicrosoftupdatepoliciesEndpoint.py @@ -3,6 +3,4 @@ class MicrosoftupdatepoliciesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Microsoftupdatepolicies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Microsoftupdatepolicies", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/MonitorhistoryEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorhistoryEndpoint.py index 78e4c559a..2a1a337e4 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorhistoryEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorhistoryEndpoint.py @@ -3,6 +3,4 @@ class MonitorhistoryEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Monitorhistory", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Monitorhistory", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/MonitorsEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsEndpoint.py index be599fe9c..3ed0ae5bd 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsEndpoint.py @@ -4,9 +4,7 @@ class MonitorsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Monitors", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Monitors", parent_endpoint=parent_endpoint) def id(self, id: int) -> MonitorsIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataDailyaveragesEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataDailyaveragesEndpoint.py index d3c22f523..169372c3f 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataDailyaveragesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataDailyaveragesEndpoint.py @@ -3,6 +3,4 @@ class MonitorsIdCollecteddataDailyaveragesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Dailyaverages", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Dailyaverages", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataEndpoint.py index b8c880b16..8c8048256 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataEndpoint.py @@ -15,9 +15,7 @@ class MonitorsIdCollecteddataEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Collecteddata", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Collecteddata", parent_endpoint=parent_endpoint) self.monthlyaverages = self._register_child_endpoint( MonitorsIdCollecteddataMonthlyaveragesEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataMonthlyaveragesEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataMonthlyaveragesEndpoint.py index 1380f3f5d..bb028a975 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataMonthlyaveragesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataMonthlyaveragesEndpoint.py @@ -3,6 +3,4 @@ class MonitorsIdCollecteddataMonthlyaveragesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Monthlyaverages", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Monthlyaverages", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataWeeklyaveragesEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataWeeklyaveragesEndpoint.py index 6759dc17c..0c8d2a028 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataWeeklyaveragesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataWeeklyaveragesEndpoint.py @@ -3,6 +3,4 @@ class MonitorsIdCollecteddataWeeklyaveragesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Weeklyaverages", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Weeklyaverages", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataYearlyaveragesEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataYearlyaveragesEndpoint.py index 4586a7cb7..a2ebde752 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataYearlyaveragesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsIdCollecteddataYearlyaveragesEndpoint.py @@ -3,6 +3,4 @@ class MonitorsIdCollecteddataYearlyaveragesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Yearlyaverages", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Yearlyaverages", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/MonitorsIdDatacollectionsettingsEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsIdDatacollectionsettingsEndpoint.py index dd53aceff..7bb926e42 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsIdDatacollectionsettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsIdDatacollectionsettingsEndpoint.py @@ -14,14 +14,10 @@ class MonitorsIdDatacollectionsettingsEndpoint( ConnectWiseEndpoint, IGettable[LabTechMonitorDataCollectionSettings, ConnectWiseAutomateRequestParams], - IPaginateable[ - LabTechMonitorDataCollectionSettings, ConnectWiseAutomateRequestParams - ], + IPaginateable[LabTechMonitorDataCollectionSettings, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Datacollectionsettings", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Datacollectionsettings", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechMonitorDataCollectionSettings) IPaginateable.__init__(self, LabTechMonitorDataCollectionSettings) diff --git a/src/pyconnectwise/endpoints/automate/MonitorsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorsIdEndpoint.py index 41729107d..4ba80e160 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorsIdEndpoint.py @@ -9,9 +9,7 @@ class MonitorsIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.collecteddata = self._register_child_endpoint( MonitorsIdCollecteddataEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/MonitorstatisticsEndpoint.py b/src/pyconnectwise/endpoints/automate/MonitorstatisticsEndpoint.py index 29e266328..62afc0892 100644 --- a/src/pyconnectwise/endpoints/automate/MonitorstatisticsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/MonitorstatisticsEndpoint.py @@ -3,6 +3,4 @@ class MonitorstatisticsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Monitorstatistics", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Monitorstatistics", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/NetworkdevicesEndpoint.py b/src/pyconnectwise/endpoints/automate/NetworkdevicesEndpoint.py index c4ddbe155..b9d0c079d 100644 --- a/src/pyconnectwise/endpoints/automate/NetworkdevicesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/NetworkdevicesEndpoint.py @@ -22,9 +22,7 @@ class NetworkdevicesEndpoint( IPaginateable[LabTechNetworkDevice, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Networkdevices", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Networkdevices", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechNetworkDevice]) IPostable.__init__(self, LabTechNetworkDevice) IPaginateable.__init__(self, LabTechNetworkDevice) diff --git a/src/pyconnectwise/endpoints/automate/NetworkdevicesIdEndpoint.py b/src/pyconnectwise/endpoints/automate/NetworkdevicesIdEndpoint.py index 1b213ce6a..f951a29be 100644 --- a/src/pyconnectwise/endpoints/automate/NetworkdevicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/NetworkdevicesIdEndpoint.py @@ -20,9 +20,7 @@ class NetworkdevicesIdEndpoint( IPaginateable[LabTechNetworkDevice, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechNetworkDevice) IPatchable.__init__(self, LabTechNetworkDevice) IPaginateable.__init__(self, LabTechNetworkDevice) diff --git a/src/pyconnectwise/endpoints/automate/PatchactionsDeployallapprovedEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchactionsDeployallapprovedEndpoint.py index 32fc6a0d7..5cf6e7c54 100644 --- a/src/pyconnectwise/endpoints/automate/PatchactionsDeployallapprovedEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchactionsDeployallapprovedEndpoint.py @@ -7,9 +7,7 @@ class PatchactionsDeployallapprovedEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Deployallapproved", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Deployallapproved", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/PatchactionsDeployallsecurityEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchactionsDeployallsecurityEndpoint.py index 9babbb9bc..079a626fc 100644 --- a/src/pyconnectwise/endpoints/automate/PatchactionsDeployallsecurityEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchactionsDeployallsecurityEndpoint.py @@ -7,9 +7,7 @@ class PatchactionsDeployallsecurityEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Deployallsecurity", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Deployallsecurity", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/PatchactionsEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchactionsEndpoint.py index 94271aeb3..d2e340755 100644 --- a/src/pyconnectwise/endpoints/automate/PatchactionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchactionsEndpoint.py @@ -21,9 +21,7 @@ class PatchactionsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Patchactions", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Patchactions", parent_endpoint=parent_endpoint) self.settoteststage = self._register_child_endpoint( PatchactionsSettoteststageEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/PatchactionsReattemptfailedEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchactionsReattemptfailedEndpoint.py index 97f2f5cad..037e86846 100644 --- a/src/pyconnectwise/endpoints/automate/PatchactionsReattemptfailedEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchactionsReattemptfailedEndpoint.py @@ -7,9 +7,7 @@ class PatchactionsReattemptfailedEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Reattemptfailed", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Reattemptfailed", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/PatchactionsSettopilotstageEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchactionsSettopilotstageEndpoint.py index 74d960f90..9c90fda12 100644 --- a/src/pyconnectwise/endpoints/automate/PatchactionsSettopilotstageEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchactionsSettopilotstageEndpoint.py @@ -7,9 +7,7 @@ class PatchactionsSettopilotstageEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Settopilotstage", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Settopilotstage", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/PatchactionsSettoproductionstageEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchactionsSettoproductionstageEndpoint.py index 59f903b83..f6809b6f0 100644 --- a/src/pyconnectwise/endpoints/automate/PatchactionsSettoproductionstageEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchactionsSettoproductionstageEndpoint.py @@ -7,9 +7,7 @@ class PatchactionsSettoproductionstageEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Settoproductionstage", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Settoproductionstage", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/PatchactionsSettoteststageEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchactionsSettoteststageEndpoint.py index bba32b707..60a0b992b 100644 --- a/src/pyconnectwise/endpoints/automate/PatchactionsSettoteststageEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchactionsSettoteststageEndpoint.py @@ -7,9 +7,7 @@ class PatchactionsSettoteststageEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Settoteststage", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Settoteststage", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/PatchhistoryEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchhistoryEndpoint.py index 4d718455b..f5eed8b3d 100644 --- a/src/pyconnectwise/endpoints/automate/PatchhistoryEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchhistoryEndpoint.py @@ -3,6 +3,4 @@ class PatchhistoryEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Patchhistory", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Patchhistory", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/PatchinformationEndpoint.py b/src/pyconnectwise/endpoints/automate/PatchinformationEndpoint.py index dbd5474bd..b55e2aa5a 100644 --- a/src/pyconnectwise/endpoints/automate/PatchinformationEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PatchinformationEndpoint.py @@ -17,9 +17,7 @@ class PatchinformationEndpoint( IPaginateable[LabTechPatchInformation, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Patchinformation", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Patchinformation", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechPatchInformation) IPaginateable.__init__(self, LabTechPatchInformation) diff --git a/src/pyconnectwise/endpoints/automate/PermissionsClientsEndpoint.py b/src/pyconnectwise/endpoints/automate/PermissionsClientsEndpoint.py index 79ca0e2ab..87a2d9e41 100644 --- a/src/pyconnectwise/endpoints/automate/PermissionsClientsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PermissionsClientsEndpoint.py @@ -6,9 +6,7 @@ class PermissionsClientsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Clients", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Clients", parent_endpoint=parent_endpoint) def id(self, id: int) -> PermissionsClientsIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/PermissionsClientsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/PermissionsClientsIdEndpoint.py index 6a33012df..adbac563a 100644 --- a/src/pyconnectwise/endpoints/automate/PermissionsClientsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PermissionsClientsIdEndpoint.py @@ -3,6 +3,4 @@ class PermissionsClientsIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/PermissionsEndpoint.py b/src/pyconnectwise/endpoints/automate/PermissionsEndpoint.py index 23e72dd1b..f42bfb945 100644 --- a/src/pyconnectwise/endpoints/automate/PermissionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PermissionsEndpoint.py @@ -9,13 +9,7 @@ class PermissionsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Permissions", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Permissions", parent_endpoint=parent_endpoint) - self.clients = self._register_child_endpoint( - PermissionsClientsEndpoint(client, parent_endpoint=self) - ) - self.users = self._register_child_endpoint( - PermissionsUsersEndpoint(client, parent_endpoint=self) - ) + self.clients = self._register_child_endpoint(PermissionsClientsEndpoint(client, parent_endpoint=self)) + self.users = self._register_child_endpoint(PermissionsUsersEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/automate/PermissionsUsersEndpoint.py b/src/pyconnectwise/endpoints/automate/PermissionsUsersEndpoint.py index 38a8e05fe..50a8bd8e8 100644 --- a/src/pyconnectwise/endpoints/automate/PermissionsUsersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PermissionsUsersEndpoint.py @@ -3,6 +3,4 @@ class PermissionsUsersEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Users", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Users", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/PluginsEndpoint.py b/src/pyconnectwise/endpoints/automate/PluginsEndpoint.py index 01e9ae7ac..8c623c0b9 100644 --- a/src/pyconnectwise/endpoints/automate/PluginsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/PluginsEndpoint.py @@ -3,6 +3,4 @@ class PluginsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Plugins", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Plugins", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeEndpoint.py b/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeEndpoint.py index 320489921..577ed52a6 100644 --- a/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeEndpoint.py @@ -6,9 +6,7 @@ class ProbeconfigurationEnableprobeEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Enableprobe", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Enableprobe", parent_endpoint=parent_endpoint) def id(self, id: int) -> ProbeconfigurationEnableprobeIdEndpoint: # noqa: A002 """ @@ -19,8 +17,6 @@ def id(self, id: int) -> ProbeconfigurationEnableprobeIdEndpoint: # noqa: A002 Returns: ProbeconfigurationEnableprobeIdEndpoint: The initialized ProbeconfigurationEnableprobeIdEndpoint object. """ - child = ProbeconfigurationEnableprobeIdEndpoint( - self.client, parent_endpoint=self - ) + child = ProbeconfigurationEnableprobeIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeIdEndpoint.py index 43b492770..089c64f36 100644 --- a/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ProbeconfigurationEnableprobeIdEndpoint.py @@ -14,9 +14,7 @@ class ProbeconfigurationEnableprobeIdEndpoint( IPostable[LabTechProbeConfiguration, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechProbeConfiguration) def post( diff --git a/src/pyconnectwise/endpoints/automate/ProbeconfigurationEndpoint.py b/src/pyconnectwise/endpoints/automate/ProbeconfigurationEndpoint.py index 65b4d4cf5..4bce96ef6 100644 --- a/src/pyconnectwise/endpoints/automate/ProbeconfigurationEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ProbeconfigurationEndpoint.py @@ -9,9 +9,7 @@ class ProbeconfigurationEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Probeconfiguration", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Probeconfiguration", parent_endpoint=parent_endpoint) self.enableprobe = self._register_child_endpoint( ProbeconfigurationEnableprobeEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdAgentpushcredentialsEndpoint.py b/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdAgentpushcredentialsEndpoint.py index 539d434e8..ea02647f3 100644 --- a/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdAgentpushcredentialsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdAgentpushcredentialsEndpoint.py @@ -14,20 +14,12 @@ class ProbeconfigurationIdAgentpushcredentialsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[LabTechProbeConfigurationCredentials], ConnectWiseAutomateRequestParams - ], - IPuttable[ - list[LabTechProbeConfigurationCredentials], ConnectWiseAutomateRequestParams - ], - IPaginateable[ - LabTechProbeConfigurationCredentials, ConnectWiseAutomateRequestParams - ], + IGettable[list[LabTechProbeConfigurationCredentials], ConnectWiseAutomateRequestParams], + IPuttable[list[LabTechProbeConfigurationCredentials], ConnectWiseAutomateRequestParams], + IPaginateable[LabTechProbeConfigurationCredentials, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Agentpushcredentials", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Agentpushcredentials", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechProbeConfigurationCredentials]) IPuttable.__init__(self, list[LabTechProbeConfigurationCredentials]) IPaginateable.__init__(self, LabTechProbeConfigurationCredentials) diff --git a/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdEndpoint.py index d4777b5ba..6e6fd6251 100644 --- a/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdEndpoint.py @@ -9,14 +9,10 @@ class ProbeconfigurationIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.agentpushcredentials = self._register_child_endpoint( - ProbeconfigurationIdAgentpushcredentialsEndpoint( - client, parent_endpoint=self - ) + ProbeconfigurationIdAgentpushcredentialsEndpoint(client, parent_endpoint=self) ) self.snmpconfiguration = self._register_child_endpoint( ProbeconfigurationIdSnmpconfigurationEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdSnmpconfigurationEndpoint.py b/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdSnmpconfigurationEndpoint.py index 4eff207d5..e00b7d607 100644 --- a/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdSnmpconfigurationEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ProbeconfigurationIdSnmpconfigurationEndpoint.py @@ -20,9 +20,7 @@ class ProbeconfigurationIdSnmpconfigurationEndpoint( IPaginateable[LabTechProbeSnmpConfiguration, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Snmpconfiguration", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Snmpconfiguration", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechProbeSnmpConfiguration) IPatchable.__init__(self, LabTechProbeSnmpConfiguration) IPaginateable.__init__(self, LabTechProbeSnmpConfiguration) diff --git a/src/pyconnectwise/endpoints/automate/ProbeeventsEndpoint.py b/src/pyconnectwise/endpoints/automate/ProbeeventsEndpoint.py index c2dd1d403..cbb077696 100644 --- a/src/pyconnectwise/endpoints/automate/ProbeeventsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ProbeeventsEndpoint.py @@ -17,9 +17,7 @@ class ProbeeventsEndpoint( IPaginateable[LabTechProbeEvent, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Probeevents", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Probeevents", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechProbeEvent]) IPaginateable.__init__(self, LabTechProbeEvent) diff --git a/src/pyconnectwise/endpoints/automate/RebootpoliciesEndpoint.py b/src/pyconnectwise/endpoints/automate/RebootpoliciesEndpoint.py index 3a9033de2..1d629b84f 100644 --- a/src/pyconnectwise/endpoints/automate/RebootpoliciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/RebootpoliciesEndpoint.py @@ -3,6 +3,4 @@ class RebootpoliciesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Rebootpolicies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Rebootpolicies", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/RemoteagentschedulesEndpoint.py b/src/pyconnectwise/endpoints/automate/RemoteagentschedulesEndpoint.py index 3d76f99d6..ec2c813cb 100644 --- a/src/pyconnectwise/endpoints/automate/RemoteagentschedulesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/RemoteagentschedulesEndpoint.py @@ -19,9 +19,7 @@ class RemoteagentschedulesEndpoint( IPaginateable[LabTechRemoteAgentSchedule, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Remoteagentschedules", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Remoteagentschedules", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechRemoteAgentSchedule]) IPostable.__init__(self, LabTechRemoteAgentSchedule) IPaginateable.__init__(self, LabTechRemoteAgentSchedule) diff --git a/src/pyconnectwise/endpoints/automate/RemoteagenttemplatesEndpoint.py b/src/pyconnectwise/endpoints/automate/RemoteagenttemplatesEndpoint.py index 5bf4845d8..97ee26d96 100644 --- a/src/pyconnectwise/endpoints/automate/RemoteagenttemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/RemoteagenttemplatesEndpoint.py @@ -19,9 +19,7 @@ class RemoteagenttemplatesEndpoint( IPaginateable[LabTechRemoteAgentTemplate, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Remoteagenttemplates", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Remoteagenttemplates", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechRemoteAgentTemplate]) IPostable.__init__(self, LabTechRemoteAgentTemplate) IPaginateable.__init__(self, LabTechRemoteAgentTemplate) diff --git a/src/pyconnectwise/endpoints/automate/RetiredassetsEndpoint.py b/src/pyconnectwise/endpoints/automate/RetiredassetsEndpoint.py index 7882c9e35..b53d7a370 100644 --- a/src/pyconnectwise/endpoints/automate/RetiredassetsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/RetiredassetsEndpoint.py @@ -17,9 +17,7 @@ class RetiredassetsEndpoint( IPaginateable[LabTechRetiredAsset, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Retiredassets", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Retiredassets", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechRetiredAsset]) IPaginateable.__init__(self, LabTechRetiredAsset) diff --git a/src/pyconnectwise/endpoints/automate/RoutersEndpoint.py b/src/pyconnectwise/endpoints/automate/RoutersEndpoint.py index d31f2e074..db967d66f 100644 --- a/src/pyconnectwise/endpoints/automate/RoutersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/RoutersEndpoint.py @@ -17,9 +17,7 @@ class RoutersEndpoint( IPaginateable[LabTechRouter, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Routers", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Routers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechRouter]) IPaginateable.__init__(self, LabTechRouter) @@ -67,6 +65,4 @@ def get( Returns: list[LabTechRouter]: The parsed response data. """ - return self._parse_many( - LabTechRouter, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LabTechRouter, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/automate/ScriptfoldersEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptfoldersEndpoint.py index 35f47f244..904765481 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptfoldersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptfoldersEndpoint.py @@ -25,16 +25,12 @@ class ScriptfoldersEndpoint( IPaginateable[LabTechScriptFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scriptfolders", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scriptfolders", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechScriptFolder]) IPostable.__init__(self, LabTechScriptFolder) IPaginateable.__init__(self, LabTechScriptFolder) - self.hierarchy = self._register_child_endpoint( - ScriptfoldersHierarchyEndpoint(client, parent_endpoint=self) - ) + self.hierarchy = self._register_child_endpoint(ScriptfoldersHierarchyEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> ScriptfoldersIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/ScriptfoldersHierarchyEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptfoldersHierarchyEndpoint.py index 4fa4fb5cb..90e531de6 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptfoldersHierarchyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptfoldersHierarchyEndpoint.py @@ -14,9 +14,7 @@ class ScriptfoldersHierarchyEndpoint( IGettable[list[LabTechScriptFolder], ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Hierarchy", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Hierarchy", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechScriptFolder]) def get( diff --git a/src/pyconnectwise/endpoints/automate/ScriptfoldersIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptfoldersIdEndpoint.py index b9e7a779d..634c34b57 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptfoldersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptfoldersIdEndpoint.py @@ -20,9 +20,7 @@ class ScriptfoldersIdEndpoint( IPaginateable[LabTechScriptFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechScriptFolder) IPatchable.__init__(self, LabTechScriptFolder) IPaginateable.__init__(self, LabTechScriptFolder) diff --git a/src/pyconnectwise/endpoints/automate/ScriptingEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptingEndpoint.py index f1733362b..37ed530c6 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptingEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptingEndpoint.py @@ -9,9 +9,7 @@ class ScriptingEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scripting", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scripting", parent_endpoint=parent_endpoint) self.runningscripts = self._register_child_endpoint( ScriptingRunningscriptsEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/ScriptingRunningscriptsEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptingRunningscriptsEndpoint.py index 82ca8c580..977f38f5d 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptingRunningscriptsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptingRunningscriptsEndpoint.py @@ -17,9 +17,7 @@ class ScriptingRunningscriptsEndpoint( IPaginateable[AutomateRunningScript, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Runningscripts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Runningscripts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateRunningScript]) IPaginateable.__init__(self, AutomateRunningScript) diff --git a/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesEndpoint.py index 0e2637a72..c70613df0 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesEndpoint.py @@ -20,9 +20,7 @@ class ScriptingScriptschedulesEndpoint( IPaginateable[AutomateScheduledScript, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scriptschedules", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scriptschedules", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateScheduledScript]) IPaginateable.__init__(self, AutomateScheduledScript) diff --git a/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesIdEndpoint.py index bc986ca4e..2647c56c5 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptingScriptschedulesIdEndpoint.py @@ -15,9 +15,7 @@ class ScriptingScriptschedulesIdEndpoint( IPatchable[AutomateScheduledScript, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPatchable.__init__(self, AutomateScheduledScript) def delete( diff --git a/src/pyconnectwise/endpoints/automate/ScriptsEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptsEndpoint.py index 42752835e..a67ef0035 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptsEndpoint.py @@ -13,18 +13,12 @@ ) -class ScriptsEndpoint( - ConnectWiseEndpoint, IPostable[AutomateScript, ConnectWiseAutomateRequestParams] -): +class ScriptsEndpoint(ConnectWiseEndpoint, IPostable[AutomateScript, ConnectWiseAutomateRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scripts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scripts", parent_endpoint=parent_endpoint) IPostable.__init__(self, AutomateScript) - self.scriptfolders = self._register_child_endpoint( - ScriptsScriptfoldersEndpoint(client, parent_endpoint=self) - ) + self.scriptfolders = self._register_child_endpoint(ScriptsScriptfoldersEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> ScriptsIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/ScriptsIdCopyEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptsIdCopyEndpoint.py index 4308b6808..d5e9eda46 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptsIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptsIdCopyEndpoint.py @@ -3,6 +3,4 @@ class ScriptsIdCopyEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Copy", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Copy", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/ScriptsIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptsIdEndpoint.py index e1ec60909..8c9e25bd0 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptsIdEndpoint.py @@ -17,15 +17,11 @@ class ScriptsIdEndpoint( IPuttable[AutomateScript, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateScript) IPuttable.__init__(self, AutomateScript) - self.copy = self._register_child_endpoint( - ScriptsIdCopyEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(ScriptsIdCopyEndpoint(client, parent_endpoint=self)) def get( self, diff --git a/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersEndpoint.py index f1cd0fdae..01b38bfc4 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersEndpoint.py @@ -17,9 +17,7 @@ class ScriptsScriptfoldersEndpoint( IPostable[AutomateSubmittableScriptFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Scriptfolders", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Scriptfolders", parent_endpoint=parent_endpoint) IPostable.__init__(self, AutomateSubmittableScriptFolder) def id(self, id: int) -> ScriptsScriptfoldersIdEndpoint: # noqa: A002 diff --git a/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersIdEndpoint.py index 48ec661b1..89cef97c0 100644 --- a/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ScriptsScriptfoldersIdEndpoint.py @@ -14,9 +14,7 @@ class ScriptsScriptfoldersIdEndpoint( IPostable[AutomateSubmittableScriptFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPostable.__init__(self, AutomateSubmittableScriptFolder) def post( diff --git a/src/pyconnectwise/endpoints/automate/SearchesEndpoint.py b/src/pyconnectwise/endpoints/automate/SearchesEndpoint.py index 640b76ac3..7618a3aca 100644 --- a/src/pyconnectwise/endpoints/automate/SearchesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/SearchesEndpoint.py @@ -17,9 +17,7 @@ class SearchesEndpoint( IPaginateable[LabTechSearch, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Searches", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Searches", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechSearch]) IPaginateable.__init__(self, LabTechSearch) @@ -67,6 +65,4 @@ def get( Returns: list[LabTechSearch]: The parsed response data. """ - return self._parse_many( - LabTechSearch, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LabTechSearch, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/automate/SearchfoldersEndpoint.py b/src/pyconnectwise/endpoints/automate/SearchfoldersEndpoint.py index a211ebb46..896c34cc5 100644 --- a/src/pyconnectwise/endpoints/automate/SearchfoldersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/SearchfoldersEndpoint.py @@ -19,9 +19,7 @@ class SearchfoldersEndpoint( IPaginateable[LabTechSearchFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Searchfolders", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Searchfolders", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechSearchFolder]) IPostable.__init__(self, LabTechSearchFolder) IPaginateable.__init__(self, LabTechSearchFolder) diff --git a/src/pyconnectwise/endpoints/automate/SensorchecksEndpoint.py b/src/pyconnectwise/endpoints/automate/SensorchecksEndpoint.py index 31ae29a4d..2bdfa69df 100644 --- a/src/pyconnectwise/endpoints/automate/SensorchecksEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/SensorchecksEndpoint.py @@ -17,9 +17,7 @@ class SensorchecksEndpoint( IPaginateable[LabTechSensorCheck, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Sensorchecks", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Sensorchecks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechSensorCheck]) IPaginateable.__init__(self, LabTechSensorCheck) diff --git a/src/pyconnectwise/endpoints/automate/ServicesEndpoint.py b/src/pyconnectwise/endpoints/automate/ServicesEndpoint.py index 6f0d626e9..12b60897c 100644 --- a/src/pyconnectwise/endpoints/automate/ServicesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ServicesEndpoint.py @@ -4,9 +4,7 @@ class ServicesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Services", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Services", parent_endpoint=parent_endpoint) def id(self, id: int) -> ServicesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/automate/ServicesIdClassifyEndpoint.py b/src/pyconnectwise/endpoints/automate/ServicesIdClassifyEndpoint.py index 2273e452d..9eb1d8bc1 100644 --- a/src/pyconnectwise/endpoints/automate/ServicesIdClassifyEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ServicesIdClassifyEndpoint.py @@ -7,9 +7,7 @@ class ServicesIdClassifyEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Classify", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Classify", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/ServicesIdEndpoint.py b/src/pyconnectwise/endpoints/automate/ServicesIdEndpoint.py index 3ddc7eb6a..bfe6ece90 100644 --- a/src/pyconnectwise/endpoints/automate/ServicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ServicesIdEndpoint.py @@ -6,10 +6,6 @@ class ServicesIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.classify = self._register_child_endpoint( - ServicesIdClassifyEndpoint(client, parent_endpoint=self) - ) + self.classify = self._register_child_endpoint(ServicesIdClassifyEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/automate/StatisticsDrivesEndpoint.py b/src/pyconnectwise/endpoints/automate/StatisticsDrivesEndpoint.py index 461ce44ae..e9e1a7934 100644 --- a/src/pyconnectwise/endpoints/automate/StatisticsDrivesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/StatisticsDrivesEndpoint.py @@ -14,9 +14,7 @@ class StatisticsDrivesEndpoint( IGettable[list[LabTechDriveStatistics], ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Drives", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Drives", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechDriveStatistics]) def get( diff --git a/src/pyconnectwise/endpoints/automate/StatisticsEndpoint.py b/src/pyconnectwise/endpoints/automate/StatisticsEndpoint.py index b1825cc10..85cff4f5e 100644 --- a/src/pyconnectwise/endpoints/automate/StatisticsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/StatisticsEndpoint.py @@ -6,10 +6,6 @@ class StatisticsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Statistics", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Statistics", parent_endpoint=parent_endpoint) - self.drives = self._register_child_endpoint( - StatisticsDrivesEndpoint(client, parent_endpoint=self) - ) + self.drives = self._register_child_endpoint(StatisticsDrivesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/automate/SystemEndpoint.py b/src/pyconnectwise/endpoints/automate/SystemEndpoint.py index 9d4bc9db4..d2bcf5d4a 100644 --- a/src/pyconnectwise/endpoints/automate/SystemEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/SystemEndpoint.py @@ -6,9 +6,7 @@ class SystemEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "System", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "System", parent_endpoint=parent_endpoint) self.serverinformation = self._register_child_endpoint( SystemServerinformationEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/automate/SystemServerinformationEndpoint.py b/src/pyconnectwise/endpoints/automate/SystemServerinformationEndpoint.py index 060cb47c2..ea3be5c2e 100644 --- a/src/pyconnectwise/endpoints/automate/SystemServerinformationEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/SystemServerinformationEndpoint.py @@ -17,9 +17,7 @@ class SystemServerinformationEndpoint( IPaginateable[AutomateServerInformation, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Serverinformation", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Serverinformation", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateServerInformation]) IPaginateable.__init__(self, AutomateServerInformation) diff --git a/src/pyconnectwise/endpoints/automate/SystemcontactsEndpoint.py b/src/pyconnectwise/endpoints/automate/SystemcontactsEndpoint.py index a624441bf..af941cdd2 100644 --- a/src/pyconnectwise/endpoints/automate/SystemcontactsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/SystemcontactsEndpoint.py @@ -17,9 +17,7 @@ class SystemcontactsEndpoint( IPaginateable[LabTechContact, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Systemcontacts", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Systemcontacts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechContact]) IPaginateable.__init__(self, LabTechContact) diff --git a/src/pyconnectwise/endpoints/automate/TemplateavailablepropertiesEndpoint.py b/src/pyconnectwise/endpoints/automate/TemplateavailablepropertiesEndpoint.py index 4ec0e71c0..75dc39af0 100644 --- a/src/pyconnectwise/endpoints/automate/TemplateavailablepropertiesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/TemplateavailablepropertiesEndpoint.py @@ -19,9 +19,7 @@ class TemplateavailablepropertiesEndpoint( IPaginateable[LabTechTemplateAvailableProperty, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Templateavailableproperties", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Templateavailableproperties", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechTemplateAvailableProperty]) IPostable.__init__(self, LabTechTemplateAvailableProperty) IPaginateable.__init__(self, LabTechTemplateAvailableProperty) diff --git a/src/pyconnectwise/endpoints/automate/TemplatepropertiesEndpoint.py b/src/pyconnectwise/endpoints/automate/TemplatepropertiesEndpoint.py index cbac578dd..c8e49cbac 100644 --- a/src/pyconnectwise/endpoints/automate/TemplatepropertiesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/TemplatepropertiesEndpoint.py @@ -19,9 +19,7 @@ class TemplatepropertiesEndpoint( IPaginateable[LabTechTemplateProperty, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Templateproperties", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Templateproperties", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechTemplateProperty]) IPostable.__init__(self, LabTechTemplateProperty) IPaginateable.__init__(self, LabTechTemplateProperty) diff --git a/src/pyconnectwise/endpoints/automate/ThirdpartyupdatepoliciesEndpoint.py b/src/pyconnectwise/endpoints/automate/ThirdpartyupdatepoliciesEndpoint.py index 5ced1d314..8b75926a4 100644 --- a/src/pyconnectwise/endpoints/automate/ThirdpartyupdatepoliciesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/ThirdpartyupdatepoliciesEndpoint.py @@ -3,6 +3,4 @@ class ThirdpartyupdatepoliciesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Thirdpartyupdatepolicies", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Thirdpartyupdatepolicies", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/TicketsEndpoint.py b/src/pyconnectwise/endpoints/automate/TicketsEndpoint.py index f2a5e734e..d6e303527 100644 --- a/src/pyconnectwise/endpoints/automate/TicketsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/TicketsEndpoint.py @@ -3,6 +3,4 @@ class TicketsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Tickets", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Tickets", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/automate/UserauditsEndpoint.py b/src/pyconnectwise/endpoints/automate/UserauditsEndpoint.py index a0ccad365..38c6c0e5c 100644 --- a/src/pyconnectwise/endpoints/automate/UserauditsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UserauditsEndpoint.py @@ -19,9 +19,7 @@ class UserauditsEndpoint( IPaginateable[LabTechUserAudit, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Useraudits", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Useraudits", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechUserAudit]) IPostable.__init__(self, LabTechUserAudit) IPaginateable.__init__(self, LabTechUserAudit) diff --git a/src/pyconnectwise/endpoints/automate/UserclassesEndpoint.py b/src/pyconnectwise/endpoints/automate/UserclassesEndpoint.py index beb2b391e..e5b8aefdb 100644 --- a/src/pyconnectwise/endpoints/automate/UserclassesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UserclassesEndpoint.py @@ -18,9 +18,7 @@ class UserclassesEndpoint( IPaginateable[AutomateUserClass, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Userclasses", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Userclasses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateUserClass]) IPaginateable.__init__(self, AutomateUserClass) diff --git a/src/pyconnectwise/endpoints/automate/UserclassesIdEndpoint.py b/src/pyconnectwise/endpoints/automate/UserclassesIdEndpoint.py index 7b458e5ff..295120417 100644 --- a/src/pyconnectwise/endpoints/automate/UserclassesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UserclassesIdEndpoint.py @@ -20,9 +20,7 @@ class UserclassesIdEndpoint( IPaginateable[AutomateUserClass, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateUserClass) IPaginateable.__init__(self, AutomateUserClass) diff --git a/src/pyconnectwise/endpoints/automate/UserclassesIdWebextensionsEndpoint.py b/src/pyconnectwise/endpoints/automate/UserclassesIdWebextensionsEndpoint.py index 5905b3273..15b5781b8 100644 --- a/src/pyconnectwise/endpoints/automate/UserclassesIdWebextensionsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UserclassesIdWebextensionsEndpoint.py @@ -12,17 +12,11 @@ class UserclassesIdWebextensionsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[AutomateUserClassWebExtensionViewModel], ConnectWiseAutomateRequestParams - ], - IPuttable[ - list[AutomateUserClassWebExtensionViewModel], ConnectWiseAutomateRequestParams - ], + IGettable[list[AutomateUserClassWebExtensionViewModel], ConnectWiseAutomateRequestParams], + IPuttable[list[AutomateUserClassWebExtensionViewModel], ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Webextensions", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Webextensions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutomateUserClassWebExtensionViewModel]) IPuttable.__init__(self, list[AutomateUserClassWebExtensionViewModel]) diff --git a/src/pyconnectwise/endpoints/automate/UserprofilesEndpoint.py b/src/pyconnectwise/endpoints/automate/UserprofilesEndpoint.py index 9148242ba..64fdc2fd9 100644 --- a/src/pyconnectwise/endpoints/automate/UserprofilesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UserprofilesEndpoint.py @@ -9,13 +9,9 @@ ) -class UserprofilesEndpoint( - ConnectWiseEndpoint, IGettable[LabTechUserProfile, ConnectWiseAutomateRequestParams] -): +class UserprofilesEndpoint(ConnectWiseEndpoint, IGettable[LabTechUserProfile, ConnectWiseAutomateRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Userprofiles", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Userprofiles", parent_endpoint=parent_endpoint) IGettable.__init__(self, LabTechUserProfile) def get( diff --git a/src/pyconnectwise/endpoints/automate/UsersEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersEndpoint.py index 7374fc90d..7c25a516a 100644 --- a/src/pyconnectwise/endpoints/automate/UsersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersEndpoint.py @@ -11,18 +11,12 @@ ) -class UsersEndpoint( - ConnectWiseEndpoint, IPostable[AutomateUser, ConnectWiseAutomateRequestParams] -): +class UsersEndpoint(ConnectWiseEndpoint, IPostable[AutomateUser, ConnectWiseAutomateRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Users", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Users", parent_endpoint=parent_endpoint) IPostable.__init__(self, AutomateUser) - self.folders = self._register_child_endpoint( - UsersFoldersEndpoint(client, parent_endpoint=self) - ) + self.folders = self._register_child_endpoint(UsersFoldersEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> UsersIdEndpoint: # noqa: A002 """ @@ -51,6 +45,4 @@ def post( Returns: AutomateUser: The parsed response data. """ - return self._parse_one( - AutomateUser, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(AutomateUser, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/automate/UsersFoldersEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersFoldersEndpoint.py index 6443fd983..f5ba2c9e1 100644 --- a/src/pyconnectwise/endpoints/automate/UsersFoldersEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersFoldersEndpoint.py @@ -12,13 +12,9 @@ ) -class UsersFoldersEndpoint( - ConnectWiseEndpoint, IPostable[AutomateUserFolder, ConnectWiseAutomateRequestParams] -): +class UsersFoldersEndpoint(ConnectWiseEndpoint, IPostable[AutomateUserFolder, ConnectWiseAutomateRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Folders", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Folders", parent_endpoint=parent_endpoint) IPostable.__init__(self, AutomateUserFolder) def id(self, id: int) -> UsersFoldersIdEndpoint: # noqa: A002 diff --git a/src/pyconnectwise/endpoints/automate/UsersFoldersIdEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersFoldersIdEndpoint.py index 1f3200b9d..bdb964e8b 100644 --- a/src/pyconnectwise/endpoints/automate/UsersFoldersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersFoldersIdEndpoint.py @@ -20,9 +20,7 @@ class UsersFoldersIdEndpoint( IPaginateable[AutomateUserFolder, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateUserFolder) IPatchable.__init__(self, AutomateUserFolder) IPaginateable.__init__(self, AutomateUserFolder) diff --git a/src/pyconnectwise/endpoints/automate/UsersIdAuthlinkEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersIdAuthlinkEndpoint.py index dc82f9dc1..a78de40d5 100644 --- a/src/pyconnectwise/endpoints/automate/UsersIdAuthlinkEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersIdAuthlinkEndpoint.py @@ -14,9 +14,7 @@ class UsersIdAuthlinkEndpoint( IPostable[LabTechAuthServiceCredentials, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Authlink", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Authlink", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechAuthServiceCredentials) def post( diff --git a/src/pyconnectwise/endpoints/automate/UsersIdChangepasswordEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersIdChangepasswordEndpoint.py index 80ff36d29..8dc12f0b3 100644 --- a/src/pyconnectwise/endpoints/automate/UsersIdChangepasswordEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersIdChangepasswordEndpoint.py @@ -7,9 +7,7 @@ class UsersIdChangepasswordEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Changepassword", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Changepassword", parent_endpoint=parent_endpoint) def post( self, diff --git a/src/pyconnectwise/endpoints/automate/UsersIdEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersIdEndpoint.py index 69352bf5a..26aaa8f78 100644 --- a/src/pyconnectwise/endpoints/automate/UsersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersIdEndpoint.py @@ -35,28 +35,16 @@ class UsersIdEndpoint( IPaginateable[AutomateUser, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateUser) IPatchable.__init__(self, AutomateUser) IPaginateable.__init__(self, AutomateUser) - self.useraccess = self._register_child_endpoint( - UsersIdUseraccessEndpoint(client, parent_endpoint=self) - ) - self.settings = self._register_child_endpoint( - UsersIdSettingsEndpoint(client, parent_endpoint=self) - ) - self.favorites = self._register_child_endpoint( - UsersIdFavoritesEndpoint(client, parent_endpoint=self) - ) - self.authlink = self._register_child_endpoint( - UsersIdAuthlinkEndpoint(client, parent_endpoint=self) - ) - self.changepassword = self._register_child_endpoint( - UsersIdChangepasswordEndpoint(client, parent_endpoint=self) - ) + self.useraccess = self._register_child_endpoint(UsersIdUseraccessEndpoint(client, parent_endpoint=self)) + self.settings = self._register_child_endpoint(UsersIdSettingsEndpoint(client, parent_endpoint=self)) + self.favorites = self._register_child_endpoint(UsersIdFavoritesEndpoint(client, parent_endpoint=self)) + self.authlink = self._register_child_endpoint(UsersIdAuthlinkEndpoint(client, parent_endpoint=self)) + self.changepassword = self._register_child_endpoint(UsersIdChangepasswordEndpoint(client, parent_endpoint=self)) def paginated( self, @@ -102,9 +90,7 @@ def get( Returns: AutomateUser: The parsed response data. """ - return self._parse_one( - AutomateUser, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(AutomateUser, super()._make_request("GET", data=data, params=params).json()) def delete( self, diff --git a/src/pyconnectwise/endpoints/automate/UsersIdFavoritesEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersIdFavoritesEndpoint.py index 75229e313..fa8a26bbd 100644 --- a/src/pyconnectwise/endpoints/automate/UsersIdFavoritesEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersIdFavoritesEndpoint.py @@ -14,9 +14,7 @@ class UsersIdFavoritesEndpoint( IPostable[LabTechUserFavorite, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Favorites", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Favorites", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechUserFavorite) def post( diff --git a/src/pyconnectwise/endpoints/automate/UsersIdSettingsEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersIdSettingsEndpoint.py index e0b135936..34efaa4f2 100644 --- a/src/pyconnectwise/endpoints/automate/UsersIdSettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersIdSettingsEndpoint.py @@ -9,13 +9,9 @@ ) -class UsersIdSettingsEndpoint( - ConnectWiseEndpoint, IPostable[LabTechUserSetting, ConnectWiseAutomateRequestParams] -): +class UsersIdSettingsEndpoint(ConnectWiseEndpoint, IPostable[LabTechUserSetting, ConnectWiseAutomateRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Settings", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Settings", parent_endpoint=parent_endpoint) IPostable.__init__(self, LabTechUserSetting) def post( diff --git a/src/pyconnectwise/endpoints/automate/UsersIdUseraccessEndpoint.py b/src/pyconnectwise/endpoints/automate/UsersIdUseraccessEndpoint.py index 19c984f18..78681f0cb 100644 --- a/src/pyconnectwise/endpoints/automate/UsersIdUseraccessEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/UsersIdUseraccessEndpoint.py @@ -9,13 +9,9 @@ ) -class UsersIdUseraccessEndpoint( - ConnectWiseEndpoint, IGettable[AutomateUserAccess, ConnectWiseAutomateRequestParams] -): +class UsersIdUseraccessEndpoint(ConnectWiseEndpoint, IGettable[AutomateUserAccess, ConnectWiseAutomateRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Useraccess", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Useraccess", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutomateUserAccess) def get( diff --git a/src/pyconnectwise/endpoints/automate/VirusscannerdefsEndpoint.py b/src/pyconnectwise/endpoints/automate/VirusscannerdefsEndpoint.py index 81faf34f4..96023e695 100644 --- a/src/pyconnectwise/endpoints/automate/VirusscannerdefsEndpoint.py +++ b/src/pyconnectwise/endpoints/automate/VirusscannerdefsEndpoint.py @@ -19,9 +19,7 @@ class VirusscannerdefsEndpoint( IPaginateable[LabTechVirusScannerDef, ConnectWiseAutomateRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "Virusscannerdefs", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "Virusscannerdefs", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LabTechVirusScannerDef]) IPostable.__init__(self, LabTechVirusScannerDef) IPaginateable.__init__(self, LabTechVirusScannerDef) diff --git a/src/pyconnectwise/endpoints/base/connectwise_endpoint.py b/src/pyconnectwise/endpoints/base/connectwise_endpoint.py index 0cc7a0422..3f417450b 100644 --- a/src/pyconnectwise/endpoints/base/connectwise_endpoint.py +++ b/src/pyconnectwise/endpoints/base/connectwise_endpoint.py @@ -1,16 +1,17 @@ from __future__ import annotations -from typing import TypeVar, TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, TypeVar if TYPE_CHECKING: + from pydantic import BaseModel + from requests import Response + + from pyconnectwise.clients.connectwise_client import ConnectWiseClient from pyconnectwise.types import ( RequestData, RequestMethod, RequestParams, ) - from requests import Response - from pyconnectwise.clients.connectwise_client import ConnectWiseClient - from pydantic import BaseModel TChildEndpoint = TypeVar("TChildEndpoint", bound="ConnectWiseEndpoint") TModel = TypeVar("TModel", bound="BaseModel") @@ -76,9 +77,7 @@ def __init__( self._id = None self._child_endpoints: list[ConnectWiseEndpoint] = [] - def _register_child_endpoint( - self, child_endpoint: TChildEndpoint - ) -> TChildEndpoint: + def _register_child_endpoint(self, child_endpoint: TChildEndpoint) -> TChildEndpoint: """ Register a child endpoint to the current endpoint. @@ -151,16 +150,12 @@ def _build_url(self, other_endpoint: ConnectWiseEndpoint) -> str: else: # noqa: RET505 return self._url_join(parent_url, other_endpoint._get_replaced_url()) else: - return self._url_join( - self.client._get_url(), other_endpoint._get_replaced_url() - ) + return self._url_join(self.client._get_url(), other_endpoint._get_replaced_url()) def _get_endpoint_url(self) -> str: return self._build_url(self) - def _parse_many( - self, model_type: type[TModel], data: list[dict[str, Any]] - ) -> list[TModel]: + def _parse_many(self, model_type: type[TModel], data: list[dict[str, Any]]) -> list[TModel]: return [model_type.model_validate(d) for d in data] def _parse_one(self, model_type: type[TModel], data: dict[str, Any]) -> TModel: diff --git a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsCountEndpoint.py index adf0773db..7e1878a60 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyAddressformatsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyAddressformatsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/addressFormats/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/addressFormats/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsEndpoint.py index 3e57fc272..795c842ac 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyAddressformatsCountEndpoint import ( - CompanyAddressformatsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyAddressformatsIdEndpoint import ( - CompanyAddressformatsIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyAddressformatsInfoEndpoint import ( - CompanyAddressformatsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyAddressformatsCountEndpoint import CompanyAddressformatsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyAddressformatsIdEndpoint import CompanyAddressformatsIdEndpoint +from pyconnectwise.endpoints.manage.CompanyAddressformatsInfoEndpoint import CompanyAddressformatsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AddressFormat from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyAddressformatsEndpoint( @@ -27,39 +19,30 @@ class CompanyAddressformatsEndpoint( IPostable[AddressFormat, ConnectWiseManageRequestParams], IPaginateable[AddressFormat, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "addressFormats", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "addressFormats", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AddressFormat]) IPostable.__init__(self, AddressFormat) IPaginateable.__init__(self, AddressFormat) - self.count = self._register_child_endpoint( - CompanyAddressformatsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyAddressformatsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyAddressformatsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyAddressformatsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyAddressformatsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyAddressformatsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyAddressformatsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyAddressformatsIdEndpoint: The initialized CompanyAddressformatsIdEndpoint object. """ child = CompanyAddressformatsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AddressFormat]: """ Performs a GET request against the /company/addressFormats endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AddressFormat, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AddressFormat, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AddressFormat]: """ Performs a GET request against the /company/addressFormats endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[AddressFormat]: The parsed response data. """ - return self._parse_many( - AddressFormat, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(AddressFormat, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AddressFormat: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AddressFormat: """ Performs a POST request against the /company/addressFormats endpoint. @@ -117,7 +87,4 @@ def post( Returns: AddressFormat: The parsed response data. """ - return self._parse_one( - AddressFormat, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AddressFormat, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdEndpoint.py index 6c6774b61..251b09a3a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyAddressformatsIdInfoEndpoint import ( - CompanyAddressformatsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyAddressformatsIdInfoEndpoint import CompanyAddressformatsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AddressFormat from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyAddressformatsIdEndpoint( ConnectWiseEndpoint, IGettable[AddressFormat, ConnectWiseManageRequestParams], - IPuttable[AddressFormat, ConnectWiseManageRequestParams], IPatchable[AddressFormat, ConnectWiseManageRequestParams], + IPuttable[AddressFormat, ConnectWiseManageRequestParams], IPaginateable[AddressFormat, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AddressFormat) - IPuttable.__init__(self, AddressFormat) IPatchable.__init__(self, AddressFormat) + IPuttable.__init__(self, AddressFormat) IPaginateable.__init__(self, AddressFormat) - self.info = self._register_child_endpoint( - CompanyAddressformatsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyAddressformatsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AddressFormat]: """ Performs a GET request against the /company/addressFormats/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AddressFormat, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AddressFormat, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AddressFormat: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/addressFormats/{id} endpoint. + Performs a DELETE request against the /company/addressFormats/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AddressFormat: The parsed response data. """ - return self._parse_one( - AddressFormat, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AddressFormat: """ - Performs a DELETE request against the /company/addressFormats/{id} endpoint. + Performs a GET request against the /company/addressFormats/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AddressFormat: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AddressFormat, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AddressFormat: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AddressFormat: """ - Performs a PUT request against the /company/addressFormats/{id} endpoint. + Performs a PATCH request against the /company/addressFormats/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: AddressFormat: The parsed response data. """ - return self._parse_one( - AddressFormat, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(AddressFormat, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AddressFormat: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AddressFormat: """ - Performs a PATCH request against the /company/addressFormats/{id} endpoint. + Performs a PUT request against the /company/addressFormats/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +93,4 @@ def patch( Returns: AddressFormat: The parsed response data. """ - return self._parse_one( - AddressFormat, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AddressFormat, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdInfoEndpoint.py index 7da80df4c..013286607 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AddressFormatInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyAddressformatsIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyAddressformatsIdInfoEndpoint( IGettable[AddressFormatInfo, ConnectWiseManageRequestParams], IPaginateable[AddressFormatInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, AddressFormatInfo) IPaginateable.__init__(self, AddressFormatInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AddressFormatInfo]: """ Performs a GET request against the /company/addressFormats/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AddressFormatInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AddressFormatInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AddressFormatInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AddressFormatInfo: """ Performs a GET request against the /company/addressFormats/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: AddressFormatInfo: The parsed response data. """ - return self._parse_one( - AddressFormatInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(AddressFormatInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoCountEndpoint.py index 3d547e5e3..637a496a9 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyAddressformatsInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyAddressformatsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/addressFormats/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/addressFormats/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoEndpoint.py index a29ecefe6..06b28279e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyAddressformatsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyAddressformatsInfoCountEndpoint import ( - CompanyAddressformatsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyAddressformatsInfoCountEndpoint import CompanyAddressformatsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AddressFormatInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyAddressformatsInfoEndpoint( @@ -19,22 +16,15 @@ class CompanyAddressformatsInfoEndpoint( IGettable[list[AddressFormatInfo], ConnectWiseManageRequestParams], IPaginateable[AddressFormatInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AddressFormatInfo]) IPaginateable.__init__(self, AddressFormatInfo) - self.count = self._register_child_endpoint( - CompanyAddressformatsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyAddressformatsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AddressFormatInfo]: """ Performs a GET request against the /company/addressFormats/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AddressFormatInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AddressFormatInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AddressFormatInfo]: """ Performs a GET request against the /company/addressFormats/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[AddressFormatInfo]: The parsed response data. """ - return self._parse_many( - AddressFormatInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AddressFormatInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsEndpoint.py index e774beece..7249ac8ce 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyBillingsetupsInfoEndpoint import ( - CompanyBillingsetupsInfoEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyBillingsetupsInfoEndpoint import CompanyBillingsetupsInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyBillingsetupsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingSetups", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - CompanyBillingsetupsInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "billingSetups", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(CompanyBillingsetupsInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoCountEndpoint.py index 917e31da3..ca1413306 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyBillingsetupsInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyBillingsetupsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/billingSetups/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/billingSetups/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoEndpoint.py index 7a9366fa9..8490dd799 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyBillingsetupsInfoEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyBillingsetupsInfoCountEndpoint import ( - CompanyBillingsetupsInfoCountEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyBillingsetupsInfoCountEndpoint import CompanyBillingsetupsInfoCountEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyBillingsetupsInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - - self.count = self._register_child_endpoint( - CompanyBillingsetupsInfoCountEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + + self.count = self._register_child_endpoint(CompanyBillingsetupsInfoCountEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesCountEndpoint.py index 1f7091855..85f971600 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCommunicationtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/communicationTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/communicationTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesEndpoint.py index e7d91c69f..3849bfe05 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCommunicationtypesCountEndpoint import ( - CompanyCommunicationtypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCommunicationtypesIdEndpoint import ( - CompanyCommunicationtypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCommunicationtypesInfoEndpoint import ( - CompanyCommunicationtypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCommunicationtypesCountEndpoint import CompanyCommunicationtypesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCommunicationtypesIdEndpoint import CompanyCommunicationtypesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyCommunicationtypesInfoEndpoint import CompanyCommunicationtypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CommunicationType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesEndpoint( @@ -27,39 +19,30 @@ class CompanyCommunicationtypesEndpoint( IPostable[CommunicationType, ConnectWiseManageRequestParams], IPaginateable[CommunicationType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "communicationTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "communicationTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CommunicationType]) IPostable.__init__(self, CommunicationType) IPaginateable.__init__(self, CommunicationType) - self.count = self._register_child_endpoint( - CompanyCommunicationtypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyCommunicationtypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCommunicationtypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyCommunicationtypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCommunicationtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCommunicationtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCommunicationtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCommunicationtypesIdEndpoint: The initialized CompanyCommunicationtypesIdEndpoint object. """ child = CompanyCommunicationtypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CommunicationType]: """ Performs a GET request against the /company/communicationTypes endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CommunicationType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CommunicationType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CommunicationType]: """ Performs a GET request against the /company/communicationTypes endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[CommunicationType]: The parsed response data. """ - return self._parse_many( - CommunicationType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CommunicationType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CommunicationType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CommunicationType: """ Performs a POST request against the /company/communicationTypes endpoint. @@ -118,7 +87,4 @@ def post( Returns: CommunicationType: The parsed response data. """ - return self._parse_one( - CommunicationType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CommunicationType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdEndpoint.py index 16b3a2c54..7c27f6dea 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCommunicationtypesIdInfoEndpoint import ( CompanyCommunicationtypesIdInfoEndpoint, @@ -5,49 +7,36 @@ from pyconnectwise.endpoints.manage.CompanyCommunicationtypesIdUsagesEndpoint import ( CompanyCommunicationtypesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CommunicationType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesIdEndpoint( ConnectWiseEndpoint, IGettable[CommunicationType, ConnectWiseManageRequestParams], - IPuttable[CommunicationType, ConnectWiseManageRequestParams], IPatchable[CommunicationType, ConnectWiseManageRequestParams], + IPuttable[CommunicationType, ConnectWiseManageRequestParams], IPaginateable[CommunicationType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CommunicationType) - IPuttable.__init__(self, CommunicationType) IPatchable.__init__(self, CommunicationType) + IPuttable.__init__(self, CommunicationType) IPaginateable.__init__(self, CommunicationType) + self.info = self._register_child_endpoint(CompanyCommunicationtypesIdInfoEndpoint(client, parent_endpoint=self)) self.usages = self._register_child_endpoint( CompanyCommunicationtypesIdUsagesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - CompanyCommunicationtypesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CommunicationType]: """ Performs a GET request against the /company/communicationTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +54,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CommunicationType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CommunicationType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CommunicationType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/communicationTypes/{id} endpoint. + Performs a DELETE request against the /company/communicationTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CommunicationType: The parsed response data. """ - return self._parse_one( - CommunicationType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CommunicationType: """ - Performs a DELETE request against the /company/communicationTypes/{id} endpoint. + Performs a GET request against the /company/communicationTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CommunicationType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CommunicationType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CommunicationType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CommunicationType: """ - Performs a PUT request against the /company/communicationTypes/{id} endpoint. + Performs a PATCH request against the /company/communicationTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +89,11 @@ def put( Returns: CommunicationType: The parsed response data. """ - return self._parse_one( - CommunicationType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CommunicationType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CommunicationType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CommunicationType: """ - Performs a PATCH request against the /company/communicationTypes/{id} endpoint. + Performs a PUT request against the /company/communicationTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +101,4 @@ def patch( Returns: CommunicationType: The parsed response data. """ - return self._parse_one( - CommunicationType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CommunicationType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdInfoEndpoint.py index 6435108a8..b6ee81953 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CommunicationTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyCommunicationtypesIdInfoEndpoint( IGettable[CommunicationTypeInfo, ConnectWiseManageRequestParams], IPaginateable[CommunicationTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CommunicationTypeInfo) IPaginateable.__init__(self, CommunicationTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CommunicationTypeInfo]: """ Performs a GET request against the /company/communicationTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CommunicationTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CommunicationTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CommunicationTypeInfo: """ Performs a GET request against the /company/communicationTypes/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: CommunicationTypeInfo: The parsed response data. """ - return self._parse_one( - CommunicationTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CommunicationTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesEndpoint.py index 70ac04e7c..2cb21542a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCommunicationtypesIdUsagesListEndpoint import ( CompanyCommunicationtypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class CompanyCommunicationtypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/communicationTypes/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/communicationTypes/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesListEndpoint.py index b55aa3828..a5b3bbf12 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyCommunicationtypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/communicationTypes/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/communicationTypes/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoCountEndpoint.py index c438a2d63..812a04e50 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCommunicationtypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/communicationTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/communicationTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoEndpoint.py index b091cf5d4..14129f71b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCommunicationtypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCommunicationtypesInfoCountEndpoint import ( CompanyCommunicationtypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CommunicationTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCommunicationtypesInfoEndpoint( @@ -19,10 +18,8 @@ class CompanyCommunicationtypesInfoEndpoint( IGettable[list[CommunicationTypeInfo], ConnectWiseManageRequestParams], IPaginateable[CommunicationTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CommunicationTypeInfo]) IPaginateable.__init__(self, CommunicationTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CommunicationTypeInfo]: """ Performs a GET request against the /company/communicationTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CommunicationTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CommunicationTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CommunicationTypeInfo]: """ Performs a GET request against the /company/communicationTypes/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[CommunicationTypeInfo]: The parsed response data. """ - return self._parse_many( - CommunicationTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CommunicationTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesCountEndpoint.py index 87c7f57c3..dd9b52603 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesDefaultEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesDefaultEndpoint.py index 1146fc992..65a1c511a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesDefaultEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesDefaultEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Company from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesDefaultEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesDefaultEndpoint( IGettable[Company, ConnectWiseManageRequestParams], IPaginateable[Company, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "default", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "default", parent_endpoint=parent_endpoint) IGettable.__init__(self, Company) IPaginateable.__init__(self, Company) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Company]: """ Performs a GET request against the /company/companies/default endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Company, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Company, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Company: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Company: """ Performs a GET request against the /company/companies/default endpoint. @@ -67,6 +50,4 @@ def get( Returns: Company: The parsed response data. """ - return self._parse_one( - Company, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Company, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesEndpoint.py index c73a3b513..f5d50e182 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesEndpoint.py @@ -1,33 +1,19 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesCountEndpoint import ( - CompanyCompaniesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesDefaultEndpoint import ( - CompanyCompaniesDefaultEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdEndpoint import ( - CompanyCompaniesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesInfoEndpoint import ( - CompanyCompaniesInfoEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesEndpoint import ( - CompanyCompaniesStatusesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesTypesEndpoint import ( - CompanyCompaniesTypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesCountEndpoint import CompanyCompaniesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesDefaultEndpoint import CompanyCompaniesDefaultEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdEndpoint import CompanyCompaniesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesInfoEndpoint import CompanyCompaniesInfoEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesEndpoint import CompanyCompaniesStatusesEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesTypesEndpoint import CompanyCompaniesTypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Company from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesEndpoint( @@ -36,48 +22,33 @@ class CompanyCompaniesEndpoint( IPostable[Company, ConnectWiseManageRequestParams], IPaginateable[Company, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "companies", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "companies", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Company]) IPostable.__init__(self, Company) IPaginateable.__init__(self, Company) - self.count = self._register_child_endpoint( - CompanyCompaniesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyCompaniesInfoEndpoint(client, parent_endpoint=self) - ) - self.default = self._register_child_endpoint( - CompanyCompaniesDefaultEndpoint(client, parent_endpoint=self) - ) - self.statuses = self._register_child_endpoint( - CompanyCompaniesStatusesEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - CompanyCompaniesTypesEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesCountEndpoint(client, parent_endpoint=self)) + self.default = self._register_child_endpoint(CompanyCompaniesDefaultEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyCompaniesInfoEndpoint(client, parent_endpoint=self)) + self.statuses = self._register_child_endpoint(CompanyCompaniesStatusesEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(CompanyCompaniesTypesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdEndpoint: The initialized CompanyCompaniesIdEndpoint object. """ child = CompanyCompaniesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Company]: """ Performs a GET request against the /company/companies endpoint and returns an initialized PaginatedResponse object. @@ -94,20 +65,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Company, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Company, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Company]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Company]: """ Performs a GET request against the /company/companies endpoint. @@ -117,15 +77,9 @@ def get( Returns: list[Company]: The parsed response data. """ - return self._parse_many( - Company, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Company, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Company: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Company: """ Performs a POST request against the /company/companies endpoint. @@ -135,6 +89,4 @@ def post( Returns: Company: The parsed response data. """ - return self._parse_one( - Company, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Company, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesCountEndpoint.py index dcccefea4..85d665778 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdCustomstatusnotesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdCustomstatusnotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/customStatusNotes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/customStatusNotes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesEndpoint.py index addcbbf2c..884c3f107 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdCustomstatusnotesCountEndpoint import ( CompanyCompaniesIdCustomstatusnotesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyCompaniesIdCustomstatusnotesIdEndpoint import ( CompanyCompaniesIdCustomstatusnotesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyCustomNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdCustomstatusnotesEndpoint( @@ -24,42 +22,31 @@ class CompanyCompaniesIdCustomstatusnotesEndpoint( IPostable[CompanyCustomNote, ConnectWiseManageRequestParams], IPaginateable[CompanyCustomNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "customStatusNotes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "customStatusNotes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyCustomNote]) IPostable.__init__(self, CompanyCustomNote) IPaginateable.__init__(self, CompanyCustomNote) self.count = self._register_child_endpoint( - CompanyCompaniesIdCustomstatusnotesCountEndpoint( - client, parent_endpoint=self - ) + CompanyCompaniesIdCustomstatusnotesCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyCompaniesIdCustomstatusnotesIdEndpoint: + def id(self, _id: int) -> CompanyCompaniesIdCustomstatusnotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdCustomstatusnotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdCustomstatusnotesIdEndpoint: The initialized CompanyCompaniesIdCustomstatusnotesIdEndpoint object. """ - child = CompanyCompaniesIdCustomstatusnotesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyCompaniesIdCustomstatusnotesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyCustomNote]: """ Performs a GET request against the /company/companies/{id}/customStatusNotes endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyCustomNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyCustomNote, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyCustomNote]: """ Performs a GET request against the /company/companies/{id}/customStatusNotes endpoint. @@ -99,16 +79,9 @@ def get( Returns: list[CompanyCustomNote]: The parsed response data. """ - return self._parse_many( - CompanyCustomNote, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CompanyCustomNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyCustomNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyCustomNote: """ Performs a POST request against the /company/companies/{id}/customStatusNotes endpoint. @@ -118,7 +91,4 @@ def post( Returns: CompanyCustomNote: The parsed response data. """ - return self._parse_one( - CompanyCustomNote, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CompanyCustomNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesIdEndpoint.py index 39796cdf1..6865c2875 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdCustomstatusnotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyCustomNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdCustomstatusnotesIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyCustomNote, ConnectWiseManageRequestParams], - IPuttable[CompanyCustomNote, ConnectWiseManageRequestParams], IPatchable[CompanyCustomNote, ConnectWiseManageRequestParams], + IPuttable[CompanyCustomNote, ConnectWiseManageRequestParams], IPaginateable[CompanyCustomNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyCustomNote) - IPuttable.__init__(self, CompanyCustomNote) IPatchable.__init__(self, CompanyCustomNote) + IPuttable.__init__(self, CompanyCustomNote) IPaginateable.__init__(self, CompanyCustomNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyCustomNote]: """ Performs a GET request against the /company/companies/{id}/customStatusNotes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyCustomNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyCustomNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyCustomNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/customStatusNotes/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/customStatusNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyCustomNote: The parsed response data. """ - return self._parse_one( - CompanyCustomNote, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyCustomNote: """ - Performs a DELETE request against the /company/companies/{id}/customStatusNotes/{id} endpoint. + Performs a GET request against the /company/companies/{id}/customStatusNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyCustomNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyCustomNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyCustomNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyCustomNote: """ - Performs a PUT request against the /company/companies/{id}/customStatusNotes/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/customStatusNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: CompanyCustomNote: The parsed response data. """ - return self._parse_one( - CompanyCustomNote, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CompanyCustomNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyCustomNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyCustomNote: """ - Performs a PATCH request against the /company/companies/{id}/customStatusNotes/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/customStatusNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: CompanyCustomNote: The parsed response data. """ - return self._parse_one( - CompanyCustomNote, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyCustomNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdEndpoint.py index e42a181ae..00d3eb45f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdEndpoint.py @@ -1,10 +1,10 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdCustomstatusnotesEndpoint import ( CompanyCompaniesIdCustomstatusnotesEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdGroupsEndpoint import ( - CompanyCompaniesIdGroupsEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdGroupsEndpoint import CompanyCompaniesIdGroupsEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdManagementreportnotificationsEndpoint import ( CompanyCompaniesIdManagementreportnotificationsEndpoint, ) @@ -14,112 +14,65 @@ from pyconnectwise.endpoints.manage.CompanyCompaniesIdManagementsummaryreportsEndpoint import ( CompanyCompaniesIdManagementsummaryreportsEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdMergeEndpoint import ( - CompanyCompaniesIdMergeEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdNotesEndpoint import ( - CompanyCompaniesIdNotesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesEndpoint import ( - CompanyCompaniesIdSitesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdSurveysEndpoint import ( - CompanyCompaniesIdSurveysEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdTeamsEndpoint import ( - CompanyCompaniesIdTeamsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdTracksEndpoint import ( - CompanyCompaniesIdTracksEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdMergeEndpoint import CompanyCompaniesIdMergeEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdNotesEndpoint import CompanyCompaniesIdNotesEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesEndpoint import CompanyCompaniesIdSitesEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdSurveysEndpoint import CompanyCompaniesIdSurveysEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdTeamsEndpoint import CompanyCompaniesIdTeamsEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdTracksEndpoint import CompanyCompaniesIdTracksEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdTypeassociationsEndpoint import ( CompanyCompaniesIdTypeassociationsEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdUsagesEndpoint import ( - CompanyCompaniesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdUsagesEndpoint import CompanyCompaniesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Company from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdEndpoint( ConnectWiseEndpoint, IGettable[Company, ConnectWiseManageRequestParams], - IPuttable[Company, ConnectWiseManageRequestParams], IPatchable[Company, ConnectWiseManageRequestParams], + IPuttable[Company, ConnectWiseManageRequestParams], IPaginateable[Company, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Company) - IPuttable.__init__(self, Company) IPatchable.__init__(self, Company) + IPuttable.__init__(self, Company) IPaginateable.__init__(self, Company) - self.management_summary_reports = self._register_child_endpoint( - CompanyCompaniesIdManagementsummaryreportsEndpoint( - client, parent_endpoint=self - ) + self.custom_status_notes = self._register_child_endpoint( + CompanyCompaniesIdCustomstatusnotesEndpoint(client, parent_endpoint=self) ) - self.sites = self._register_child_endpoint( - CompanyCompaniesIdSitesEndpoint(client, parent_endpoint=self) + self.groups = self._register_child_endpoint(CompanyCompaniesIdGroupsEndpoint(client, parent_endpoint=self)) + self.management_report_notifications = self._register_child_endpoint( + CompanyCompaniesIdManagementreportnotificationsEndpoint(client, parent_endpoint=self) ) - self.teams = self._register_child_endpoint( - CompanyCompaniesIdTeamsEndpoint(client, parent_endpoint=self) + self.management_report_setup = self._register_child_endpoint( + CompanyCompaniesIdManagementreportsetupEndpoint(client, parent_endpoint=self) ) + self.management_summary_reports = self._register_child_endpoint( + CompanyCompaniesIdManagementsummaryreportsEndpoint(client, parent_endpoint=self) + ) + self.merge = self._register_child_endpoint(CompanyCompaniesIdMergeEndpoint(client, parent_endpoint=self)) + self.notes = self._register_child_endpoint(CompanyCompaniesIdNotesEndpoint(client, parent_endpoint=self)) + self.sites = self._register_child_endpoint(CompanyCompaniesIdSitesEndpoint(client, parent_endpoint=self)) + self.surveys = self._register_child_endpoint(CompanyCompaniesIdSurveysEndpoint(client, parent_endpoint=self)) + self.teams = self._register_child_endpoint(CompanyCompaniesIdTeamsEndpoint(client, parent_endpoint=self)) + self.tracks = self._register_child_endpoint(CompanyCompaniesIdTracksEndpoint(client, parent_endpoint=self)) self.type_associations = self._register_child_endpoint( CompanyCompaniesIdTypeassociationsEndpoint(client, parent_endpoint=self) ) - self.management_report_setup = self._register_child_endpoint( - CompanyCompaniesIdManagementreportsetupEndpoint( - client, parent_endpoint=self - ) - ) - self.groups = self._register_child_endpoint( - CompanyCompaniesIdGroupsEndpoint(client, parent_endpoint=self) - ) - self.merge = self._register_child_endpoint( - CompanyCompaniesIdMergeEndpoint(client, parent_endpoint=self) - ) - self.usages = self._register_child_endpoint( - CompanyCompaniesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.management_report_notifications = self._register_child_endpoint( - CompanyCompaniesIdManagementreportnotificationsEndpoint( - client, parent_endpoint=self - ) - ) - self.surveys = self._register_child_endpoint( - CompanyCompaniesIdSurveysEndpoint(client, parent_endpoint=self) - ) - self.tracks = self._register_child_endpoint( - CompanyCompaniesIdTracksEndpoint(client, parent_endpoint=self) - ) - self.notes = self._register_child_endpoint( - CompanyCompaniesIdNotesEndpoint(client, parent_endpoint=self) - ) - self.custom_status_notes = self._register_child_endpoint( - CompanyCompaniesIdCustomstatusnotesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(CompanyCompaniesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Company]: """ Performs a GET request against the /company/companies/{id} endpoint and returns an initialized PaginatedResponse object. @@ -136,54 +89,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Company, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Company, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Company: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id} endpoint. + Performs a DELETE request against the /company/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Company: The parsed response data. """ - return self._parse_one( - Company, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Company: """ - Performs a DELETE request against the /company/companies/{id} endpoint. + Performs a GET request against the /company/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Company: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Company, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Company: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Company: """ - Performs a PUT request against the /company/companies/{id} endpoint. + Performs a PATCH request against the /company/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -191,17 +123,11 @@ def put( Returns: Company: The parsed response data. """ - return self._parse_one( - Company, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Company, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Company: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Company: """ - Performs a PATCH request against the /company/companies/{id} endpoint. + Performs a PUT request against the /company/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -209,6 +135,4 @@ def patch( Returns: Company: The parsed response data. """ - return self._parse_one( - Company, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Company, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsCountEndpoint.py index 6996e9d8a..c622e67f2 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdGroupsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdGroupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/groups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/groups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsEndpoint.py index 9911a9ffc..e41b26a0a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesIdGroupsCountEndpoint import ( - CompanyCompaniesIdGroupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdGroupsIdEndpoint import ( - CompanyCompaniesIdGroupsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdGroupsCountEndpoint import CompanyCompaniesIdGroupsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdGroupsIdEndpoint import CompanyCompaniesIdGroupsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyGroup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdGroupsEndpoint( @@ -24,36 +18,29 @@ class CompanyCompaniesIdGroupsEndpoint( IPostable[CompanyGroup, ConnectWiseManageRequestParams], IPaginateable[CompanyGroup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "groups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "groups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyGroup]) IPostable.__init__(self, CompanyGroup) IPaginateable.__init__(self, CompanyGroup) - self.count = self._register_child_endpoint( - CompanyCompaniesIdGroupsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesIdGroupsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesIdGroupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesIdGroupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdGroupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdGroupsIdEndpoint: The initialized CompanyCompaniesIdGroupsIdEndpoint object. """ child = CompanyCompaniesIdGroupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyGroup]: """ Performs a GET request against the /company/companies/{id}/groups endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyGroup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyGroup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CompanyGroup]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CompanyGroup]: """ Performs a GET request against the /company/companies/{id}/groups endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[CompanyGroup]: The parsed response data. """ - return self._parse_many( - CompanyGroup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CompanyGroup, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyGroup: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyGroup: """ Performs a POST request against the /company/companies/{id}/groups endpoint. @@ -111,6 +83,4 @@ def post( Returns: CompanyGroup: The parsed response data. """ - return self._parse_one( - CompanyGroup, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CompanyGroup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsIdEndpoint.py index eb05481cb..c47ffc4e2 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdGroupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyGroup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdGroupsIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyGroup, ConnectWiseManageRequestParams], - IPuttable[CompanyGroup, ConnectWiseManageRequestParams], IPatchable[CompanyGroup, ConnectWiseManageRequestParams], + IPuttable[CompanyGroup, ConnectWiseManageRequestParams], IPaginateable[CompanyGroup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyGroup) - IPuttable.__init__(self, CompanyGroup) IPatchable.__init__(self, CompanyGroup) + IPuttable.__init__(self, CompanyGroup) IPaginateable.__init__(self, CompanyGroup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyGroup]: """ Performs a GET request against the /company/companies/{id}/groups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyGroup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyGroup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyGroup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/groups/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyGroup: The parsed response data. """ - return self._parse_one( - CompanyGroup, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyGroup: """ - Performs a DELETE request against the /company/companies/{id}/groups/{id} endpoint. + Performs a GET request against the /company/companies/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyGroup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyGroup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyGroup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyGroup: """ - Performs a PUT request against the /company/companies/{id}/groups/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: CompanyGroup: The parsed response data. """ - return self._parse_one( - CompanyGroup, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CompanyGroup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyGroup: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyGroup: """ - Performs a PATCH request against the /company/companies/{id}/groups/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: CompanyGroup: The parsed response data. """ - return self._parse_one( - CompanyGroup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyGroup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsCountEndpoint.py index 3d13a2a2c..b6cb9e26b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementreportnotificationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdManagementreportnotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/managementReportNotifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/managementReportNotifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsEndpoint.py index 9dcbbffc1..3e929bfd9 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdManagementreportnotificationsCountEndpoint import ( CompanyCompaniesIdManagementreportnotificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyCompaniesIdManagementreportnotificationsIdEndpoint import ( CompanyCompaniesIdManagementreportnotificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagementReportNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementreportnotificationsEndpoint( @@ -24,45 +22,31 @@ class CompanyCompaniesIdManagementreportnotificationsEndpoint( IPostable[ManagementReportNotification, ConnectWiseManageRequestParams], IPaginateable[ManagementReportNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, - client, - "managementReportNotifications", - parent_endpoint=parent_endpoint, - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementReportNotifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementReportNotification]) IPostable.__init__(self, ManagementReportNotification) IPaginateable.__init__(self, ManagementReportNotification) self.count = self._register_child_endpoint( - CompanyCompaniesIdManagementreportnotificationsCountEndpoint( - client, parent_endpoint=self - ) + CompanyCompaniesIdManagementreportnotificationsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyCompaniesIdManagementreportnotificationsIdEndpoint: + def id(self, _id: int) -> CompanyCompaniesIdManagementreportnotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdManagementreportnotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdManagementreportnotificationsIdEndpoint: The initialized CompanyCompaniesIdManagementreportnotificationsIdEndpoint object. """ - child = CompanyCompaniesIdManagementreportnotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyCompaniesIdManagementreportnotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementReportNotification]: """ Performs a GET request against the /company/companies/{id}/managementReportNotifications endpoint and returns an initialized PaginatedResponse object. @@ -80,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementReportNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementReportNotification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementReportNotification]: """ Performs a GET request against the /company/companies/{id}/managementReportNotifications endpoint. @@ -103,14 +80,11 @@ def get( list[ManagementReportNotification]: The parsed response data. """ return self._parse_many( - ManagementReportNotification, - super()._make_request("GET", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportNotification: """ Performs a POST request against the /company/companies/{id}/managementReportNotifications endpoint. @@ -122,6 +96,5 @@ def post( ManagementReportNotification: The parsed response data. """ return self._parse_one( - ManagementReportNotification, - super()._make_request("POST", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsIdEndpoint.py index 19bde9171..4bebcbecf 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportnotificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagementReportNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementreportnotificationsIdEndpoint( ConnectWiseEndpoint, IGettable[ManagementReportNotification, ConnectWiseManageRequestParams], - IPuttable[ManagementReportNotification, ConnectWiseManageRequestParams], IPatchable[ManagementReportNotification, ConnectWiseManageRequestParams], + IPuttable[ManagementReportNotification, ConnectWiseManageRequestParams], IPaginateable[ManagementReportNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManagementReportNotification) - IPuttable.__init__(self, ManagementReportNotification) IPatchable.__init__(self, ManagementReportNotification) + IPuttable.__init__(self, ManagementReportNotification) IPaginateable.__init__(self, ManagementReportNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementReportNotification]: """ Performs a GET request against the /company/companies/{id}/managementReportNotifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementReportNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementReportNotification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementReportNotification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ManagementReportNotification: The parsed response data. """ - return self._parse_one( - ManagementReportNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ManagementReportNotification: """ - Performs a DELETE request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. + Performs a GET request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ManagementReportNotification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + ManagementReportNotification, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportNotification: """ - Performs a PUT request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( ManagementReportNotification: The parsed response data. """ return self._parse_one( - ManagementReportNotification, - super()._make_request("PUT", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportNotification: """ - Performs a PATCH request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( ManagementReportNotification: The parsed response data. """ return self._parse_one( - ManagementReportNotification, - super()._make_request("PATCH", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupEndpoint.py index 432497f65..8f42a5426 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupEndpoint.py @@ -1,18 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdManagementreportsetupIdEndpoint import ( CompanyCompaniesIdManagementreportsetupIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagementReportSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementreportsetupEndpoint( @@ -21,36 +19,27 @@ class CompanyCompaniesIdManagementreportsetupEndpoint( IPostable[ManagementReportSetup, ConnectWiseManageRequestParams], IPaginateable[ManagementReportSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managementReportSetup", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementReportSetup", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementReportSetup]) IPostable.__init__(self, ManagementReportSetup) IPaginateable.__init__(self, ManagementReportSetup) - def id( - self, id: int # noqa: A002 - ) -> CompanyCompaniesIdManagementreportsetupIdEndpoint: + def id(self, _id: int) -> CompanyCompaniesIdManagementreportsetupIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdManagementreportsetupIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdManagementreportsetupIdEndpoint: The initialized CompanyCompaniesIdManagementreportsetupIdEndpoint object. """ - child = CompanyCompaniesIdManagementreportsetupIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyCompaniesIdManagementreportsetupIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementReportSetup]: """ Performs a GET request against the /company/companies/{id}/managementReportSetup endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +57,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementReportSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementReportSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementReportSetup]: """ Performs a GET request against the /company/companies/{id}/managementReportSetup endpoint. @@ -90,15 +72,10 @@ def get( Returns: list[ManagementReportSetup]: The parsed response data. """ - return self._parse_many( - ManagementReportSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ManagementReportSetup, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportSetup: """ Performs a POST request against the /company/companies/{id}/managementReportSetup endpoint. @@ -109,7 +86,4 @@ def post( Returns: ManagementReportSetup: The parsed response data. """ - return self._parse_one( - ManagementReportSetup, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ManagementReportSetup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupIdEndpoint.py index 61086438f..3af8d6c96 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementreportsetupIdEndpoint.py @@ -1,35 +1,29 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IPatchable, IPuttable from pyconnectwise.models.manage import ManagementReportSetup -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementreportsetupIdEndpoint( ConnectWiseEndpoint, - IPuttable[ManagementReportSetup, ConnectWiseManageRequestParams], IPatchable[ManagementReportSetup, ConnectWiseManageRequestParams], + IPuttable[ManagementReportSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - IPuttable.__init__(self, ManagementReportSetup) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPatchable.__init__(self, ManagementReportSetup) + IPuttable.__init__(self, ManagementReportSetup) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportSetup: """ - Performs a PUT request against the /company/companies/{id}/managementReportSetup/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/managementReportSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -37,18 +31,13 @@ def put( Returns: ManagementReportSetup: The parsed response data. """ - return self._parse_one( - ManagementReportSetup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ManagementReportSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportSetup: """ - Performs a PATCH request against the /company/companies/{id}/managementReportSetup/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/managementReportSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -56,7 +45,4 @@ def patch( Returns: ManagementReportSetup: The parsed response data. """ - return self._parse_one( - ManagementReportSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ManagementReportSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsCountEndpoint.py index cb514e514..7b638d741 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementsummaryreportsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdManagementsummaryreportsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/managementSummaryReports/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/managementSummaryReports/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsEndpoint.py index 4a8d47e7d..ad1b1c782 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdManagementsummaryreportsCountEndpoint import ( CompanyCompaniesIdManagementsummaryreportsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyCompaniesIdManagementsummaryreportsIdEndpoint import ( CompanyCompaniesIdManagementsummaryreportsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyManagementSummary from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementsummaryreportsEndpoint( @@ -24,42 +22,31 @@ class CompanyCompaniesIdManagementsummaryreportsEndpoint( IPostable[CompanyManagementSummary, ConnectWiseManageRequestParams], IPaginateable[CompanyManagementSummary, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managementSummaryReports", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementSummaryReports", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyManagementSummary]) IPostable.__init__(self, CompanyManagementSummary) IPaginateable.__init__(self, CompanyManagementSummary) self.count = self._register_child_endpoint( - CompanyCompaniesIdManagementsummaryreportsCountEndpoint( - client, parent_endpoint=self - ) + CompanyCompaniesIdManagementsummaryreportsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyCompaniesIdManagementsummaryreportsIdEndpoint: + def id(self, _id: int) -> CompanyCompaniesIdManagementsummaryreportsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdManagementsummaryreportsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdManagementsummaryreportsIdEndpoint: The initialized CompanyCompaniesIdManagementsummaryreportsIdEndpoint object. """ - child = CompanyCompaniesIdManagementsummaryreportsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyCompaniesIdManagementsummaryreportsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyManagementSummary]: """ Performs a GET request against the /company/companies/{id}/managementSummaryReports endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyManagementSummary, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyManagementSummary, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyManagementSummary]: """ Performs a GET request against the /company/companies/{id}/managementSummaryReports endpoint. @@ -99,15 +79,10 @@ def get( Returns: list[CompanyManagementSummary]: The parsed response data. """ - return self._parse_many( - CompanyManagementSummary, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CompanyManagementSummary, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyManagementSummary: """ Performs a POST request against the /company/companies/{id}/managementSummaryReports endpoint. @@ -118,7 +93,4 @@ def post( Returns: CompanyManagementSummary: The parsed response data. """ - return self._parse_one( - CompanyManagementSummary, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CompanyManagementSummary, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsIdEndpoint.py index 5e04b1141..42e9b7499 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdManagementsummaryreportsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyManagementSummary from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdManagementsummaryreportsIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyManagementSummary, ConnectWiseManageRequestParams], - IPuttable[CompanyManagementSummary, ConnectWiseManageRequestParams], IPatchable[CompanyManagementSummary, ConnectWiseManageRequestParams], + IPuttable[CompanyManagementSummary, ConnectWiseManageRequestParams], IPaginateable[CompanyManagementSummary, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyManagementSummary) - IPuttable.__init__(self, CompanyManagementSummary) IPatchable.__init__(self, CompanyManagementSummary) + IPuttable.__init__(self, CompanyManagementSummary) IPaginateable.__init__(self, CompanyManagementSummary) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyManagementSummary]: """ Performs a GET request against the /company/companies/{id}/managementSummaryReports/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyManagementSummary, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyManagementSummary, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyManagementSummary: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyManagementSummary: The parsed response data. """ - return self._parse_one( - CompanyManagementSummary, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CompanyManagementSummary: """ - Performs a DELETE request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. + Performs a GET request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyManagementSummary: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyManagementSummary, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> CompanyManagementSummary: """ - Performs a PUT request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +83,14 @@ def put( CompanyManagementSummary: The parsed response data. """ return self._parse_one( - CompanyManagementSummary, - super()._make_request("PUT", data=data, params=params).json(), + CompanyManagementSummary, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyManagementSummary: """ - Performs a PATCH request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/managementSummaryReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +98,4 @@ def patch( Returns: CompanyManagementSummary: The parsed response data. """ - return self._parse_one( - CompanyManagementSummary, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyManagementSummary, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdMergeEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdMergeEndpoint.py index 61842ae4b..52babf214 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdMergeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdMergeEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class CompanyCompaniesIdMergeEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "merge", parent_endpoint=parent_endpoint - ) +class CompanyCompaniesIdMergeEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "merge", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /company/companies/{id}/merge endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesCountEndpoint.py index 43cc67f17..b009b949a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdNotesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdNotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/notes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/notes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesEndpoint.py index ffa90cc04..17cc9b52e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesIdNotesCountEndpoint import ( - CompanyCompaniesIdNotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdNotesIdEndpoint import ( - CompanyCompaniesIdNotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdNotesCountEndpoint import CompanyCompaniesIdNotesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdNotesIdEndpoint import CompanyCompaniesIdNotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdNotesEndpoint( @@ -24,36 +18,29 @@ class CompanyCompaniesIdNotesEndpoint( IPostable[CompanyNote, ConnectWiseManageRequestParams], IPaginateable[CompanyNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyNote]) IPostable.__init__(self, CompanyNote) IPaginateable.__init__(self, CompanyNote) - self.count = self._register_child_endpoint( - CompanyCompaniesIdNotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesIdNotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesIdNotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesIdNotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdNotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdNotesIdEndpoint: The initialized CompanyCompaniesIdNotesIdEndpoint object. """ child = CompanyCompaniesIdNotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyNote]: """ Performs a GET request against the /company/companies/{id}/notes endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CompanyNote]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CompanyNote]: """ Performs a GET request against the /company/companies/{id}/notes endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[CompanyNote]: The parsed response data. """ - return self._parse_many( - CompanyNote, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CompanyNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyNote: """ Performs a POST request against the /company/companies/{id}/notes endpoint. @@ -111,6 +83,4 @@ def post( Returns: CompanyNote: The parsed response data. """ - return self._parse_one( - CompanyNote, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CompanyNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesIdEndpoint.py index aefdbb6df..7c80f77b3 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdNotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdNotesIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyNote, ConnectWiseManageRequestParams], - IPuttable[CompanyNote, ConnectWiseManageRequestParams], IPatchable[CompanyNote, ConnectWiseManageRequestParams], + IPuttable[CompanyNote, ConnectWiseManageRequestParams], IPaginateable[CompanyNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyNote) - IPuttable.__init__(self, CompanyNote) IPatchable.__init__(self, CompanyNote) + IPuttable.__init__(self, CompanyNote) IPaginateable.__init__(self, CompanyNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyNote]: """ Performs a GET request against the /company/companies/{id}/notes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/notes/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyNote: The parsed response data. """ - return self._parse_one( - CompanyNote, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyNote: """ - Performs a DELETE request against the /company/companies/{id}/notes/{id} endpoint. + Performs a GET request against the /company/companies/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyNote: """ - Performs a PUT request against the /company/companies/{id}/notes/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: CompanyNote: The parsed response data. """ - return self._parse_one( - CompanyNote, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CompanyNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyNote: """ - Performs a PATCH request against the /company/companies/{id}/notes/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: CompanyNote: The parsed response data. """ - return self._parse_one( - CompanyNote, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(CompanyNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesCountEndpoint.py index 0cd569bab..9446b6a83 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdSitesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdSitesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/sites/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/sites/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesEndpoint.py index e2cb88a2b..66514b4cc 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesCountEndpoint import ( - CompanyCompaniesIdSitesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesIdEndpoint import ( - CompanyCompaniesIdSitesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesCountEndpoint import CompanyCompaniesIdSitesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesIdEndpoint import CompanyCompaniesIdSitesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanySite from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdSitesEndpoint( @@ -24,36 +18,29 @@ class CompanyCompaniesIdSitesEndpoint( IPostable[CompanySite, ConnectWiseManageRequestParams], IPaginateable[CompanySite, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "sites", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "sites", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanySite]) IPostable.__init__(self, CompanySite) IPaginateable.__init__(self, CompanySite) - self.count = self._register_child_endpoint( - CompanyCompaniesIdSitesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesIdSitesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesIdSitesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesIdSitesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdSitesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdSitesIdEndpoint: The initialized CompanyCompaniesIdSitesIdEndpoint object. """ child = CompanyCompaniesIdSitesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanySite]: """ Performs a GET request against the /company/companies/{id}/sites endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanySite, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanySite, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CompanySite]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CompanySite]: """ Performs a GET request against the /company/companies/{id}/sites endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[CompanySite]: The parsed response data. """ - return self._parse_many( - CompanySite, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CompanySite, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanySite: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanySite: """ Performs a POST request against the /company/companies/{id}/sites endpoint. @@ -111,6 +83,4 @@ def post( Returns: CompanySite: The parsed response data. """ - return self._parse_one( - CompanySite, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CompanySite, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdEndpoint.py index 4683944f4..e1085a3d0 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesIdUsagesEndpoint import ( CompanyCompaniesIdSitesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanySite from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdSitesIdEndpoint( ConnectWiseEndpoint, IGettable[CompanySite, ConnectWiseManageRequestParams], - IPuttable[CompanySite, ConnectWiseManageRequestParams], IPatchable[CompanySite, ConnectWiseManageRequestParams], + IPuttable[CompanySite, ConnectWiseManageRequestParams], IPaginateable[CompanySite, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanySite) - IPuttable.__init__(self, CompanySite) IPatchable.__init__(self, CompanySite) + IPuttable.__init__(self, CompanySite) IPaginateable.__init__(self, CompanySite) self.usages = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanySite]: """ Performs a GET request against the /company/companies/{id}/sites/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanySite, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanySite, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanySite: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/sites/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanySite: The parsed response data. """ - return self._parse_one( - CompanySite, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanySite: """ - Performs a DELETE request against the /company/companies/{id}/sites/{id} endpoint. + Performs a GET request against the /company/companies/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanySite: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanySite, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanySite: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanySite: """ - Performs a PUT request against the /company/companies/{id}/sites/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +85,11 @@ def put( Returns: CompanySite: The parsed response data. """ - return self._parse_one( - CompanySite, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CompanySite, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanySite: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanySite: """ - Performs a PATCH request against the /company/companies/{id}/sites/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +97,4 @@ def patch( Returns: CompanySite: The parsed response data. """ - return self._parse_one( - CompanySite, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(CompanySite, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesEndpoint.py index b42b08c1c..2cd375864 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdSitesIdUsagesListEndpoint import ( CompanyCompaniesIdSitesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdSitesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class CompanyCompaniesIdSitesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/{id}/sites/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/{id}/sites/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesListEndpoint.py index 0fa85a01f..17ffa57bc 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSitesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdSitesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdSitesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/{id}/sites/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/{id}/sites/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysCountEndpoint.py index f62412213..f625e8cf1 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdSurveysCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdSurveysCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/surveys/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/surveys/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysEndpoint.py index dac9b2a93..55391c5ae 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdSurveysEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesIdSurveysCountEndpoint import ( - CompanyCompaniesIdSurveysCountEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdSurveysCountEndpoint import CompanyCompaniesIdSurveysCountEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdSurveysEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "surveys", parent_endpoint=parent_endpoint - ) - - self.count = self._register_child_endpoint( - CompanyCompaniesIdSurveysCountEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "surveys", parent_endpoint=parent_endpoint) + + self.count = self._register_child_endpoint(CompanyCompaniesIdSurveysCountEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsCountEndpoint.py index 4b304e310..9fc5d065a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTeamsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdTeamsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/teams/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/teams/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsEndpoint.py index d1f0a0112..fd4ea9d75 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesIdTeamsCountEndpoint import ( - CompanyCompaniesIdTeamsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdTeamsIdEndpoint import ( - CompanyCompaniesIdTeamsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdTeamsCountEndpoint import CompanyCompaniesIdTeamsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdTeamsIdEndpoint import CompanyCompaniesIdTeamsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTeamsEndpoint( @@ -24,36 +18,29 @@ class CompanyCompaniesIdTeamsEndpoint( IPostable[CompanyTeam, ConnectWiseManageRequestParams], IPaginateable[CompanyTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "teams", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "teams", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyTeam]) IPostable.__init__(self, CompanyTeam) IPaginateable.__init__(self, CompanyTeam) - self.count = self._register_child_endpoint( - CompanyCompaniesIdTeamsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesIdTeamsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesIdTeamsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesIdTeamsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdTeamsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdTeamsIdEndpoint: The initialized CompanyCompaniesIdTeamsIdEndpoint object. """ child = CompanyCompaniesIdTeamsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyTeam]: """ Performs a GET request against the /company/companies/{id}/teams endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyTeam, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyTeam, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CompanyTeam]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CompanyTeam]: """ Performs a GET request against the /company/companies/{id}/teams endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[CompanyTeam]: The parsed response data. """ - return self._parse_many( - CompanyTeam, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CompanyTeam, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyTeam: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyTeam: """ Performs a POST request against the /company/companies/{id}/teams endpoint. @@ -111,6 +83,4 @@ def post( Returns: CompanyTeam: The parsed response data. """ - return self._parse_one( - CompanyTeam, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CompanyTeam, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsIdEndpoint.py index b56b22218..a87d0301b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTeamsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTeamsIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyTeam, ConnectWiseManageRequestParams], - IPuttable[CompanyTeam, ConnectWiseManageRequestParams], IPatchable[CompanyTeam, ConnectWiseManageRequestParams], + IPuttable[CompanyTeam, ConnectWiseManageRequestParams], IPaginateable[CompanyTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyTeam) - IPuttable.__init__(self, CompanyTeam) IPatchable.__init__(self, CompanyTeam) + IPuttable.__init__(self, CompanyTeam) IPaginateable.__init__(self, CompanyTeam) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyTeam]: """ Performs a GET request against the /company/companies/{id}/teams/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyTeam, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyTeam, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyTeam: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/teams/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyTeam: The parsed response data. """ - return self._parse_one( - CompanyTeam, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyTeam: """ - Performs a DELETE request against the /company/companies/{id}/teams/{id} endpoint. + Performs a GET request against the /company/companies/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyTeam: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyTeam, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyTeam: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyTeam: """ - Performs a PUT request against the /company/companies/{id}/teams/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: CompanyTeam: The parsed response data. """ - return self._parse_one( - CompanyTeam, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CompanyTeam, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyTeam: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyTeam: """ - Performs a PATCH request against the /company/companies/{id}/teams/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: CompanyTeam: The parsed response data. """ - return self._parse_one( - CompanyTeam, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(CompanyTeam, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksCountEndpoint.py index 5472a7cd8..11bec49b8 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTracksCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdTracksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/tracks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/tracks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksEndpoint.py index 97bcd50ad..c358db6a5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesIdTracksCountEndpoint import ( - CompanyCompaniesIdTracksCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesIdTracksIdEndpoint import ( - CompanyCompaniesIdTracksIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdTracksCountEndpoint import CompanyCompaniesIdTracksCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesIdTracksIdEndpoint import CompanyCompaniesIdTracksIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactTrack from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTracksEndpoint( @@ -24,36 +18,29 @@ class CompanyCompaniesIdTracksEndpoint( IPostable[ContactTrack, ConnectWiseManageRequestParams], IPaginateable[ContactTrack, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tracks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tracks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactTrack]) IPostable.__init__(self, ContactTrack) IPaginateable.__init__(self, ContactTrack) - self.count = self._register_child_endpoint( - CompanyCompaniesIdTracksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesIdTracksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesIdTracksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesIdTracksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdTracksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdTracksIdEndpoint: The initialized CompanyCompaniesIdTracksIdEndpoint object. """ child = CompanyCompaniesIdTracksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactTrack]: """ Performs a GET request against the /company/companies/{id}/tracks endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactTrack, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactTrack, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ContactTrack]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ContactTrack]: """ Performs a GET request against the /company/companies/{id}/tracks endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ContactTrack]: The parsed response data. """ - return self._parse_many( - ContactTrack, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ContactTrack, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactTrack: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactTrack: """ Performs a POST request against the /company/companies/{id}/tracks endpoint. @@ -111,6 +83,4 @@ def post( Returns: ContactTrack: The parsed response data. """ - return self._parse_one( - ContactTrack, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ContactTrack, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksIdEndpoint.py index bcc53b739..47e6a0e12 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTracksIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ContactTrack from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTracksIdEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdTracksIdEndpoint( IGettable[ContactTrack, ConnectWiseManageRequestParams], IPaginateable[ContactTrack, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactTrack) IPaginateable.__init__(self, ContactTrack) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactTrack]: """ Performs a GET request against the /company/companies/{id}/tracks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,42 +39,27 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactTrack, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactTrack, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactTrack: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/{id}/tracks/{id} endpoint. + Performs a DELETE request against the /company/companies/{id}/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactTrack: The parsed response data. """ - return self._parse_one( - ContactTrack, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactTrack: """ - Performs a DELETE request against the /company/companies/{id}/tracks/{id} endpoint. + Performs a GET request against the /company/companies/{id}/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactTrack: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactTrack, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsCountEndpoint.py index 67086355d..7d88f4d1f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTypeassociationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdTypeassociationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/{id}/typeAssociations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/{id}/typeAssociations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsEndpoint.py index a4af87490..4ec48a067 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesIdTypeassociationsCountEndpoint import ( CompanyCompaniesIdTypeassociationsCountEndpoint, @@ -5,74 +7,46 @@ from pyconnectwise.endpoints.manage.CompanyCompaniesIdTypeassociationsIdEndpoint import ( CompanyCompaniesIdTypeassociationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) -from pyconnectwise.models.manage import ( - CompanyCompanyTypeAssociationCompanyTypeAssociation, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable +from pyconnectwise.models.manage import CompanyCompanyTypeAssociationCompanyTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTypeassociationsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[CompanyCompanyTypeAssociationCompanyTypeAssociation], - ConnectWiseManageRequestParams, - ], - IPostable[ - CompanyCompanyTypeAssociationCompanyTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPaginateable[ - CompanyCompanyTypeAssociationCompanyTypeAssociation, - ConnectWiseManageRequestParams, - ], + IGettable[list[CompanyCompanyTypeAssociationCompanyTypeAssociation], ConnectWiseManageRequestParams], + IPostable[CompanyCompanyTypeAssociationCompanyTypeAssociation, ConnectWiseManageRequestParams], + IPaginateable[CompanyCompanyTypeAssociationCompanyTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "typeAssociations", parent_endpoint=parent_endpoint - ) - IGettable.__init__( - self, list[CompanyCompanyTypeAssociationCompanyTypeAssociation] - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "typeAssociations", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[CompanyCompanyTypeAssociationCompanyTypeAssociation]) IPostable.__init__(self, CompanyCompanyTypeAssociationCompanyTypeAssociation) - IPaginateable.__init__( - self, CompanyCompanyTypeAssociationCompanyTypeAssociation - ) + IPaginateable.__init__(self, CompanyCompanyTypeAssociationCompanyTypeAssociation) self.count = self._register_child_endpoint( - CompanyCompaniesIdTypeassociationsCountEndpoint( - client, parent_endpoint=self - ) + CompanyCompaniesIdTypeassociationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyCompaniesIdTypeassociationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesIdTypeassociationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesIdTypeassociationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesIdTypeassociationsIdEndpoint: The initialized CompanyCompaniesIdTypeassociationsIdEndpoint object. """ - child = CompanyCompaniesIdTypeassociationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyCompaniesIdTypeassociationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyCompanyTypeAssociationCompanyTypeAssociation]: """ Performs a GET request against the /company/companies/{id}/typeAssociations endpoint and returns an initialized PaginatedResponse object. @@ -99,9 +73,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyCompanyTypeAssociationCompanyTypeAssociation]: """ Performs a GET request against the /company/companies/{id}/typeAssociations endpoint. @@ -118,9 +90,7 @@ def get( ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyCompanyTypeAssociationCompanyTypeAssociation: """ Performs a POST request against the /company/companies/{id}/typeAssociations endpoint. diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsIdEndpoint.py index f98b362b0..25acac4a4 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdTypeassociationsIdEndpoint.py @@ -1,56 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) -from pyconnectwise.models.manage import ( - CompanyCompanyTypeAssociationCompanyTypeAssociation, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable +from pyconnectwise.models.manage import CompanyCompanyTypeAssociationCompanyTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdTypeassociationsIdEndpoint( ConnectWiseEndpoint, - IGettable[ - CompanyCompanyTypeAssociationCompanyTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPuttable[ - CompanyCompanyTypeAssociationCompanyTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPatchable[ - CompanyCompanyTypeAssociationCompanyTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPaginateable[ - CompanyCompanyTypeAssociationCompanyTypeAssociation, - ConnectWiseManageRequestParams, - ], + IGettable[CompanyCompanyTypeAssociationCompanyTypeAssociation, ConnectWiseManageRequestParams], + IPatchable[CompanyCompanyTypeAssociationCompanyTypeAssociation, ConnectWiseManageRequestParams], + IPuttable[CompanyCompanyTypeAssociationCompanyTypeAssociation, ConnectWiseManageRequestParams], + IPaginateable[CompanyCompanyTypeAssociationCompanyTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyCompanyTypeAssociationCompanyTypeAssociation) - IPuttable.__init__(self, CompanyCompanyTypeAssociationCompanyTypeAssociation) IPatchable.__init__(self, CompanyCompanyTypeAssociationCompanyTypeAssociation) - IPaginateable.__init__( - self, CompanyCompanyTypeAssociationCompanyTypeAssociation - ) + IPuttable.__init__(self, CompanyCompanyTypeAssociationCompanyTypeAssociation) + IPaginateable.__init__(self, CompanyCompanyTypeAssociationCompanyTypeAssociation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyCompanyTypeAssociationCompanyTypeAssociation]: """ Performs a GET request against the /company/companies/{id}/typeAssociations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -76,10 +51,18 @@ def paginated( params, ) + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: + """ + Performs a DELETE request against the /company/companies/{id}/typeAssociations/{id} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + """ + super()._make_request("DELETE", data=data, params=params) + def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyCompanyTypeAssociationCompanyTypeAssociation: """ Performs a GET request against the /company/companies/{id}/typeAssociations/{id} endpoint. @@ -95,27 +78,11 @@ def get( super()._make_request("GET", data=data, params=params).json(), ) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: - """ - Performs a DELETE request against the /company/companies/{id}/typeAssociations/{id} endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - """ - super()._make_request("DELETE", data=data, params=params) - - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> CompanyCompanyTypeAssociationCompanyTypeAssociation: """ - Performs a PUT request against the /company/companies/{id}/typeAssociations/{id} endpoint. + Performs a PATCH request against the /company/companies/{id}/typeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,16 +92,14 @@ def put( """ return self._parse_one( CompanyCompanyTypeAssociationCompanyTypeAssociation, - super()._make_request("PUT", data=data, params=params).json(), + super()._make_request("PATCH", data=data, params=params).json(), ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyCompanyTypeAssociationCompanyTypeAssociation: """ - Performs a PATCH request against the /company/companies/{id}/typeAssociations/{id} endpoint. + Performs a PUT request against the /company/companies/{id}/typeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -144,5 +109,5 @@ def patch( """ return self._parse_one( CompanyCompanyTypeAssociationCompanyTypeAssociation, - super()._make_request("PATCH", data=data, params=params).json(), + super()._make_request("PUT", data=data, params=params).json(), ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesEndpoint.py index e92d1af35..ffc649aff 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesIdUsagesListEndpoint import ( - CompanyCompaniesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesIdUsagesListEndpoint import CompanyCompaniesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class CompanyCompaniesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - CompanyCompaniesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(CompanyCompaniesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesListEndpoint.py index 31c47e30f..c26945979 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoEndpoint.py index bb411f3dd..71eb8c372 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesInfoTypesEndpoint import ( - CompanyCompaniesInfoTypesEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesInfoTypesEndpoint import CompanyCompaniesInfoTypesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - - self.types = self._register_child_endpoint( - CompanyCompaniesInfoTypesEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + + self.types = self._register_child_endpoint(CompanyCompaniesInfoTypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesCountEndpoint.py index e1825bf96..cc6567edb 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesInfoTypesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesInfoTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/info/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/info/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesEndpoint.py index 866a0ac75..dd897cc6f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesInfoTypesCountEndpoint import ( - CompanyCompaniesInfoTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesInfoTypesIdEndpoint import ( - CompanyCompaniesInfoTypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesInfoTypesCountEndpoint import CompanyCompaniesInfoTypesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesInfoTypesIdEndpoint import CompanyCompaniesInfoTypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CompanyTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesInfoTypesEndpoint( @@ -22,35 +17,28 @@ class CompanyCompaniesInfoTypesEndpoint( IGettable[list[CompanyTypeInfo], ConnectWiseManageRequestParams], IPaginateable[CompanyTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyTypeInfo]) IPaginateable.__init__(self, CompanyTypeInfo) - self.count = self._register_child_endpoint( - CompanyCompaniesInfoTypesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesInfoTypesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesInfoTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesInfoTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesInfoTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesInfoTypesIdEndpoint: The initialized CompanyCompaniesInfoTypesIdEndpoint object. """ child = CompanyCompaniesInfoTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyTypeInfo]: """ Performs a GET request against the /company/companies/info/types endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyTypeInfo]: """ Performs a GET request against the /company/companies/info/types endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[CompanyTypeInfo]: The parsed response data. """ - return self._parse_many( - CompanyTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CompanyTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesIdEndpoint.py index db235e1da..f98e81990 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesInfoTypesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CompanyTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesInfoTypesIdEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesInfoTypesIdEndpoint( IGettable[CompanyTypeInfo, ConnectWiseManageRequestParams], IPaginateable[CompanyTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyTypeInfo) IPaginateable.__init__(self, CompanyTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyTypeInfo]: """ Performs a GET request against the /company/companies/info/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyTypeInfo: """ Performs a GET request against the /company/companies/info/types/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: CompanyTypeInfo: The parsed response data. """ - return self._parse_one( - CompanyTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CompanyTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesCountEndpoint.py index 7266cf9ec..aa932ae52 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesStatusesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesEndpoint.py index b719de3a6..e3df05f5d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesCountEndpoint import ( - CompanyCompaniesStatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesIdEndpoint import ( - CompanyCompaniesStatusesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesCountEndpoint import CompanyCompaniesStatusesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesIdEndpoint import CompanyCompaniesStatusesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesStatusesEndpoint( @@ -24,36 +18,29 @@ class CompanyCompaniesStatusesEndpoint( IPostable[CompanyStatus, ConnectWiseManageRequestParams], IPaginateable[CompanyStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyStatus]) IPostable.__init__(self, CompanyStatus) IPaginateable.__init__(self, CompanyStatus) - self.count = self._register_child_endpoint( - CompanyCompaniesStatusesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesStatusesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesStatusesIdEndpoint: The initialized CompanyCompaniesStatusesIdEndpoint object. """ child = CompanyCompaniesStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyStatus]: """ Performs a GET request against the /company/companies/statuses endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyStatus]: """ Performs a GET request against the /company/companies/statuses endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[CompanyStatus]: The parsed response data. """ - return self._parse_many( - CompanyStatus, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CompanyStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyStatus: """ Performs a POST request against the /company/companies/statuses endpoint. @@ -111,7 +85,4 @@ def post( Returns: CompanyStatus: The parsed response data. """ - return self._parse_one( - CompanyStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CompanyStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdEndpoint.py index ba6fdf3e3..b47fcda82 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesIdUsagesEndpoint import ( CompanyCompaniesStatusesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyStatus, ConnectWiseManageRequestParams], - IPuttable[CompanyStatus, ConnectWiseManageRequestParams], IPatchable[CompanyStatus, ConnectWiseManageRequestParams], + IPuttable[CompanyStatus, ConnectWiseManageRequestParams], IPaginateable[CompanyStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyStatus) - IPuttable.__init__(self, CompanyStatus) IPatchable.__init__(self, CompanyStatus) + IPuttable.__init__(self, CompanyStatus) IPaginateable.__init__(self, CompanyStatus) self.usages = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyStatus]: """ Performs a GET request against the /company/companies/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/statuses/{id} endpoint. + Performs a DELETE request against the /company/companies/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyStatus: The parsed response data. """ - return self._parse_one( - CompanyStatus, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyStatus: """ - Performs a DELETE request against the /company/companies/statuses/{id} endpoint. + Performs a GET request against the /company/companies/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyStatus: """ - Performs a PUT request against the /company/companies/statuses/{id} endpoint. + Performs a PATCH request against the /company/companies/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +85,11 @@ def put( Returns: CompanyStatus: The parsed response data. """ - return self._parse_one( - CompanyStatus, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CompanyStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyStatus: """ - Performs a PATCH request against the /company/companies/statuses/{id} endpoint. + Performs a PUT request against the /company/companies/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +97,4 @@ def patch( Returns: CompanyStatus: The parsed response data. """ - return self._parse_one( - CompanyStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesEndpoint.py index f67252454..ffa1573db 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesStatusesIdUsagesListEndpoint import ( CompanyCompaniesStatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesStatusesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class CompanyCompaniesStatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/statuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/statuses/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesListEndpoint.py index 783067430..1d851d24f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesStatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesStatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesStatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/statuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/statuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesCountEndpoint.py index 2b9ae34d8..69f394902 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesTypesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companies/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companies/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesEndpoint.py index dd1d9740d..19a58af94 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesTypesCountEndpoint import ( - CompanyCompaniesTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesTypesIdEndpoint import ( - CompanyCompaniesTypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesTypesCountEndpoint import CompanyCompaniesTypesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesTypesIdEndpoint import CompanyCompaniesTypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesTypesEndpoint( @@ -24,36 +18,29 @@ class CompanyCompaniesTypesEndpoint( IPostable[CompanyType, ConnectWiseManageRequestParams], IPaginateable[CompanyType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyType]) IPostable.__init__(self, CompanyType) IPaginateable.__init__(self, CompanyType) - self.count = self._register_child_endpoint( - CompanyCompaniesTypesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCompaniesTypesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompaniesTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompaniesTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompaniesTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompaniesTypesIdEndpoint: The initialized CompanyCompaniesTypesIdEndpoint object. """ child = CompanyCompaniesTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyType]: """ Performs a GET request against the /company/companies/types endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CompanyType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CompanyType]: """ Performs a GET request against the /company/companies/types endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[CompanyType]: The parsed response data. """ - return self._parse_many( - CompanyType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CompanyType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyType: """ Performs a POST request against the /company/companies/types endpoint. @@ -111,6 +83,4 @@ def post( Returns: CompanyType: The parsed response data. """ - return self._parse_one( - CompanyType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CompanyType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdEndpoint.py index 5a1038dfc..b9cc47226 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompaniesTypesIdUsagesEndpoint import ( - CompanyCompaniesTypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyCompaniesTypesIdUsagesEndpoint import CompanyCompaniesTypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesTypesIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyType, ConnectWiseManageRequestParams], - IPuttable[CompanyType, ConnectWiseManageRequestParams], IPatchable[CompanyType, ConnectWiseManageRequestParams], + IPuttable[CompanyType, ConnectWiseManageRequestParams], IPaginateable[CompanyType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyType) - IPuttable.__init__(self, CompanyType) IPatchable.__init__(self, CompanyType) + IPuttable.__init__(self, CompanyType) IPaginateable.__init__(self, CompanyType) - self.usages = self._register_child_endpoint( - CompanyCompaniesTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(CompanyCompaniesTypesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyType]: """ Performs a GET request against the /company/companies/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companies/types/{id} endpoint. + Performs a DELETE request against the /company/companies/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyType: The parsed response data. """ - return self._parse_one( - CompanyType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyType: """ - Performs a DELETE request against the /company/companies/types/{id} endpoint. + Performs a GET request against the /company/companies/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyType: """ - Performs a PUT request against the /company/companies/types/{id} endpoint. + Performs a PATCH request against the /company/companies/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: CompanyType: The parsed response data. """ - return self._parse_one( - CompanyType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CompanyType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyType: """ - Performs a PATCH request against the /company/companies/types/{id} endpoint. + Performs a PUT request against the /company/companies/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +93,4 @@ def patch( Returns: CompanyType: The parsed response data. """ - return self._parse_one( - CompanyType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(CompanyType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesEndpoint.py index cbd731380..fc60efc52 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompaniesTypesIdUsagesListEndpoint import ( CompanyCompaniesTypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesTypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class CompanyCompaniesTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/types/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesListEndpoint.py index d016ec1a7..b28163d84 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompaniesTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompaniesTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyCompaniesTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/companies/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/companies/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceEndpoint.py index 6166ac669..62ba9bc04 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompanyfinanceIdEndpoint import ( - CompanyCompanyfinanceIdEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyCompanyfinanceIdEndpoint import CompanyCompanyfinanceIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanyfinanceEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "companyFinance", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "companyFinance", parent_endpoint=parent_endpoint) - def id(self, id: int) -> CompanyCompanyfinanceIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompanyfinanceIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompanyfinanceIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompanyfinanceIdEndpoint: The initialized CompanyCompanyfinanceIdEndpoint object. """ child = CompanyCompanyfinanceIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceIdEndpoint.py index c5b938f55..4c918a2b9 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanyfinanceIdEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPuttable, -) +from pyconnectwise.interfaces import IPuttable from pyconnectwise.models.manage import CompanyFinance -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class CompanyCompanyfinanceIdEndpoint( - ConnectWiseEndpoint, IPuttable[CompanyFinance, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) +class CompanyCompanyfinanceIdEndpoint(ConnectWiseEndpoint, IPuttable[CompanyFinance, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPuttable.__init__(self, CompanyFinance) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyFinance: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyFinance: """ Performs a PUT request against the /company/companyFinance/{id} endpoint. @@ -32,7 +24,4 @@ def put( Returns: CompanyFinance: The parsed response data. """ - return self._parse_one( - CompanyFinance, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CompanyFinance, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsClearEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsClearEndpoint.py index 73823bed2..6f8829c3e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsClearEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsClearEndpoint.py @@ -1,27 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ClearPickerRequest -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanypickeritemsClearEndpoint( ConnectWiseEndpoint, IPostable[ClearPickerRequest, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "clear", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "clear", parent_endpoint=parent_endpoint) IPostable.__init__(self, ClearPickerRequest) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ClearPickerRequest: """ Performs a POST request against the /company/companyPickerItems/clear endpoint. @@ -32,7 +28,4 @@ def post( Returns: ClearPickerRequest: The parsed response data. """ - return self._parse_one( - ClearPickerRequest, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ClearPickerRequest, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsCountEndpoint.py index ed840b51a..fb0cccfa1 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanypickeritemsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompanypickeritemsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companyPickerItems/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companyPickerItems/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsEndpoint.py index 4dcb6e663..c35aeadaa 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsClearEndpoint import ( - CompanyCompanypickeritemsClearEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsCountEndpoint import ( - CompanyCompanypickeritemsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsIdEndpoint import ( - CompanyCompanypickeritemsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsClearEndpoint import CompanyCompanypickeritemsClearEndpoint +from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsCountEndpoint import CompanyCompanypickeritemsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsIdEndpoint import CompanyCompanypickeritemsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyPickerItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanypickeritemsEndpoint( @@ -27,39 +19,30 @@ class CompanyCompanypickeritemsEndpoint( IPostable[CompanyPickerItem, ConnectWiseManageRequestParams], IPaginateable[CompanyPickerItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "companyPickerItems", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "companyPickerItems", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyPickerItem]) IPostable.__init__(self, CompanyPickerItem) IPaginateable.__init__(self, CompanyPickerItem) - self.count = self._register_child_endpoint( - CompanyCompanypickeritemsCountEndpoint(client, parent_endpoint=self) - ) - self.clear = self._register_child_endpoint( - CompanyCompanypickeritemsClearEndpoint(client, parent_endpoint=self) - ) + self.clear = self._register_child_endpoint(CompanyCompanypickeritemsClearEndpoint(client, parent_endpoint=self)) + self.count = self._register_child_endpoint(CompanyCompanypickeritemsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCompanypickeritemsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompanypickeritemsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompanypickeritemsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompanypickeritemsIdEndpoint: The initialized CompanyCompanypickeritemsIdEndpoint object. """ child = CompanyCompanypickeritemsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyPickerItem]: """ Performs a GET request against the /company/companyPickerItems endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyPickerItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyPickerItem, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyPickerItem]: """ Performs a GET request against the /company/companyPickerItems endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[CompanyPickerItem]: The parsed response data. """ - return self._parse_many( - CompanyPickerItem, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CompanyPickerItem, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyPickerItem: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyPickerItem: """ Performs a POST request against the /company/companyPickerItems endpoint. @@ -118,7 +87,4 @@ def post( Returns: CompanyPickerItem: The parsed response data. """ - return self._parse_one( - CompanyPickerItem, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CompanyPickerItem, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsIdEndpoint.py index 4d77489ae..8acf7d194 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanypickeritemsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CompanyPickerItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanypickeritemsIdEndpoint( @@ -16,18 +15,13 @@ class CompanyCompanypickeritemsIdEndpoint( IGettable[CompanyPickerItem, ConnectWiseManageRequestParams], IPaginateable[CompanyPickerItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyPickerItem) IPaginateable.__init__(self, CompanyPickerItem) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyPickerItem]: """ Performs a GET request against the /company/companyPickerItems/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,27 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyPickerItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyPickerItem, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyPickerItem: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companyPickerItems/{id} endpoint. + Performs a DELETE request against the /company/companyPickerItems/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyPickerItem: The parsed response data. """ - return self._parse_one( - CompanyPickerItem, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyPickerItem: """ - Performs a DELETE request against the /company/companyPickerItems/{id} endpoint. + Performs a GET request against the /company/companyPickerItems/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyPickerItem: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyPickerItem, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsCountEndpoint.py index 30fb47fc5..c4c55b0b5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanytypeassociationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCompanytypeassociationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/companyTypeAssociations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/companyTypeAssociations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsEndpoint.py index e247fcc54..a5be173ac 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyCompanytypeassociationsCountEndpoint import ( CompanyCompanytypeassociationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyCompanytypeassociationsIdEndpoint import ( CompanyCompanytypeassociationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyCompanyTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanytypeassociationsEndpoint( @@ -24,10 +22,8 @@ class CompanyCompanytypeassociationsEndpoint( IPostable[CompanyCompanyTypeAssociation, ConnectWiseManageRequestParams], IPaginateable[CompanyCompanyTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "companyTypeAssociations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "companyTypeAssociations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyCompanyTypeAssociation]) IPostable.__init__(self, CompanyCompanyTypeAssociation) IPaginateable.__init__(self, CompanyCompanyTypeAssociation) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyCompanytypeassociationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyCompanytypeassociationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCompanytypeassociationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCompanytypeassociationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCompanytypeassociationsIdEndpoint: The initialized CompanyCompanytypeassociationsIdEndpoint object. """ - child = CompanyCompanytypeassociationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyCompanytypeassociationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyCompanyTypeAssociation]: """ Performs a GET request against the /company/companyTypeAssociations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyCompanyTypeAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyCompanyTypeAssociation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyCompanyTypeAssociation]: """ Performs a GET request against the /company/companyTypeAssociations endpoint. @@ -96,14 +80,11 @@ def get( list[CompanyCompanyTypeAssociation]: The parsed response data. """ return self._parse_many( - CompanyCompanyTypeAssociation, - super()._make_request("GET", data=data, params=params).json(), + CompanyCompanyTypeAssociation, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyCompanyTypeAssociation: """ Performs a POST request against the /company/companyTypeAssociations endpoint. @@ -115,6 +96,5 @@ def post( CompanyCompanyTypeAssociation: The parsed response data. """ return self._parse_one( - CompanyCompanyTypeAssociation, - super()._make_request("POST", data=data, params=params).json(), + CompanyCompanyTypeAssociation, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsIdEndpoint.py index f9c3268fe..8e1c58c9a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCompanytypeassociationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyCompanyTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCompanytypeassociationsIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyCompanyTypeAssociation, ConnectWiseManageRequestParams], - IPuttable[CompanyCompanyTypeAssociation, ConnectWiseManageRequestParams], IPatchable[CompanyCompanyTypeAssociation, ConnectWiseManageRequestParams], + IPuttable[CompanyCompanyTypeAssociation, ConnectWiseManageRequestParams], IPaginateable[CompanyCompanyTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyCompanyTypeAssociation) - IPuttable.__init__(self, CompanyCompanyTypeAssociation) IPatchable.__init__(self, CompanyCompanyTypeAssociation) + IPuttable.__init__(self, CompanyCompanyTypeAssociation) IPaginateable.__init__(self, CompanyCompanyTypeAssociation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyCompanyTypeAssociation]: """ Performs a GET request against the /company/companyTypeAssociations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyCompanyTypeAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyCompanyTypeAssociation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyCompanyTypeAssociation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/companyTypeAssociations/{id} endpoint. + Performs a DELETE request against the /company/companyTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyCompanyTypeAssociation: The parsed response data. """ - return self._parse_one( - CompanyCompanyTypeAssociation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CompanyCompanyTypeAssociation: """ - Performs a DELETE request against the /company/companyTypeAssociations/{id} endpoint. + Performs a GET request against the /company/companyTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyCompanyTypeAssociation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + CompanyCompanyTypeAssociation, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> CompanyCompanyTypeAssociation: """ - Performs a PUT request against the /company/companyTypeAssociations/{id} endpoint. + Performs a PATCH request against the /company/companyTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( CompanyCompanyTypeAssociation: The parsed response data. """ return self._parse_one( - CompanyCompanyTypeAssociation, - super()._make_request("PUT", data=data, params=params).json(), + CompanyCompanyTypeAssociation, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyCompanyTypeAssociation: """ - Performs a PATCH request against the /company/companyTypeAssociations/{id} endpoint. + Performs a PUT request against the /company/companyTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( CompanyCompanyTypeAssociation: The parsed response data. """ return self._parse_one( - CompanyCompanyTypeAssociation, - super()._make_request("PATCH", data=data, params=params).json(), + CompanyCompanyTypeAssociation, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsBulkEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsBulkEndpoint.py index e67e8658f..7d7cd7c4e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsBulkEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsBulkEndpoint.py @@ -1,71 +1,54 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IDeleteable, - IPostable, - IPuttable, -) +from pyconnectwise.interfaces import IDeleteable, IPostable, IPuttable from pyconnectwise.models.manage import BulkResult, CompanyConfiguration -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsBulkEndpoint( ConnectWiseEndpoint, - IPostable[CompanyConfiguration, ConnectWiseManageRequestParams], IDeleteable[ConnectWiseManageRequestParams], + IPostable[CompanyConfiguration, ConnectWiseManageRequestParams], IPuttable[CompanyConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "bulk", parent_endpoint=parent_endpoint - ) - IPostable.__init__(self, CompanyConfiguration) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "bulk", parent_endpoint=parent_endpoint) IDeleteable.__init__(self, None) + IPostable.__init__(self, CompanyConfiguration) IPuttable.__init__(self, CompanyConfiguration) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyConfiguration: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BulkResult: """ - Performs a POST request against the /company/configurations/bulk endpoint. + Performs a DELETE request against the /company/configurations/bulk endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - CompanyConfiguration: The parsed response data. + BulkResult: The parsed response data. """ - return self._parse_one( - CompanyConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BulkResult, super()._make_request("DELETE", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BulkResult: + def post( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CompanyConfiguration: """ - Performs a DELETE request against the /company/configurations/bulk endpoint. + Performs a POST request against the /company/configurations/bulk endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - BulkResult: The parsed response data. + CompanyConfiguration: The parsed response data. """ - return self._parse_one( - BulkResult, super()._make_request("DELETE", data=data, params=params).json() - ) + return self._parse_one(CompanyConfiguration, super()._make_request("POST", data=data, params=params).json()) def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyConfiguration: """ Performs a PUT request against the /company/configurations/bulk endpoint. @@ -76,7 +59,4 @@ def put( Returns: CompanyConfiguration: The parsed response data. """ - return self._parse_one( - CompanyConfiguration, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CompanyConfiguration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsCountEndpoint.py index c8ba276ab..3e6124a4a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/configurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/configurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsEndpoint.py index 9baba9c98..e12c1b42e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsEndpoint.py @@ -1,30 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyConfigurationsBulkEndpoint import ( - CompanyConfigurationsBulkEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyConfigurationsCountEndpoint import ( - CompanyConfigurationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyConfigurationsIdEndpoint import ( - CompanyConfigurationsIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesEndpoint import ( - CompanyConfigurationsStatusesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesEndpoint import ( - CompanyConfigurationsTypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyConfigurationsBulkEndpoint import CompanyConfigurationsBulkEndpoint +from pyconnectwise.endpoints.manage.CompanyConfigurationsCountEndpoint import CompanyConfigurationsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyConfigurationsIdEndpoint import CompanyConfigurationsIdEndpoint +from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesEndpoint import CompanyConfigurationsStatusesEndpoint +from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesEndpoint import CompanyConfigurationsTypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsEndpoint( @@ -33,45 +21,34 @@ class CompanyConfigurationsEndpoint( IPostable[CompanyConfiguration, ConnectWiseManageRequestParams], IPaginateable[CompanyConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "configurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "configurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyConfiguration]) IPostable.__init__(self, CompanyConfiguration) IPaginateable.__init__(self, CompanyConfiguration) - self.count = self._register_child_endpoint( - CompanyConfigurationsCountEndpoint(client, parent_endpoint=self) - ) - self.bulk = self._register_child_endpoint( - CompanyConfigurationsBulkEndpoint(client, parent_endpoint=self) - ) + self.bulk = self._register_child_endpoint(CompanyConfigurationsBulkEndpoint(client, parent_endpoint=self)) + self.count = self._register_child_endpoint(CompanyConfigurationsCountEndpoint(client, parent_endpoint=self)) self.statuses = self._register_child_endpoint( CompanyConfigurationsStatusesEndpoint(client, parent_endpoint=self) ) - self.types = self._register_child_endpoint( - CompanyConfigurationsTypesEndpoint(client, parent_endpoint=self) - ) + self.types = self._register_child_endpoint(CompanyConfigurationsTypesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyConfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyConfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyConfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyConfigurationsIdEndpoint: The initialized CompanyConfigurationsIdEndpoint object. """ child = CompanyConfigurationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyConfiguration]: """ Performs a GET request against the /company/configurations endpoint and returns an initialized PaginatedResponse object. @@ -89,18 +66,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyConfiguration, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyConfiguration]: """ Performs a GET request against the /company/configurations endpoint. @@ -111,15 +81,10 @@ def get( Returns: list[CompanyConfiguration]: The parsed response data. """ - return self._parse_many( - CompanyConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CompanyConfiguration, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyConfiguration: """ Performs a POST request against the /company/configurations endpoint. @@ -130,7 +95,4 @@ def post( Returns: CompanyConfiguration: The parsed response data. """ - return self._parse_one( - CompanyConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CompanyConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdChangetypeEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdChangetypeEndpoint.py index f0166690a..128d58fee 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdChangetypeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdChangetypeEndpoint.py @@ -1,28 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPatchable, -) +from pyconnectwise.interfaces import IPatchable from pyconnectwise.models.manage import CompanyConfiguration -from pyconnectwise.types import ( - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsIdChangetypeEndpoint( - ConnectWiseEndpoint, - IPatchable[CompanyConfiguration, ConnectWiseManageRequestParams], + ConnectWiseEndpoint, IPatchable[CompanyConfiguration, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "changeType", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "changeType", parent_endpoint=parent_endpoint) IPatchable.__init__(self, CompanyConfiguration) def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> CompanyConfiguration: """ Performs a PATCH request against the /company/configurations/{id}/changeType endpoint. @@ -33,7 +28,4 @@ def patch( Returns: CompanyConfiguration: The parsed response data. """ - return self._parse_one( - CompanyConfiguration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyConfiguration, super()._make_request("PATCH", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdEndpoint.py index de39a1d82..e6924b0e1 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsIdChangetypeEndpoint import ( CompanyConfigurationsIdChangetypeEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyConfiguration, ConnectWiseManageRequestParams], - IPuttable[CompanyConfiguration, ConnectWiseManageRequestParams], IPatchable[CompanyConfiguration, ConnectWiseManageRequestParams], + IPuttable[CompanyConfiguration, ConnectWiseManageRequestParams], IPaginateable[CompanyConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyConfiguration) - IPuttable.__init__(self, CompanyConfiguration) IPatchable.__init__(self, CompanyConfiguration) + IPuttable.__init__(self, CompanyConfiguration) IPaginateable.__init__(self, CompanyConfiguration) self.change_type = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyConfiguration]: """ Performs a GET request against the /company/configurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +50,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyConfiguration, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyConfiguration: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/configurations/{id} endpoint. + Performs a DELETE request against the /company/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyConfiguration: The parsed response data. """ - return self._parse_one( - CompanyConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CompanyConfiguration: """ - Performs a DELETE request against the /company/configurations/{id} endpoint. + Performs a GET request against the /company/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyConfiguration: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyConfiguration, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> CompanyConfiguration: """ - Performs a PUT request against the /company/configurations/{id} endpoint. + Performs a PATCH request against the /company/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +89,13 @@ def put( Returns: CompanyConfiguration: The parsed response data. """ - return self._parse_one( - CompanyConfiguration, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CompanyConfiguration, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyConfiguration: """ - Performs a PATCH request against the /company/configurations/{id} endpoint. + Performs a PUT request against the /company/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +103,4 @@ def patch( Returns: CompanyConfiguration: The parsed response data. """ - return self._parse_one( - CompanyConfiguration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyConfiguration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesCountEndpoint.py index 58b9d972b..0e184bd35 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/configurations/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/configurations/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesEndpoint.py index 12871b900..a21ac1a71 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesCountEndpoint import ( CompanyConfigurationsStatusesCountEndpoint, @@ -8,17 +10,13 @@ from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesInfoEndpoint import ( CompanyConfigurationsStatusesInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConfigurationStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesEndpoint( @@ -27,10 +25,8 @@ class CompanyConfigurationsStatusesEndpoint( IPostable[ConfigurationStatus, ConnectWiseManageRequestParams], IPaginateable[ConfigurationStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationStatus]) IPostable.__init__(self, ConfigurationStatus) IPaginateable.__init__(self, ConfigurationStatus) @@ -42,26 +38,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyConfigurationsStatusesInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyConfigurationsStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyConfigurationsStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyConfigurationsStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyConfigurationsStatusesIdEndpoint: The initialized CompanyConfigurationsStatusesIdEndpoint object. """ - child = CompanyConfigurationsStatusesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyConfigurationsStatusesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationStatus]: """ Performs a GET request against the /company/configurations/statuses endpoint and returns an initialized PaginatedResponse object. @@ -79,18 +70,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationStatus]: """ Performs a GET request against the /company/configurations/statuses endpoint. @@ -101,15 +85,10 @@ def get( Returns: list[ConfigurationStatus]: The parsed response data. """ - return self._parse_many( - ConfigurationStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConfigurationStatus, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationStatus: """ Performs a POST request against the /company/configurations/statuses endpoint. @@ -120,7 +99,4 @@ def post( Returns: ConfigurationStatus: The parsed response data. """ - return self._parse_one( - ConfigurationStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdEndpoint.py index f2d7908cc..ee41a6cb9 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesIdInfoEndpoint import ( CompanyConfigurationsStatusesIdInfoEndpoint, @@ -5,49 +7,38 @@ from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesIdUsagesEndpoint import ( CompanyConfigurationsStatusesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ConfigurationStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[ConfigurationStatus, ConnectWiseManageRequestParams], - IPuttable[ConfigurationStatus, ConnectWiseManageRequestParams], IPatchable[ConfigurationStatus, ConnectWiseManageRequestParams], + IPuttable[ConfigurationStatus, ConnectWiseManageRequestParams], IPaginateable[ConfigurationStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationStatus) - IPuttable.__init__(self, ConfigurationStatus) IPatchable.__init__(self, ConfigurationStatus) + IPuttable.__init__(self, ConfigurationStatus) IPaginateable.__init__(self, ConfigurationStatus) - self.usages = self._register_child_endpoint( - CompanyConfigurationsStatusesIdUsagesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( CompanyConfigurationsStatusesIdInfoEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint( + CompanyConfigurationsStatusesIdUsagesEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationStatus]: """ Performs a GET request against the /company/configurations/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +56,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/configurations/statuses/{id} endpoint. + Performs a DELETE request against the /company/configurations/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConfigurationStatus: The parsed response data. """ - return self._parse_one( - ConfigurationStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ConfigurationStatus: """ - Performs a DELETE request against the /company/configurations/statuses/{id} endpoint. + Performs a GET request against the /company/configurations/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConfigurationStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ConfigurationStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationStatus: """ - Performs a PUT request against the /company/configurations/statuses/{id} endpoint. + Performs a PATCH request against the /company/configurations/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +95,13 @@ def put( Returns: ConfigurationStatus: The parsed response data. """ - return self._parse_one( - ConfigurationStatus, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationStatus: """ - Performs a PATCH request against the /company/configurations/statuses/{id} endpoint. + Performs a PUT request against the /company/configurations/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +109,4 @@ def patch( Returns: ConfigurationStatus: The parsed response data. """ - return self._parse_one( - ConfigurationStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdInfoEndpoint.py index b7d3de08a..99aecc897 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsStatusesIdInfoEndpoint( IGettable[ConfigurationStatusInfo, ConnectWiseManageRequestParams], IPaginateable[ConfigurationStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationStatusInfo) IPaginateable.__init__(self, ConfigurationStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationStatusInfo]: """ Performs a GET request against the /company/configurations/statuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationStatusInfo: """ Performs a GET request against the /company/configurations/statuses/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: ConfigurationStatusInfo: The parsed response data. """ - return self._parse_one( - ConfigurationStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesEndpoint.py index 1f2131514..7d25fd08b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesIdUsagesListEndpoint import ( CompanyConfigurationsStatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesIdUsagesEndpoint( @@ -19,24 +18,17 @@ class CompanyConfigurationsStatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - CompanyConfigurationsStatusesIdUsagesListEndpoint( - client, parent_endpoint=self - ) + CompanyConfigurationsStatusesIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/configurations/statuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/configurations/statuses/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesListEndpoint.py index b72d05af8..fe41d99c5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsStatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/configurations/statuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/configurations/statuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoCountEndpoint.py index 86fadc72f..73cbae6b6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsStatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/configurations/statuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/configurations/statuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoEndpoint.py index 5fba32978..055436593 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsStatusesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsStatusesInfoCountEndpoint import ( CompanyConfigurationsStatusesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsStatusesInfoEndpoint( @@ -19,10 +18,8 @@ class CompanyConfigurationsStatusesInfoEndpoint( IGettable[list[ConfigurationStatusInfo], ConnectWiseManageRequestParams], IPaginateable[ConfigurationStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationStatusInfo]) IPaginateable.__init__(self, ConfigurationStatusInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationStatusInfo]: """ Performs a GET request against the /company/configurations/statuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationStatusInfo]: """ Performs a GET request against the /company/configurations/statuses/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ConfigurationStatusInfo]: The parsed response data. """ - return self._parse_many( - ConfigurationStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConfigurationStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCopyEndpoint.py index f12e81fdf..221282860 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCopyEndpoint.py @@ -13,9 +13,7 @@ class CompanyConfigurationsTypesCopyEndpoint( ConnectWiseEndpoint, IPostable[ConfigurationType, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, ConfigurationType) def post( diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCountEndpoint.py index 2a945ca95..23a83a580 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/configurations/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/configurations/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesEndpoint.py index d2853f9b2..c5f64f176 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesEndpoint.py @@ -1,24 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesCopyEndpoint import ( - CompanyConfigurationsTypesCopyEndpoint, -) from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesCountEndpoint import ( CompanyConfigurationsTypesCountEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdEndpoint import ( - CompanyConfigurationsTypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdEndpoint import CompanyConfigurationsTypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConfigurationType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesEndpoint( @@ -27,39 +20,31 @@ class CompanyConfigurationsTypesEndpoint( IPostable[ConfigurationType, ConnectWiseManageRequestParams], IPaginateable[ConfigurationType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationType]) IPostable.__init__(self, ConfigurationType) IPaginateable.__init__(self, ConfigurationType) - self.copy = self._register_child_endpoint( - CompanyConfigurationsTypesCopyEndpoint(client, parent_endpoint=self) - ) self.count = self._register_child_endpoint( CompanyConfigurationsTypesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyConfigurationsTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyConfigurationsTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyConfigurationsTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyConfigurationsTypesIdEndpoint: The initialized CompanyConfigurationsTypesIdEndpoint object. """ child = CompanyConfigurationsTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationType]: """ Performs a GET request against the /company/configurations/types endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationType]: """ Performs a GET request against the /company/configurations/types endpoint. @@ -99,16 +77,9 @@ def get( Returns: list[ConfigurationType]: The parsed response data. """ - return self._parse_many( - ConfigurationType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConfigurationType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ConfigurationType: """ Performs a POST request against the /company/configurations/types endpoint. @@ -118,7 +89,4 @@ def post( Returns: ConfigurationType: The parsed response data. """ - return self._parse_one( - ConfigurationType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdEndpoint.py index 4fb443bde..79209400e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdInfoEndpoint import ( CompanyConfigurationsTypesIdInfoEndpoint, @@ -8,52 +10,41 @@ from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdUsagesEndpoint import ( CompanyConfigurationsTypesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ConfigurationType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdEndpoint( ConnectWiseEndpoint, IGettable[ConfigurationType, ConnectWiseManageRequestParams], - IPuttable[ConfigurationType, ConnectWiseManageRequestParams], IPatchable[ConfigurationType, ConnectWiseManageRequestParams], + IPuttable[ConfigurationType, ConnectWiseManageRequestParams], IPaginateable[ConfigurationType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationType) - IPuttable.__init__(self, ConfigurationType) IPatchable.__init__(self, ConfigurationType) + IPuttable.__init__(self, ConfigurationType) IPaginateable.__init__(self, ConfigurationType) - self.usages = self._register_child_endpoint( - CompanyConfigurationsTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( CompanyConfigurationsTypesIdInfoEndpoint(client, parent_endpoint=self) ) self.questions = self._register_child_endpoint( CompanyConfigurationsTypesIdQuestionsEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint( + CompanyConfigurationsTypesIdUsagesEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationType]: """ Performs a GET request against the /company/configurations/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -71,54 +62,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/configurations/types/{id} endpoint. + Performs a DELETE request against the /company/configurations/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConfigurationType: The parsed response data. """ - return self._parse_one( - ConfigurationType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ConfigurationType: """ - Performs a DELETE request against the /company/configurations/types/{id} endpoint. + Performs a GET request against the /company/configurations/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConfigurationType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ConfigurationType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ConfigurationType: """ - Performs a PUT request against the /company/configurations/types/{id} endpoint. + Performs a PATCH request against the /company/configurations/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,18 +97,11 @@ def put( Returns: ConfigurationType: The parsed response data. """ - return self._parse_one( - ConfigurationType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ConfigurationType: """ - Performs a PATCH request against the /company/configurations/types/{id} endpoint. + Performs a PUT request against the /company/configurations/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -145,7 +109,4 @@ def patch( Returns: ConfigurationType: The parsed response data. """ - return self._parse_one( - ConfigurationType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdInfoEndpoint.py index 2471ce0fe..615c34fef 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsTypesIdInfoEndpoint( IGettable[ConfigurationTypeInfo, ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationTypeInfo) IPaginateable.__init__(self, ConfigurationTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeInfo]: """ Performs a GET request against the /company/configurations/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeInfo: """ Performs a GET request against the /company/configurations/types/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: ConfigurationTypeInfo: The parsed response data. """ - return self._parse_one( - ConfigurationTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsCountEndpoint.py index 913a3a01c..baf4ae55f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsTypesIdQuestionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/configurations/types/{id}/questions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/configurations/types/{id}/questions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsEndpoint.py index 7045538a3..7cd4393fe 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdQuestionsCountEndpoint import ( CompanyConfigurationsTypesIdQuestionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdQuestionsIdEndpoint import ( CompanyConfigurationsTypesIdQuestionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConfigurationTypeQuestion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsEndpoint( @@ -24,42 +22,31 @@ class CompanyConfigurationsTypesIdQuestionsEndpoint( IPostable[ConfigurationTypeQuestion, ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "questions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "questions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationTypeQuestion]) IPostable.__init__(self, ConfigurationTypeQuestion) IPaginateable.__init__(self, ConfigurationTypeQuestion) self.count = self._register_child_endpoint( - CompanyConfigurationsTypesIdQuestionsCountEndpoint( - client, parent_endpoint=self - ) + CompanyConfigurationsTypesIdQuestionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyConfigurationsTypesIdQuestionsIdEndpoint: + def id(self, _id: int) -> CompanyConfigurationsTypesIdQuestionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyConfigurationsTypesIdQuestionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyConfigurationsTypesIdQuestionsIdEndpoint: The initialized CompanyConfigurationsTypesIdQuestionsIdEndpoint object. """ - child = CompanyConfigurationsTypesIdQuestionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyConfigurationsTypesIdQuestionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestion]: """ Performs a GET request against the /company/configurations/types/{id}/questions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeQuestion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeQuestion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationTypeQuestion]: """ Performs a GET request against the /company/configurations/types/{id}/questions endpoint. @@ -100,14 +80,11 @@ def get( list[ConfigurationTypeQuestion]: The parsed response data. """ return self._parse_many( - ConfigurationTypeQuestion, - super()._make_request("GET", data=data, params=params).json(), + ConfigurationTypeQuestion, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestion: """ Performs a POST request against the /company/configurations/types/{id}/questions endpoint. @@ -119,6 +96,5 @@ def post( ConfigurationTypeQuestion: The parsed response data. """ return self._parse_one( - ConfigurationTypeQuestion, - super()._make_request("POST", data=data, params=params).json(), + ConfigurationTypeQuestion, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdEndpoint.py index 9a6fa21dc..536911d6b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint import ( CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ConfigurationTypeQuestion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsIdEndpoint( ConnectWiseEndpoint, IGettable[ConfigurationTypeQuestion, ConnectWiseManageRequestParams], - IPuttable[ConfigurationTypeQuestion, ConnectWiseManageRequestParams], IPatchable[ConfigurationTypeQuestion, ConnectWiseManageRequestParams], + IPuttable[ConfigurationTypeQuestion, ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationTypeQuestion) - IPuttable.__init__(self, ConfigurationTypeQuestion) IPatchable.__init__(self, ConfigurationTypeQuestion) + IPuttable.__init__(self, ConfigurationTypeQuestion) IPaginateable.__init__(self, ConfigurationTypeQuestion) self.values = self._register_child_endpoint( - CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint( - client, parent_endpoint=self - ) + CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestion]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeQuestion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeQuestion, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationTypeQuestion: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/configurations/types/{id}/questions/{id} endpoint. + Performs a DELETE request against the /company/configurations/types/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConfigurationTypeQuestion: The parsed response data. """ - return self._parse_one( - ConfigurationTypeQuestion, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ConfigurationTypeQuestion: """ - Performs a DELETE request against the /company/configurations/types/{id}/questions/{id} endpoint. + Performs a GET request against the /company/configurations/types/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConfigurationTypeQuestion: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ConfigurationTypeQuestion, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestion: """ - Performs a PUT request against the /company/configurations/types/{id}/questions/{id} endpoint. + Performs a PATCH request against the /company/configurations/types/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -117,17 +90,14 @@ def put( ConfigurationTypeQuestion: The parsed response data. """ return self._parse_one( - ConfigurationTypeQuestion, - super()._make_request("PUT", data=data, params=params).json(), + ConfigurationTypeQuestion, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestion: """ - Performs a PATCH request against the /company/configurations/types/{id}/questions/{id} endpoint. + Performs a PUT request against the /company/configurations/types/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,7 +105,4 @@ def patch( Returns: ConfigurationTypeQuestion: The parsed response data. """ - return self._parse_one( - ConfigurationTypeQuestion, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationTypeQuestion, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint.py index 8d61c8e08..39aba5895 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint.py index 731b90383..f26d94704 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint import ( CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint import ( CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConfigurationTypeQuestionValue from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint( @@ -24,42 +22,31 @@ class CompanyConfigurationsTypesIdQuestionsIdValuesEndpoint( IPostable[ConfigurationTypeQuestionValue, ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestionValue, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "values", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "values", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationTypeQuestionValue]) IPostable.__init__(self, ConfigurationTypeQuestionValue) IPaginateable.__init__(self, ConfigurationTypeQuestionValue) self.count = self._register_child_endpoint( - CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint( - client, parent_endpoint=self - ) + CompanyConfigurationsTypesIdQuestionsIdValuesCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint: + def id(self, _id: int) -> CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint: The initialized CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint object. """ - child = CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestionValue]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeQuestionValue, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeQuestionValue, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationTypeQuestionValue]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values endpoint. @@ -100,14 +80,11 @@ def get( list[ConfigurationTypeQuestionValue]: The parsed response data. """ return self._parse_many( - ConfigurationTypeQuestionValue, - super()._make_request("GET", data=data, params=params).json(), + ConfigurationTypeQuestionValue, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestionValue: """ Performs a POST request against the /company/configurations/types/{id}/questions/{id}/values endpoint. @@ -119,6 +96,5 @@ def post( ConfigurationTypeQuestionValue: The parsed response data. """ return self._parse_one( - ConfigurationTypeQuestionValue, - super()._make_request("POST", data=data, params=params).json(), + ConfigurationTypeQuestionValue, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py index 9395b2bfc..45e8d8213 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint import ( CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ConfigurationTypeQuestionValue from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsIdValuesIdEndpoint( ConnectWiseEndpoint, IGettable[ConfigurationTypeQuestionValue, ConnectWiseManageRequestParams], - IPuttable[ConfigurationTypeQuestionValue, ConnectWiseManageRequestParams], IPatchable[ConfigurationTypeQuestionValue, ConnectWiseManageRequestParams], + IPuttable[ConfigurationTypeQuestionValue, ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestionValue, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationTypeQuestionValue) - IPuttable.__init__(self, ConfigurationTypeQuestionValue) IPatchable.__init__(self, ConfigurationTypeQuestionValue) + IPuttable.__init__(self, ConfigurationTypeQuestionValue) IPaginateable.__init__(self, ConfigurationTypeQuestionValue) self.usages = self._register_child_endpoint( - CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint( - client, parent_endpoint=self - ) + CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestionValue]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeQuestionValue, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeQuestionValue, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationTypeQuestionValue: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. + Performs a DELETE request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConfigurationTypeQuestionValue: The parsed response data. """ - return self._parse_one( - ConfigurationTypeQuestionValue, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ConfigurationTypeQuestionValue: """ - Performs a DELETE request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. + Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConfigurationTypeQuestionValue: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + ConfigurationTypeQuestionValue, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestionValue: """ - Performs a PUT request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. + Performs a PATCH request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -117,17 +92,14 @@ def put( ConfigurationTypeQuestionValue: The parsed response data. """ return self._parse_one( - ConfigurationTypeQuestionValue, - super()._make_request("PUT", data=data, params=params).json(), + ConfigurationTypeQuestionValue, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestionValue: """ - Performs a PATCH request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. + Performs a PUT request against the /company/configurations/types/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -136,6 +108,5 @@ def patch( ConfigurationTypeQuestionValue: The parsed response data. """ return self._parse_one( - ConfigurationTypeQuestionValue, - super()._make_request("PATCH", data=data, params=params).json(), + ConfigurationTypeQuestionValue, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint.py index cf262132e..876eaceca 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint import ( CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint( @@ -19,24 +18,17 @@ class CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint( - client, parent_endpoint=self - ) + CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint.py index 0142d8cfc..e74e85014 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsTypesIdQuestionsIdValuesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/questions/{id}/values/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesEndpoint.py index 5c02ad12f..208f1c3d8 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyConfigurationsTypesIdUsagesListEndpoint import ( CompanyConfigurationsTypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class CompanyConfigurationsTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesListEndpoint.py index ac068ba2a..e4cf255f5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyConfigurationsTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyConfigurationsTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyConfigurationsTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/configurations/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactEndpoint.py index 86bcfc08f..a7f7b011a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactEndpoint.py @@ -6,10 +6,6 @@ class CompanyContactEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contact", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "contact", parent_endpoint=parent_endpoint) - self.types = self._register_child_endpoint( - CompanyContactTypesEndpoint(client, parent_endpoint=self) - ) + self.types = self._register_child_endpoint(CompanyContactTypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactTypesEndpoint.py index ba85b3ea2..9e79dcb65 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactTypesEndpoint.py @@ -6,9 +6,7 @@ class CompanyContactTypesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) def id(self, id: int) -> CompanyContactTypesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdEndpoint.py index 48cd380ef..f7389a438 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdEndpoint.py @@ -6,10 +6,6 @@ class CompanyContactTypesIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.usages = self._register_child_endpoint( - CompanyContactTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(CompanyContactTypesIdUsagesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesEndpoint.py index cda48ca22..8e8228224 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesEndpoint.py @@ -6,10 +6,6 @@ class CompanyContactTypesIdUsagesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) - self.list = self._register_child_endpoint( - CompanyContactTypesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(CompanyContactTypesIdUsagesListEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesListEndpoint.py index 00272c6e9..f67d70f35 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactTypesIdUsagesListEndpoint.py @@ -17,9 +17,7 @@ class CompanyContactTypesIdUsagesListEndpoint( IPaginateable[Usage, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -67,6 +65,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsCountEndpoint.py index 7c79ee0bf..b2b3ba13d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDefaultEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDefaultEndpoint.py index 0c0118419..bde8a7cf0 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDefaultEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDefaultEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Contact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDefaultEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsDefaultEndpoint( IGettable[Contact, ConnectWiseManageRequestParams], IPaginateable[Contact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "default", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "default", parent_endpoint=parent_endpoint) IGettable.__init__(self, Contact) IPaginateable.__init__(self, Contact) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Contact]: """ Performs a GET request against the /company/contacts/default endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Contact, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Contact, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Contact: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Contact: """ Performs a GET request against the /company/contacts/default endpoint. @@ -67,6 +50,4 @@ def get( Returns: Contact: The parsed response data. """ - return self._parse_one( - Contact, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Contact, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsCountEndpoint.py index 2ac1646b6..522369174 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsDepartmentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/departments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/departments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsEndpoint.py index 21497cdb1..07e40276c 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsEndpoint.py @@ -1,24 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsCountEndpoint import ( CompanyContactsDepartmentsCountEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsIdEndpoint import ( - CompanyContactsDepartmentsIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsInfoEndpoint import ( - CompanyContactsDepartmentsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsIdEndpoint import CompanyContactsDepartmentsIdEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsInfoEndpoint import CompanyContactsDepartmentsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactDepartment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsEndpoint( @@ -27,10 +21,8 @@ class CompanyContactsDepartmentsEndpoint( IPostable[ContactDepartment, ConnectWiseManageRequestParams], IPaginateable[ContactDepartment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "departments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "departments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactDepartment]) IPostable.__init__(self, ContactDepartment) IPaginateable.__init__(self, ContactDepartment) @@ -38,28 +30,23 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 self.count = self._register_child_endpoint( CompanyContactsDepartmentsCountEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - CompanyContactsDepartmentsInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyContactsDepartmentsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyContactsDepartmentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsDepartmentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsDepartmentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsDepartmentsIdEndpoint: The initialized CompanyContactsDepartmentsIdEndpoint object. """ child = CompanyContactsDepartmentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactDepartment]: """ Performs a GET request against the /company/contacts/departments endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactDepartment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactDepartment, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ContactDepartment]: """ Performs a GET request against the /company/contacts/departments endpoint. @@ -99,16 +79,9 @@ def get( Returns: list[ContactDepartment]: The parsed response data. """ - return self._parse_many( - ContactDepartment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ContactDepartment, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactDepartment: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactDepartment: """ Performs a POST request against the /company/contacts/departments endpoint. @@ -118,7 +91,4 @@ def post( Returns: ContactDepartment: The parsed response data. """ - return self._parse_one( - ContactDepartment, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ContactDepartment, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdEndpoint.py index fff68d908..82bc0e02b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsIdInfoEndpoint import ( CompanyContactsDepartmentsIdInfoEndpoint, @@ -5,49 +7,38 @@ from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsIdUsagesEndpoint import ( CompanyContactsDepartmentsIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ContactDepartment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsIdEndpoint( ConnectWiseEndpoint, IGettable[ContactDepartment, ConnectWiseManageRequestParams], - IPuttable[ContactDepartment, ConnectWiseManageRequestParams], IPatchable[ContactDepartment, ConnectWiseManageRequestParams], + IPuttable[ContactDepartment, ConnectWiseManageRequestParams], IPaginateable[ContactDepartment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactDepartment) - IPuttable.__init__(self, ContactDepartment) IPatchable.__init__(self, ContactDepartment) + IPuttable.__init__(self, ContactDepartment) IPaginateable.__init__(self, ContactDepartment) - self.usages = self._register_child_endpoint( - CompanyContactsDepartmentsIdUsagesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( CompanyContactsDepartmentsIdInfoEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint( + CompanyContactsDepartmentsIdUsagesEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactDepartment]: """ Performs a GET request against the /company/contacts/departments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +56,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactDepartment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactDepartment, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactDepartment: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/departments/{id} endpoint. + Performs a DELETE request against the /company/contacts/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactDepartment: The parsed response data. """ - return self._parse_one( - ContactDepartment, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactDepartment: """ - Performs a DELETE request against the /company/contacts/departments/{id} endpoint. + Performs a GET request against the /company/contacts/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactDepartment: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactDepartment, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactDepartment: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ContactDepartment: """ - Performs a PUT request against the /company/contacts/departments/{id} endpoint. + Performs a PATCH request against the /company/contacts/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +91,11 @@ def put( Returns: ContactDepartment: The parsed response data. """ - return self._parse_one( - ContactDepartment, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ContactDepartment, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactDepartment: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactDepartment: """ - Performs a PATCH request against the /company/contacts/departments/{id} endpoint. + Performs a PUT request against the /company/contacts/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +103,4 @@ def patch( Returns: ContactDepartment: The parsed response data. """ - return self._parse_one( - ContactDepartment, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ContactDepartment, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdInfoEndpoint.py index f8fb24d2a..1f003b9f6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ContactDepartmentInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsDepartmentsIdInfoEndpoint( IGettable[ContactDepartmentInfo, ConnectWiseManageRequestParams], IPaginateable[ContactDepartmentInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactDepartmentInfo) IPaginateable.__init__(self, ContactDepartmentInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactDepartmentInfo]: """ Performs a GET request against the /company/contacts/departments/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactDepartmentInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactDepartmentInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactDepartmentInfo: """ Performs a GET request against the /company/contacts/departments/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: ContactDepartmentInfo: The parsed response data. """ - return self._parse_one( - ContactDepartmentInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ContactDepartmentInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesEndpoint.py index c79f61b6e..16bb8e5ff 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsIdUsagesListEndpoint import ( CompanyContactsDepartmentsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsIdUsagesEndpoint( @@ -19,10 +18,8 @@ class CompanyContactsDepartmentsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/contacts/departments/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/contacts/departments/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesListEndpoint.py index 45b3aaccc..2be5089c3 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsDepartmentsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/contacts/departments/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/contacts/departments/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoCountEndpoint.py index aee1f9b84..e5a798eee 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsDepartmentsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/departments/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/departments/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoEndpoint.py index 6665a2797..a2f8dd6f2 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsDepartmentsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsInfoCountEndpoint import ( CompanyContactsDepartmentsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ContactDepartmentInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsDepartmentsInfoEndpoint( @@ -19,10 +18,8 @@ class CompanyContactsDepartmentsInfoEndpoint( IGettable[list[ContactDepartmentInfo], ConnectWiseManageRequestParams], IPaginateable[ContactDepartmentInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactDepartmentInfo]) IPaginateable.__init__(self, ContactDepartmentInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactDepartmentInfo]: """ Performs a GET request against the /company/contacts/departments/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactDepartmentInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactDepartmentInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ContactDepartmentInfo]: """ Performs a GET request against the /company/contacts/departments/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ContactDepartmentInfo]: The parsed response data. """ - return self._parse_many( - ContactDepartmentInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ContactDepartmentInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsEndpoint.py index 085a9ba08..78f824e92 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsEndpoint.py @@ -1,39 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsCountEndpoint import ( - CompanyContactsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsDefaultEndpoint import ( - CompanyContactsDefaultEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsEndpoint import ( - CompanyContactsDepartmentsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsIdEndpoint import ( - CompanyContactsIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsRelationshipsEndpoint import ( - CompanyContactsRelationshipsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsRequestpasswordEndpoint import ( - CompanyContactsRequestpasswordEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsTypesEndpoint import ( - CompanyContactsTypesEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyContactsCountEndpoint import CompanyContactsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsDefaultEndpoint import CompanyContactsDefaultEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsDepartmentsEndpoint import CompanyContactsDepartmentsEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsIdEndpoint import CompanyContactsIdEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsRelationshipsEndpoint import CompanyContactsRelationshipsEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsRequestpasswordEndpoint import CompanyContactsRequestpasswordEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsTypesEndpoint import CompanyContactsTypesEndpoint from pyconnectwise.endpoints.manage.CompanyContactsValidateportalcredentialsEndpoint import ( CompanyContactsValidateportalcredentialsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Contact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsEndpoint( @@ -42,56 +26,43 @@ class CompanyContactsEndpoint( IPostable[Contact, ConnectWiseManageRequestParams], IPaginateable[Contact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contacts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "contacts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Contact]) IPostable.__init__(self, Contact) IPaginateable.__init__(self, Contact) - self.count = self._register_child_endpoint( - CompanyContactsCountEndpoint(client, parent_endpoint=self) - ) - self.validate_portal_credentials = self._register_child_endpoint( - CompanyContactsValidateportalcredentialsEndpoint( - client, parent_endpoint=self - ) - ) - self.default = self._register_child_endpoint( - CompanyContactsDefaultEndpoint(client, parent_endpoint=self) - ) - self.request_password = self._register_child_endpoint( - CompanyContactsRequestpasswordEndpoint(client, parent_endpoint=self) + self.count = self._register_child_endpoint(CompanyContactsCountEndpoint(client, parent_endpoint=self)) + self.default = self._register_child_endpoint(CompanyContactsDefaultEndpoint(client, parent_endpoint=self)) + self.departments = self._register_child_endpoint( + CompanyContactsDepartmentsEndpoint(client, parent_endpoint=self) ) self.relationships = self._register_child_endpoint( CompanyContactsRelationshipsEndpoint(client, parent_endpoint=self) ) - self.types = self._register_child_endpoint( - CompanyContactsTypesEndpoint(client, parent_endpoint=self) + self.request_password = self._register_child_endpoint( + CompanyContactsRequestpasswordEndpoint(client, parent_endpoint=self) ) - self.departments = self._register_child_endpoint( - CompanyContactsDepartmentsEndpoint(client, parent_endpoint=self) + self.types = self._register_child_endpoint(CompanyContactsTypesEndpoint(client, parent_endpoint=self)) + self.validate_portal_credentials = self._register_child_endpoint( + CompanyContactsValidateportalcredentialsEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyContactsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsIdEndpoint: The initialized CompanyContactsIdEndpoint object. """ child = CompanyContactsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Contact]: """ Performs a GET request against the /company/contacts endpoint and returns an initialized PaginatedResponse object. @@ -108,20 +79,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Contact, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Contact, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Contact]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Contact]: """ Performs a GET request against the /company/contacts endpoint. @@ -131,15 +91,9 @@ def get( Returns: list[Contact]: The parsed response data. """ - return self._parse_many( - Contact, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Contact, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Contact: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Contact: """ Performs a POST request against the /company/contacts endpoint. @@ -149,6 +103,4 @@ def post( Returns: Contact: The parsed response data. """ - return self._parse_one( - Contact, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Contact, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsCountEndpoint.py index 3d4a0d63f..e58a2777b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdCommunicationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdCommunicationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/{id}/communications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/{id}/communications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsEndpoint.py index 27a47d881..f2e2d923d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsIdCommunicationsCountEndpoint import ( CompanyContactsIdCommunicationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyContactsIdCommunicationsIdEndpoint import ( CompanyContactsIdCommunicationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactCommunication from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdCommunicationsEndpoint( @@ -24,10 +22,8 @@ class CompanyContactsIdCommunicationsEndpoint( IPostable[ContactCommunication, ConnectWiseManageRequestParams], IPaginateable[ContactCommunication, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "communications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "communications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactCommunication]) IPostable.__init__(self, ContactCommunication) IPaginateable.__init__(self, ContactCommunication) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyContactsIdCommunicationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyContactsIdCommunicationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsIdCommunicationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsIdCommunicationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsIdCommunicationsIdEndpoint: The initialized CompanyContactsIdCommunicationsIdEndpoint object. """ - child = CompanyContactsIdCommunicationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyContactsIdCommunicationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactCommunication]: """ Performs a GET request against the /company/contacts/{id}/communications endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactCommunication, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactCommunication, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ContactCommunication]: """ Performs a GET request against the /company/contacts/{id}/communications endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[ContactCommunication]: The parsed response data. """ - return self._parse_many( - ContactCommunication, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ContactCommunication, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactCommunication: """ Performs a POST request against the /company/contacts/{id}/communications endpoint. @@ -114,7 +93,4 @@ def post( Returns: ContactCommunication: The parsed response data. """ - return self._parse_one( - ContactCommunication, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ContactCommunication, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsIdEndpoint.py index d56d43e6f..fb3b1bbc9 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdCommunicationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ContactCommunication from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdCommunicationsIdEndpoint( ConnectWiseEndpoint, IGettable[ContactCommunication, ConnectWiseManageRequestParams], - IPuttable[ContactCommunication, ConnectWiseManageRequestParams], IPatchable[ContactCommunication, ConnectWiseManageRequestParams], + IPuttable[ContactCommunication, ConnectWiseManageRequestParams], IPaginateable[ContactCommunication, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactCommunication) - IPuttable.__init__(self, ContactCommunication) IPatchable.__init__(self, ContactCommunication) + IPuttable.__init__(self, ContactCommunication) IPaginateable.__init__(self, ContactCommunication) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactCommunication]: """ Performs a GET request against the /company/contacts/{id}/communications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactCommunication, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactCommunication, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactCommunication: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/{id}/communications/{id} endpoint. + Performs a DELETE request against the /company/contacts/{id}/communications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactCommunication: The parsed response data. """ - return self._parse_one( - ContactCommunication, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ContactCommunication: """ - Performs a DELETE request against the /company/contacts/{id}/communications/{id} endpoint. + Performs a GET request against the /company/contacts/{id}/communications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactCommunication: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactCommunication, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ContactCommunication: """ - Performs a PUT request against the /company/contacts/{id}/communications/{id} endpoint. + Performs a PATCH request against the /company/contacts/{id}/communications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: ContactCommunication: The parsed response data. """ - return self._parse_one( - ContactCommunication, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ContactCommunication, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactCommunication: """ - Performs a PATCH request against the /company/contacts/{id}/communications/{id} endpoint. + Performs a PUT request against the /company/contacts/{id}/communications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: ContactCommunication: The parsed response data. """ - return self._parse_one( - ContactCommunication, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ContactCommunication, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdEndpoint.py index e87d730b1..deac42a57 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdEndpoint.py @@ -1,89 +1,60 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsIdCommunicationsEndpoint import ( CompanyContactsIdCommunicationsEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyContactsIdGroupsEndpoint import ( - CompanyContactsIdGroupsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsIdImageEndpoint import ( - CompanyContactsIdImageEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsIdNotesEndpoint import ( - CompanyContactsIdNotesEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyContactsIdGroupsEndpoint import CompanyContactsIdGroupsEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsIdImageEndpoint import CompanyContactsIdImageEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsIdNotesEndpoint import CompanyContactsIdNotesEndpoint from pyconnectwise.endpoints.manage.CompanyContactsIdPortalsecurityEndpoint import ( CompanyContactsIdPortalsecurityEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyContactsIdTracksEndpoint import ( - CompanyContactsIdTracksEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyContactsIdTracksEndpoint import CompanyContactsIdTracksEndpoint from pyconnectwise.endpoints.manage.CompanyContactsIdTypeassociationsEndpoint import ( CompanyContactsIdTypeassociationsEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyContactsIdUsagesEndpoint import ( - CompanyContactsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyContactsIdUsagesEndpoint import CompanyContactsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Contact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdEndpoint( ConnectWiseEndpoint, IGettable[Contact, ConnectWiseManageRequestParams], - IPuttable[Contact, ConnectWiseManageRequestParams], IPatchable[Contact, ConnectWiseManageRequestParams], + IPuttable[Contact, ConnectWiseManageRequestParams], IPaginateable[Contact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Contact) - IPuttable.__init__(self, Contact) IPatchable.__init__(self, Contact) + IPuttable.__init__(self, Contact) IPaginateable.__init__(self, Contact) + self.communications = self._register_child_endpoint( + CompanyContactsIdCommunicationsEndpoint(client, parent_endpoint=self) + ) + self.groups = self._register_child_endpoint(CompanyContactsIdGroupsEndpoint(client, parent_endpoint=self)) + self.image = self._register_child_endpoint(CompanyContactsIdImageEndpoint(client, parent_endpoint=self)) + self.notes = self._register_child_endpoint(CompanyContactsIdNotesEndpoint(client, parent_endpoint=self)) self.portal_security = self._register_child_endpoint( CompanyContactsIdPortalsecurityEndpoint(client, parent_endpoint=self) ) + self.tracks = self._register_child_endpoint(CompanyContactsIdTracksEndpoint(client, parent_endpoint=self)) self.type_associations = self._register_child_endpoint( CompanyContactsIdTypeassociationsEndpoint(client, parent_endpoint=self) ) - self.groups = self._register_child_endpoint( - CompanyContactsIdGroupsEndpoint(client, parent_endpoint=self) - ) - self.usages = self._register_child_endpoint( - CompanyContactsIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.communications = self._register_child_endpoint( - CompanyContactsIdCommunicationsEndpoint(client, parent_endpoint=self) - ) - self.tracks = self._register_child_endpoint( - CompanyContactsIdTracksEndpoint(client, parent_endpoint=self) - ) - self.notes = self._register_child_endpoint( - CompanyContactsIdNotesEndpoint(client, parent_endpoint=self) - ) - self.image = self._register_child_endpoint( - CompanyContactsIdImageEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(CompanyContactsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Contact]: """ Performs a GET request against the /company/contacts/{id} endpoint and returns an initialized PaginatedResponse object. @@ -100,54 +71,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Contact, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Contact, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Contact: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/{id} endpoint. + Performs a DELETE request against the /company/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Contact: The parsed response data. """ - return self._parse_one( - Contact, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Contact: """ - Performs a DELETE request against the /company/contacts/{id} endpoint. + Performs a GET request against the /company/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Contact: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Contact, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Contact: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Contact: """ - Performs a PUT request against the /company/contacts/{id} endpoint. + Performs a PATCH request against the /company/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -155,17 +105,11 @@ def put( Returns: Contact: The parsed response data. """ - return self._parse_one( - Contact, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Contact, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Contact: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Contact: """ - Performs a PATCH request against the /company/contacts/{id} endpoint. + Performs a PUT request against the /company/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -173,6 +117,4 @@ def patch( Returns: Contact: The parsed response data. """ - return self._parse_one( - Contact, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Contact, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsCountEndpoint.py index 6be893720..a0dc30f95 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdGroupsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdGroupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/{id}/groups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/{id}/groups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsEndpoint.py index 1841db62a..fab9641d4 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsIdGroupsCountEndpoint import ( - CompanyContactsIdGroupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsIdGroupsIdEndpoint import ( - CompanyContactsIdGroupsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyContactsIdGroupsCountEndpoint import CompanyContactsIdGroupsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsIdGroupsIdEndpoint import CompanyContactsIdGroupsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactGroup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdGroupsEndpoint( @@ -24,36 +18,29 @@ class CompanyContactsIdGroupsEndpoint( IPostable[ContactGroup, ConnectWiseManageRequestParams], IPaginateable[ContactGroup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "groups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "groups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactGroup]) IPostable.__init__(self, ContactGroup) IPaginateable.__init__(self, ContactGroup) - self.count = self._register_child_endpoint( - CompanyContactsIdGroupsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyContactsIdGroupsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyContactsIdGroupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsIdGroupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsIdGroupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsIdGroupsIdEndpoint: The initialized CompanyContactsIdGroupsIdEndpoint object. """ child = CompanyContactsIdGroupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactGroup]: """ Performs a GET request against the /company/contacts/{id}/groups endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactGroup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactGroup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ContactGroup]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ContactGroup]: """ Performs a GET request against the /company/contacts/{id}/groups endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ContactGroup]: The parsed response data. """ - return self._parse_many( - ContactGroup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ContactGroup, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactGroup: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactGroup: """ Performs a POST request against the /company/contacts/{id}/groups endpoint. @@ -111,6 +83,4 @@ def post( Returns: ContactGroup: The parsed response data. """ - return self._parse_one( - ContactGroup, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ContactGroup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsIdEndpoint.py index 0a5a44d0c..81db57a5e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdGroupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ContactGroup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdGroupsIdEndpoint( ConnectWiseEndpoint, IGettable[ContactGroup, ConnectWiseManageRequestParams], - IPuttable[ContactGroup, ConnectWiseManageRequestParams], IPatchable[ContactGroup, ConnectWiseManageRequestParams], + IPuttable[ContactGroup, ConnectWiseManageRequestParams], IPaginateable[ContactGroup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactGroup) - IPuttable.__init__(self, ContactGroup) IPatchable.__init__(self, ContactGroup) + IPuttable.__init__(self, ContactGroup) IPaginateable.__init__(self, ContactGroup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactGroup]: """ Performs a GET request against the /company/contacts/{id}/groups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactGroup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactGroup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactGroup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/{id}/groups/{id} endpoint. + Performs a DELETE request against the /company/contacts/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactGroup: The parsed response data. """ - return self._parse_one( - ContactGroup, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactGroup: """ - Performs a DELETE request against the /company/contacts/{id}/groups/{id} endpoint. + Performs a GET request against the /company/contacts/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactGroup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactGroup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactGroup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ContactGroup: """ - Performs a PUT request against the /company/contacts/{id}/groups/{id} endpoint. + Performs a PATCH request against the /company/contacts/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: ContactGroup: The parsed response data. """ - return self._parse_one( - ContactGroup, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ContactGroup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactGroup: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactGroup: """ - Performs a PATCH request against the /company/contacts/{id}/groups/{id} endpoint. + Performs a PUT request against the /company/contacts/{id}/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: ContactGroup: The parsed response data. """ - return self._parse_one( - ContactGroup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ContactGroup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdImageEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdImageEndpoint.py index 2859a2a0a..fda4ac2b2 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdImageEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdImageEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdImageEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "image", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "image", parent_endpoint=parent_endpoint) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a GET request against the /company/contacts/{id}/image endpoint. diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesCountEndpoint.py index f751a267e..d692dbe5c 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdNotesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdNotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/{id}/notes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/{id}/notes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesEndpoint.py index 8d72e6233..8f1158b14 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsIdNotesCountEndpoint import ( - CompanyContactsIdNotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsIdNotesIdEndpoint import ( - CompanyContactsIdNotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyContactsIdNotesCountEndpoint import CompanyContactsIdNotesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsIdNotesIdEndpoint import CompanyContactsIdNotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdNotesEndpoint( @@ -24,36 +18,29 @@ class CompanyContactsIdNotesEndpoint( IPostable[ContactNote, ConnectWiseManageRequestParams], IPaginateable[ContactNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactNote]) IPostable.__init__(self, ContactNote) IPaginateable.__init__(self, ContactNote) - self.count = self._register_child_endpoint( - CompanyContactsIdNotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyContactsIdNotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyContactsIdNotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsIdNotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsIdNotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsIdNotesIdEndpoint: The initialized CompanyContactsIdNotesIdEndpoint object. """ child = CompanyContactsIdNotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactNote]: """ Performs a GET request against the /company/contacts/{id}/notes endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ContactNote]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ContactNote]: """ Performs a GET request against the /company/contacts/{id}/notes endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ContactNote]: The parsed response data. """ - return self._parse_many( - ContactNote, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ContactNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactNote: """ Performs a POST request against the /company/contacts/{id}/notes endpoint. @@ -111,6 +83,4 @@ def post( Returns: ContactNote: The parsed response data. """ - return self._parse_one( - ContactNote, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ContactNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesIdEndpoint.py index 93461dc8b..c0490e631 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdNotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ContactNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdNotesIdEndpoint( ConnectWiseEndpoint, IGettable[ContactNote, ConnectWiseManageRequestParams], - IPuttable[ContactNote, ConnectWiseManageRequestParams], IPatchable[ContactNote, ConnectWiseManageRequestParams], + IPuttable[ContactNote, ConnectWiseManageRequestParams], IPaginateable[ContactNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactNote) - IPuttable.__init__(self, ContactNote) IPatchable.__init__(self, ContactNote) + IPuttable.__init__(self, ContactNote) IPaginateable.__init__(self, ContactNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactNote]: """ Performs a GET request against the /company/contacts/{id}/notes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/{id}/notes/{id} endpoint. + Performs a DELETE request against the /company/contacts/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactNote: The parsed response data. """ - return self._parse_one( - ContactNote, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactNote: """ - Performs a DELETE request against the /company/contacts/{id}/notes/{id} endpoint. + Performs a GET request against the /company/contacts/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ContactNote: """ - Performs a PUT request against the /company/contacts/{id}/notes/{id} endpoint. + Performs a PATCH request against the /company/contacts/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: ContactNote: The parsed response data. """ - return self._parse_one( - ContactNote, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ContactNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactNote: """ - Performs a PATCH request against the /company/contacts/{id}/notes/{id} endpoint. + Performs a PUT request against the /company/contacts/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: ContactNote: The parsed response data. """ - return self._parse_one( - ContactNote, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ContactNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdPortalsecurityEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdPortalsecurityEndpoint.py index 8f3c89bb0..129bf3365 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdPortalsecurityEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdPortalsecurityEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalSecurity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdPortalsecurityEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdPortalsecurityEndpoint( IGettable[list[PortalSecurity], ConnectWiseManageRequestParams], IPaginateable[PortalSecurity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "portalSecurity", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "portalSecurity", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalSecurity]) IPaginateable.__init__(self, PortalSecurity) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalSecurity]: """ Performs a GET request against the /company/contacts/{id}/portalSecurity endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalSecurity, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalSecurity, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalSecurity]: """ Performs a GET request against the /company/contacts/{id}/portalSecurity endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[PortalSecurity]: The parsed response data. """ - return self._parse_many( - PortalSecurity, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PortalSecurity, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksCountEndpoint.py index 6d52b5fb0..d8821b0c4 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdTracksCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdTracksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/{id}/tracks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/{id}/tracks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksEndpoint.py index 2fe97319e..8a8d127c2 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsIdTracksCountEndpoint import ( - CompanyContactsIdTracksCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsIdTracksIdEndpoint import ( - CompanyContactsIdTracksIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyContactsIdTracksCountEndpoint import CompanyContactsIdTracksCountEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsIdTracksIdEndpoint import CompanyContactsIdTracksIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactTrack from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdTracksEndpoint( @@ -24,36 +18,29 @@ class CompanyContactsIdTracksEndpoint( IPostable[ContactTrack, ConnectWiseManageRequestParams], IPaginateable[ContactTrack, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tracks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tracks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactTrack]) IPostable.__init__(self, ContactTrack) IPaginateable.__init__(self, ContactTrack) - self.count = self._register_child_endpoint( - CompanyContactsIdTracksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyContactsIdTracksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyContactsIdTracksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsIdTracksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsIdTracksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsIdTracksIdEndpoint: The initialized CompanyContactsIdTracksIdEndpoint object. """ child = CompanyContactsIdTracksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactTrack]: """ Performs a GET request against the /company/contacts/{id}/tracks endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactTrack, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactTrack, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ContactTrack]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ContactTrack]: """ Performs a GET request against the /company/contacts/{id}/tracks endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ContactTrack]: The parsed response data. """ - return self._parse_many( - ContactTrack, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ContactTrack, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactTrack: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactTrack: """ Performs a POST request against the /company/contacts/{id}/tracks endpoint. @@ -111,6 +83,4 @@ def post( Returns: ContactTrack: The parsed response data. """ - return self._parse_one( - ContactTrack, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ContactTrack, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksIdEndpoint.py index 0ee5d302e..4af0ca210 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTracksIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ContactTrack from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdTracksIdEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdTracksIdEndpoint( IGettable[ContactTrack, ConnectWiseManageRequestParams], IPaginateable[ContactTrack, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactTrack) IPaginateable.__init__(self, ContactTrack) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactTrack]: """ Performs a GET request against the /company/contacts/{id}/tracks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,42 +39,27 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactTrack, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactTrack, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactTrack: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/{id}/tracks/{id} endpoint. + Performs a DELETE request against the /company/contacts/{id}/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactTrack: The parsed response data. """ - return self._parse_one( - ContactTrack, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactTrack: """ - Performs a DELETE request against the /company/contacts/{id}/tracks/{id} endpoint. + Performs a GET request against the /company/contacts/{id}/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactTrack: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactTrack, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsCountEndpoint.py index ac6020e45..45ed9bd72 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdTypeassociationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdTypeassociationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/{id}/typeAssociations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/{id}/typeAssociations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsEndpoint.py index da27279b5..167f47d83 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsIdTypeassociationsCountEndpoint import ( CompanyContactsIdTypeassociationsCountEndpoint, @@ -5,72 +7,46 @@ from pyconnectwise.endpoints.manage.CompanyContactsIdTypeassociationsIdEndpoint import ( CompanyContactsIdTypeassociationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) -from pyconnectwise.models.manage import ( - ContactContactTypeAssociationContactTypeAssociation, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable +from pyconnectwise.models.manage import ContactContactTypeAssociationContactTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdTypeassociationsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[ContactContactTypeAssociationContactTypeAssociation], - ConnectWiseManageRequestParams, - ], - IPostable[ - ContactContactTypeAssociationContactTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPaginateable[ - ContactContactTypeAssociationContactTypeAssociation, - ConnectWiseManageRequestParams, - ], + IGettable[list[ContactContactTypeAssociationContactTypeAssociation], ConnectWiseManageRequestParams], + IPostable[ContactContactTypeAssociationContactTypeAssociation, ConnectWiseManageRequestParams], + IPaginateable[ContactContactTypeAssociationContactTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "typeAssociations", parent_endpoint=parent_endpoint - ) - IGettable.__init__( - self, list[ContactContactTypeAssociationContactTypeAssociation] - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "typeAssociations", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[ContactContactTypeAssociationContactTypeAssociation]) IPostable.__init__(self, ContactContactTypeAssociationContactTypeAssociation) - IPaginateable.__init__( - self, ContactContactTypeAssociationContactTypeAssociation - ) + IPaginateable.__init__(self, ContactContactTypeAssociationContactTypeAssociation) self.count = self._register_child_endpoint( CompanyContactsIdTypeassociationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyContactsIdTypeassociationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsIdTypeassociationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsIdTypeassociationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsIdTypeassociationsIdEndpoint: The initialized CompanyContactsIdTypeassociationsIdEndpoint object. """ - child = CompanyContactsIdTypeassociationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyContactsIdTypeassociationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactContactTypeAssociationContactTypeAssociation]: """ Performs a GET request against the /company/contacts/{id}/typeAssociations endpoint and returns an initialized PaginatedResponse object. @@ -97,9 +73,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ContactContactTypeAssociationContactTypeAssociation]: """ Performs a GET request against the /company/contacts/{id}/typeAssociations endpoint. @@ -116,9 +90,7 @@ def get( ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactContactTypeAssociationContactTypeAssociation: """ Performs a POST request against the /company/contacts/{id}/typeAssociations endpoint. diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsIdEndpoint.py index 48be8556d..dde7b2fab 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdTypeassociationsIdEndpoint.py @@ -1,56 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) -from pyconnectwise.models.manage import ( - ContactContactTypeAssociationContactTypeAssociation, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable +from pyconnectwise.models.manage import ContactContactTypeAssociationContactTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdTypeassociationsIdEndpoint( ConnectWiseEndpoint, - IGettable[ - ContactContactTypeAssociationContactTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPuttable[ - ContactContactTypeAssociationContactTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPatchable[ - ContactContactTypeAssociationContactTypeAssociation, - ConnectWiseManageRequestParams, - ], - IPaginateable[ - ContactContactTypeAssociationContactTypeAssociation, - ConnectWiseManageRequestParams, - ], + IGettable[ContactContactTypeAssociationContactTypeAssociation, ConnectWiseManageRequestParams], + IPatchable[ContactContactTypeAssociationContactTypeAssociation, ConnectWiseManageRequestParams], + IPuttable[ContactContactTypeAssociationContactTypeAssociation, ConnectWiseManageRequestParams], + IPaginateable[ContactContactTypeAssociationContactTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactContactTypeAssociationContactTypeAssociation) - IPuttable.__init__(self, ContactContactTypeAssociationContactTypeAssociation) IPatchable.__init__(self, ContactContactTypeAssociationContactTypeAssociation) - IPaginateable.__init__( - self, ContactContactTypeAssociationContactTypeAssociation - ) + IPuttable.__init__(self, ContactContactTypeAssociationContactTypeAssociation) + IPaginateable.__init__(self, ContactContactTypeAssociationContactTypeAssociation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactContactTypeAssociationContactTypeAssociation]: """ Performs a GET request against the /company/contacts/{id}/typeAssociations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -76,10 +51,18 @@ def paginated( params, ) + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: + """ + Performs a DELETE request against the /company/contacts/{id}/typeAssociations/{id} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + """ + super()._make_request("DELETE", data=data, params=params) + def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactContactTypeAssociationContactTypeAssociation: """ Performs a GET request against the /company/contacts/{id}/typeAssociations/{id} endpoint. @@ -95,27 +78,11 @@ def get( super()._make_request("GET", data=data, params=params).json(), ) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: - """ - Performs a DELETE request against the /company/contacts/{id}/typeAssociations/{id} endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - """ - super()._make_request("DELETE", data=data, params=params) - - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ContactContactTypeAssociationContactTypeAssociation: """ - Performs a PUT request against the /company/contacts/{id}/typeAssociations/{id} endpoint. + Performs a PATCH request against the /company/contacts/{id}/typeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,16 +92,14 @@ def put( """ return self._parse_one( ContactContactTypeAssociationContactTypeAssociation, - super()._make_request("PUT", data=data, params=params).json(), + super()._make_request("PATCH", data=data, params=params).json(), ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactContactTypeAssociationContactTypeAssociation: """ - Performs a PATCH request against the /company/contacts/{id}/typeAssociations/{id} endpoint. + Performs a PUT request against the /company/contacts/{id}/typeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -144,5 +109,5 @@ def patch( """ return self._parse_one( ContactContactTypeAssociationContactTypeAssociation, - super()._make_request("PATCH", data=data, params=params).json(), + super()._make_request("PUT", data=data, params=params).json(), ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesEndpoint.py index 8f8d6016f..f1f503b4b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsIdUsagesListEndpoint import ( - CompanyContactsIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyContactsIdUsagesListEndpoint import CompanyContactsIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdUsagesEndpoint( @@ -19,22 +16,15 @@ class CompanyContactsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - CompanyContactsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(CompanyContactsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/contacts/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/contacts/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesListEndpoint.py index 1de875a08..51373194e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/contacts/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/contacts/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsCountEndpoint.py index 89fc5d511..eaad4a7d5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsRelationshipsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsRelationshipsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/relationships/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/relationships/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsEndpoint.py index 1e055209d..a0ee253a6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContactsRelationshipsCountEndpoint import ( CompanyContactsRelationshipsCountEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyContactsRelationshipsIdEndpoint import ( - CompanyContactsRelationshipsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyContactsRelationshipsIdEndpoint import CompanyContactsRelationshipsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactRelationship from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsRelationshipsEndpoint( @@ -24,10 +20,8 @@ class CompanyContactsRelationshipsEndpoint( IPostable[ContactRelationship, ConnectWiseManageRequestParams], IPaginateable[ContactRelationship, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "relationships", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "relationships", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactRelationship]) IPostable.__init__(self, ContactRelationship) IPaginateable.__init__(self, ContactRelationship) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyContactsRelationshipsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyContactsRelationshipsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsRelationshipsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsRelationshipsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsRelationshipsIdEndpoint: The initialized CompanyContactsRelationshipsIdEndpoint object. """ - child = CompanyContactsRelationshipsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyContactsRelationshipsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactRelationship]: """ Performs a GET request against the /company/contacts/relationships endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactRelationship, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactRelationship, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ContactRelationship]: """ Performs a GET request against the /company/contacts/relationships endpoint. @@ -95,15 +77,10 @@ def get( Returns: list[ContactRelationship]: The parsed response data. """ - return self._parse_many( - ContactRelationship, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ContactRelationship, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactRelationship: """ Performs a POST request against the /company/contacts/relationships endpoint. @@ -114,7 +91,4 @@ def post( Returns: ContactRelationship: The parsed response data. """ - return self._parse_one( - ContactRelationship, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ContactRelationship, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsIdEndpoint.py index d4a603590..ac4233f8c 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsRelationshipsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ContactRelationship from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsRelationshipsIdEndpoint( ConnectWiseEndpoint, IGettable[ContactRelationship, ConnectWiseManageRequestParams], - IPuttable[ContactRelationship, ConnectWiseManageRequestParams], IPatchable[ContactRelationship, ConnectWiseManageRequestParams], + IPuttable[ContactRelationship, ConnectWiseManageRequestParams], IPaginateable[ContactRelationship, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactRelationship) - IPuttable.__init__(self, ContactRelationship) IPatchable.__init__(self, ContactRelationship) + IPuttable.__init__(self, ContactRelationship) IPaginateable.__init__(self, ContactRelationship) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactRelationship]: """ Performs a GET request against the /company/contacts/relationships/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactRelationship, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactRelationship, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactRelationship: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/relationships/{id} endpoint. + Performs a DELETE request against the /company/contacts/relationships/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactRelationship: The parsed response data. """ - return self._parse_one( - ContactRelationship, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ContactRelationship: """ - Performs a DELETE request against the /company/contacts/relationships/{id} endpoint. + Performs a GET request against the /company/contacts/relationships/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactRelationship: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactRelationship, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ContactRelationship: """ - Performs a PUT request against the /company/contacts/relationships/{id} endpoint. + Performs a PATCH request against the /company/contacts/relationships/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: ContactRelationship: The parsed response data. """ - return self._parse_one( - ContactRelationship, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ContactRelationship, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ContactRelationship: """ - Performs a PATCH request against the /company/contacts/relationships/{id} endpoint. + Performs a PUT request against the /company/contacts/relationships/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: ContactRelationship: The parsed response data. """ - return self._parse_one( - ContactRelationship, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ContactRelationship, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsRequestpasswordEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsRequestpasswordEndpoint.py index 38c369ed4..7fc9d8bff 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsRequestpasswordEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsRequestpasswordEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsRequestpasswordEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "requestPassword", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "requestPassword", parent_endpoint=parent_endpoint) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a POST request against the /company/contacts/requestPassword endpoint. diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountEndpoint.py index d142a5b30..0cf28fb9e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsTypesCountInfoEndpoint import ( - CompanyContactsTypesCountInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyContactsTypesCountInfoEndpoint import CompanyContactsTypesCountInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsTypesCountEndpoint( @@ -19,22 +16,15 @@ class CompanyContactsTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) - self.info = self._register_child_endpoint( - CompanyContactsTypesCountInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyContactsTypesCountInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/types/count endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/types/count endpoint. @@ -74,6 +53,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountInfoEndpoint.py index 653d3d522..95cdc0386 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesCountInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsTypesCountInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsTypesCountInfoEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contacts/types/count/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contacts/types/count/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesEndpoint.py index cde207074..2000f71e0 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsTypesCountEndpoint import ( - CompanyContactsTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsTypesIdEndpoint import ( - CompanyContactsTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsTypesInfoEndpoint import ( - CompanyContactsTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyContactsTypesCountEndpoint import CompanyContactsTypesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsTypesIdEndpoint import CompanyContactsTypesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsTypesInfoEndpoint import CompanyContactsTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ContactType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsTypesEndpoint( @@ -27,39 +19,30 @@ class CompanyContactsTypesEndpoint( IPostable[ContactType, ConnectWiseManageRequestParams], IPaginateable[ContactType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactType]) IPostable.__init__(self, ContactType) IPaginateable.__init__(self, ContactType) - self.count = self._register_child_endpoint( - CompanyContactsTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyContactsTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyContactsTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyContactsTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyContactsTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContactsTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContactsTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContactsTypesIdEndpoint: The initialized CompanyContactsTypesIdEndpoint object. """ child = CompanyContactsTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactType]: """ Performs a GET request against the /company/contacts/types endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ContactType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ContactType]: """ Performs a GET request against the /company/contacts/types endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[ContactType]: The parsed response data. """ - return self._parse_many( - ContactType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ContactType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactType: """ Performs a POST request against the /company/contacts/types endpoint. @@ -117,6 +85,4 @@ def post( Returns: ContactType: The parsed response data. """ - return self._parse_one( - ContactType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ContactType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdEndpoint.py index 7f059f261..0bda3085f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsTypesIdInfoEndpoint import ( - CompanyContactsTypesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyContactsTypesIdInfoEndpoint import CompanyContactsTypesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ContactType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsTypesIdEndpoint( ConnectWiseEndpoint, IGettable[ContactType, ConnectWiseManageRequestParams], - IPuttable[ContactType, ConnectWiseManageRequestParams], IPatchable[ContactType, ConnectWiseManageRequestParams], + IPuttable[ContactType, ConnectWiseManageRequestParams], IPaginateable[ContactType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactType) - IPuttable.__init__(self, ContactType) IPatchable.__init__(self, ContactType) + IPuttable.__init__(self, ContactType) IPaginateable.__init__(self, ContactType) - self.info = self._register_child_endpoint( - CompanyContactsTypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyContactsTypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactType]: """ Performs a GET request against the /company/contacts/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contacts/types/{id} endpoint. + Performs a DELETE request against the /company/contacts/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ContactType: The parsed response data. """ - return self._parse_one( - ContactType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactType: """ - Performs a DELETE request against the /company/contacts/types/{id} endpoint. + Performs a GET request against the /company/contacts/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ContactType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ContactType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ContactType: """ - Performs a PUT request against the /company/contacts/types/{id} endpoint. + Performs a PATCH request against the /company/contacts/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: ContactType: The parsed response data. """ - return self._parse_one( - ContactType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ContactType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactType: """ - Performs a PATCH request against the /company/contacts/types/{id} endpoint. + Performs a PUT request against the /company/contacts/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +93,4 @@ def patch( Returns: ContactType: The parsed response data. """ - return self._parse_one( - ContactType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ContactType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdInfoEndpoint.py index 7c366f022..de0605b81 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ContactTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsTypesIdInfoEndpoint( IGettable[ContactTypeInfo, ConnectWiseManageRequestParams], IPaginateable[ContactTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ContactTypeInfo) IPaginateable.__init__(self, ContactTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactTypeInfo]: """ Performs a GET request against the /company/contacts/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ContactTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ContactTypeInfo: """ Performs a GET request against the /company/contacts/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ContactTypeInfo: The parsed response data. """ - return self._parse_one( - ContactTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ContactTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesInfoEndpoint.py index 56af0568b..f2bb4f8c3 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsTypesInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ContactTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsTypesInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyContactsTypesInfoEndpoint( IGettable[list[ContactTypeInfo], ConnectWiseManageRequestParams], IPaginateable[ContactTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ContactTypeInfo]) IPaginateable.__init__(self, ContactTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ContactTypeInfo]: """ Performs a GET request against the /company/contacts/types/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ContactTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ContactTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ContactTypeInfo]: """ Performs a GET request against the /company/contacts/types/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[ContactTypeInfo]: The parsed response data. """ - return self._parse_many( - ContactTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ContactTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsValidateportalcredentialsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsValidateportalcredentialsEndpoint.py index 8b776ce71..a2658ce2d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsValidateportalcredentialsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsValidateportalcredentialsEndpoint.py @@ -1,28 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ValidatePortalResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContactsValidateportalcredentialsEndpoint( - ConnectWiseEndpoint, - IPostable[ValidatePortalResponse, ConnectWiseManageRequestParams], + ConnectWiseEndpoint, IPostable[ValidatePortalResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "validatePortalCredentials", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "validatePortalCredentials", parent_endpoint=parent_endpoint) IPostable.__init__(self, ValidatePortalResponse) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ValidatePortalResponse: """ Performs a POST request against the /company/contacts/validatePortalCredentials endpoint. @@ -33,7 +28,4 @@ def post( Returns: ValidatePortalResponse: The parsed response data. """ - return self._parse_one( - ValidatePortalResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ValidatePortalResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyCountEndpoint.py index 6b2367b6e..87fb83d01 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyCountEndpoint.py @@ -17,9 +17,7 @@ class CompanyContactsyncCompanyCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyEndpoint.py index e57b38022..c8a7f4c70 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyEndpoint.py @@ -23,15 +23,11 @@ class CompanyContactsyncCompanyEndpoint( IPaginateable[M365ContactSyncCompany, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "company", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "company", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[M365ContactSyncCompany]) IPaginateable.__init__(self, M365ContactSyncCompany) - self.count = self._register_child_endpoint( - CompanyContactsyncCompanyCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyContactsyncCompanyCountEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> CompanyContactsyncCompanyIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyIdEndpoint.py index 79ad9b6b6..5e5d018d6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanyIdEndpoint.py @@ -17,9 +17,7 @@ class CompanyContactsyncCompanyIdEndpoint( IPaginateable[M365ContactSyncCompany, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, M365ContactSyncCompany) IPaginateable.__init__(self, M365ContactSyncCompany) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncEndpoint.py index f295dae69..45d182dd8 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncEndpoint.py @@ -6,9 +6,7 @@ class CompanyContactsyncCompanysyncEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "companysync", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "companysync", parent_endpoint=parent_endpoint) def id(self, id: int) -> CompanyContactsyncCompanysyncIdEndpoint: # noqa: A002 """ @@ -19,8 +17,6 @@ def id(self, id: int) -> CompanyContactsyncCompanysyncIdEndpoint: # noqa: A002 Returns: CompanyContactsyncCompanysyncIdEndpoint: The initialized CompanyContactsyncCompanysyncIdEndpoint object. """ - child = CompanyContactsyncCompanysyncIdEndpoint( - self.client, parent_endpoint=self - ) + child = CompanyContactsyncCompanysyncIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncIdEndpoint.py index d2a8db524..03ab5ad8e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsyncCompanysyncIdEndpoint.py @@ -17,9 +17,7 @@ class CompanyContactsyncCompanysyncIdEndpoint( IPaginateable[M365ContactSyncCompany, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, M365ContactSyncCompany) IPaginateable.__init__(self, M365ContactSyncCompany) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContactsyncEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContactsyncEndpoint.py index 1232fcd5f..d32c76140 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContactsyncEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContactsyncEndpoint.py @@ -9,13 +9,9 @@ class CompanyContactsyncEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contactsync", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "contactsync", parent_endpoint=parent_endpoint) - self.company = self._register_child_endpoint( - CompanyContactsyncCompanyEndpoint(client, parent_endpoint=self) - ) + self.company = self._register_child_endpoint(CompanyContactsyncCompanyEndpoint(client, parent_endpoint=self)) self.companysync = self._register_child_endpoint( CompanyContactsyncCompanysyncEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsCountEndpoint.py index e53b9f96c..6afdea03f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContacttypeassociationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyContacttypeassociationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/contactTypeAssociations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/contactTypeAssociations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsEndpoint.py index 3ae657043..bf749d991 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyContacttypeassociationsCountEndpoint import ( CompanyContacttypeassociationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyContacttypeassociationsIdEndpoint import ( CompanyContacttypeassociationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyContactTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContacttypeassociationsEndpoint( @@ -24,10 +22,8 @@ class CompanyContacttypeassociationsEndpoint( IPostable[CompanyContactTypeAssociation, ConnectWiseManageRequestParams], IPaginateable[CompanyContactTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contactTypeAssociations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "contactTypeAssociations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyContactTypeAssociation]) IPostable.__init__(self, CompanyContactTypeAssociation) IPaginateable.__init__(self, CompanyContactTypeAssociation) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyContacttypeassociationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyContacttypeassociationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyContacttypeassociationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyContacttypeassociationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyContacttypeassociationsIdEndpoint: The initialized CompanyContacttypeassociationsIdEndpoint object. """ - child = CompanyContacttypeassociationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyContacttypeassociationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyContactTypeAssociation]: """ Performs a GET request against the /company/contactTypeAssociations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyContactTypeAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyContactTypeAssociation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyContactTypeAssociation]: """ Performs a GET request against the /company/contactTypeAssociations endpoint. @@ -96,14 +80,11 @@ def get( list[CompanyContactTypeAssociation]: The parsed response data. """ return self._parse_many( - CompanyContactTypeAssociation, - super()._make_request("GET", data=data, params=params).json(), + CompanyContactTypeAssociation, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyContactTypeAssociation: """ Performs a POST request against the /company/contactTypeAssociations endpoint. @@ -115,6 +96,5 @@ def post( CompanyContactTypeAssociation: The parsed response data. """ return self._parse_one( - CompanyContactTypeAssociation, - super()._make_request("POST", data=data, params=params).json(), + CompanyContactTypeAssociation, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsIdEndpoint.py index 1a55774ee..2fc9603cd 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyContacttypeassociationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyContactTypeAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyContacttypeassociationsIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyContactTypeAssociation, ConnectWiseManageRequestParams], - IPuttable[CompanyContactTypeAssociation, ConnectWiseManageRequestParams], IPatchable[CompanyContactTypeAssociation, ConnectWiseManageRequestParams], + IPuttable[CompanyContactTypeAssociation, ConnectWiseManageRequestParams], IPaginateable[CompanyContactTypeAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyContactTypeAssociation) - IPuttable.__init__(self, CompanyContactTypeAssociation) IPatchable.__init__(self, CompanyContactTypeAssociation) + IPuttable.__init__(self, CompanyContactTypeAssociation) IPaginateable.__init__(self, CompanyContactTypeAssociation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyContactTypeAssociation]: """ Performs a GET request against the /company/contactTypeAssociations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyContactTypeAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyContactTypeAssociation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyContactTypeAssociation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/contactTypeAssociations/{id} endpoint. + Performs a DELETE request against the /company/contactTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyContactTypeAssociation: The parsed response data. """ - return self._parse_one( - CompanyContactTypeAssociation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CompanyContactTypeAssociation: """ - Performs a DELETE request against the /company/contactTypeAssociations/{id} endpoint. + Performs a GET request against the /company/contactTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyContactTypeAssociation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + CompanyContactTypeAssociation, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> CompanyContactTypeAssociation: """ - Performs a PUT request against the /company/contactTypeAssociations/{id} endpoint. + Performs a PATCH request against the /company/contactTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( CompanyContactTypeAssociation: The parsed response data. """ return self._parse_one( - CompanyContactTypeAssociation, - super()._make_request("PUT", data=data, params=params).json(), + CompanyContactTypeAssociation, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyContactTypeAssociation: """ - Performs a PATCH request against the /company/contactTypeAssociations/{id} endpoint. + Performs a PUT request against the /company/contactTypeAssociations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( CompanyContactTypeAssociation: The parsed response data. """ return self._parse_one( - CompanyContactTypeAssociation, - super()._make_request("PATCH", data=data, params=params).json(), + CompanyContactTypeAssociation, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCountriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCountriesCountEndpoint.py index 930cc018b..42e3fc45b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCountriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCountriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCountriesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCountriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/countries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/countries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCountriesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCountriesEndpoint.py index b98506505..309b4756e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCountriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCountriesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCountriesCountEndpoint import ( - CompanyCountriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCountriesIdEndpoint import ( - CompanyCountriesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCountriesInfoEndpoint import ( - CompanyCountriesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyCountriesCountEndpoint import CompanyCountriesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyCountriesIdEndpoint import CompanyCountriesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyCountriesInfoEndpoint import CompanyCountriesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Country from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCountriesEndpoint( @@ -27,39 +19,30 @@ class CompanyCountriesEndpoint( IPostable[Country, ConnectWiseManageRequestParams], IPaginateable[Country, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "countries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "countries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Country]) IPostable.__init__(self, Country) IPaginateable.__init__(self, Country) - self.count = self._register_child_endpoint( - CompanyCountriesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyCountriesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCountriesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyCountriesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyCountriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyCountriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyCountriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyCountriesIdEndpoint: The initialized CompanyCountriesIdEndpoint object. """ child = CompanyCountriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Country]: """ Performs a GET request against the /company/countries endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Country, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Country, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Country]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Country]: """ Performs a GET request against the /company/countries endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Country]: The parsed response data. """ - return self._parse_many( - Country, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Country, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Country: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Country: """ Performs a POST request against the /company/countries endpoint. @@ -117,6 +83,4 @@ def post( Returns: Country: The parsed response data. """ - return self._parse_one( - Country, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Country, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCountriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCountriesIdEndpoint.py index 7ab204cbe..0393b764f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCountriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCountriesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCountriesIdInfoEndpoint import ( - CompanyCountriesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyCountriesIdInfoEndpoint import CompanyCountriesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Country from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCountriesIdEndpoint( ConnectWiseEndpoint, IGettable[Country, ConnectWiseManageRequestParams], - IPuttable[Country, ConnectWiseManageRequestParams], IPatchable[Country, ConnectWiseManageRequestParams], + IPuttable[Country, ConnectWiseManageRequestParams], IPaginateable[Country, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Country) - IPuttable.__init__(self, Country) IPatchable.__init__(self, Country) + IPuttable.__init__(self, Country) IPaginateable.__init__(self, Country) - self.info = self._register_child_endpoint( - CompanyCountriesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyCountriesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Country]: """ Performs a GET request against the /company/countries/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Country, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Country, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Country: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/countries/{id} endpoint. + Performs a DELETE request against the /company/countries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Country: The parsed response data. """ - return self._parse_one( - Country, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Country: """ - Performs a DELETE request against the /company/countries/{id} endpoint. + Performs a GET request against the /company/countries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Country: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Country, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Country: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Country: """ - Performs a PUT request against the /company/countries/{id} endpoint. + Performs a PATCH request against the /company/countries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: Country: The parsed response data. """ - return self._parse_one( - Country, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Country, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Country: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Country: """ - Performs a PATCH request against the /company/countries/{id} endpoint. + Performs a PUT request against the /company/countries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: Country: The parsed response data. """ - return self._parse_one( - Country, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Country, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCountriesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCountriesIdInfoEndpoint.py index db222c65d..cba316800 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCountriesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCountriesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CountryInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCountriesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyCountriesIdInfoEndpoint( IGettable[CountryInfo, ConnectWiseManageRequestParams], IPaginateable[CountryInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CountryInfo) IPaginateable.__init__(self, CountryInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CountryInfo]: """ Performs a GET request against the /company/countries/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CountryInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CountryInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CountryInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CountryInfo: """ Performs a GET request against the /company/countries/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: CountryInfo: The parsed response data. """ - return self._parse_one( - CountryInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CountryInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoCountEndpoint.py index a2e328a9c..a43fd527d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCountriesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyCountriesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/countries/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/countries/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoEndpoint.py index 68391ce70..c6ab1ea4b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyCountriesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyCountriesInfoCountEndpoint import ( - CompanyCountriesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyCountriesInfoCountEndpoint import CompanyCountriesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CountryInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyCountriesInfoEndpoint( @@ -19,22 +16,15 @@ class CompanyCountriesInfoEndpoint( IGettable[list[CountryInfo], ConnectWiseManageRequestParams], IPaginateable[CountryInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CountryInfo]) IPaginateable.__init__(self, CountryInfo) - self.count = self._register_child_endpoint( - CompanyCountriesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyCountriesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CountryInfo]: """ Performs a GET request against the /company/countries/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CountryInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CountryInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CountryInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CountryInfo]: """ Performs a GET request against the /company/countries/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[CountryInfo]: The parsed response data. """ - return self._parse_many( - CountryInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CountryInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyEndpoint.py index 0e121ee95..4fe7a3757 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyEndpoint.py @@ -1,192 +1,97 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyAddressformatsEndpoint import ( - CompanyAddressformatsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyBillingsetupsEndpoint import ( - CompanyBillingsetupsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCommunicationtypesEndpoint import ( - CompanyCommunicationtypesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompaniesEndpoint import ( - CompanyCompaniesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompanyfinanceEndpoint import ( - CompanyCompanyfinanceEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsEndpoint import ( - CompanyCompanypickeritemsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCompanytypeassociationsEndpoint import ( - CompanyCompanytypeassociationsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyConfigurationsEndpoint import ( - CompanyConfigurationsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactEndpoint import CompanyContactEndpoint -from pyconnectwise.endpoints.manage.CompanyContactsEndpoint import ( - CompanyContactsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContactsyncEndpoint import ( - CompanyContactsyncEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyContacttypeassociationsEndpoint import ( - CompanyContacttypeassociationsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyCountriesEndpoint import ( - CompanyCountriesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyEntitytypesEndpoint import ( - CompanyEntitytypesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyExpensetypesEndpoint import ( - CompanyExpensetypesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyM365contactEndpoint import ( - CompanyM365contactEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyM365contactsyncEndpoint import ( - CompanyM365contactsyncEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyAddressformatsEndpoint import CompanyAddressformatsEndpoint +from pyconnectwise.endpoints.manage.CompanyBillingsetupsEndpoint import CompanyBillingsetupsEndpoint +from pyconnectwise.endpoints.manage.CompanyCommunicationtypesEndpoint import CompanyCommunicationtypesEndpoint +from pyconnectwise.endpoints.manage.CompanyCompaniesEndpoint import CompanyCompaniesEndpoint +from pyconnectwise.endpoints.manage.CompanyCompanyfinanceEndpoint import CompanyCompanyfinanceEndpoint +from pyconnectwise.endpoints.manage.CompanyCompanypickeritemsEndpoint import CompanyCompanypickeritemsEndpoint +from pyconnectwise.endpoints.manage.CompanyCompanytypeassociationsEndpoint import CompanyCompanytypeassociationsEndpoint +from pyconnectwise.endpoints.manage.CompanyConfigurationsEndpoint import CompanyConfigurationsEndpoint +from pyconnectwise.endpoints.manage.CompanyContactsEndpoint import CompanyContactsEndpoint +from pyconnectwise.endpoints.manage.CompanyContacttypeassociationsEndpoint import CompanyContacttypeassociationsEndpoint +from pyconnectwise.endpoints.manage.CompanyCountriesEndpoint import CompanyCountriesEndpoint +from pyconnectwise.endpoints.manage.CompanyEntitytypesEndpoint import CompanyEntitytypesEndpoint +from pyconnectwise.endpoints.manage.CompanyExpensetypesEndpoint import CompanyExpensetypesEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsEndpoint import ( CompanyManageddevicesintegrationsEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyManagementbackupsEndpoint import ( - CompanyManagementbackupsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyManagementEndpoint import ( - CompanyManagementEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsEndpoint import ( - CompanyManagementitsolutionsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsEndpoint import ( - CompanyMarketdescriptionsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyNotetypesEndpoint import ( - CompanyNotetypesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyOwnershiptypesEndpoint import ( - CompanyOwnershiptypesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyPaymenttypesEndpoint import ( - CompanyPaymenttypesEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsEndpoint import ( - CompanyPortalconfigurationsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyPortalsecuritylevelsEndpoint import ( - CompanyPortalsecuritylevelsEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyPortalsecuritysettingsEndpoint import ( - CompanyPortalsecuritysettingsEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyManagementbackupsEndpoint import CompanyManagementbackupsEndpoint +from pyconnectwise.endpoints.manage.CompanyManagementEndpoint import CompanyManagementEndpoint +from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsEndpoint import CompanyManagementitsolutionsEndpoint +from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsEndpoint import CompanyMarketdescriptionsEndpoint +from pyconnectwise.endpoints.manage.CompanyNotetypesEndpoint import CompanyNotetypesEndpoint +from pyconnectwise.endpoints.manage.CompanyOwnershiptypesEndpoint import CompanyOwnershiptypesEndpoint +from pyconnectwise.endpoints.manage.CompanyPaymenttypesEndpoint import CompanyPaymenttypesEndpoint +from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsEndpoint import CompanyPortalconfigurationsEndpoint +from pyconnectwise.endpoints.manage.CompanyPortalsecuritylevelsEndpoint import CompanyPortalsecuritylevelsEndpoint +from pyconnectwise.endpoints.manage.CompanyPortalsecuritysettingsEndpoint import CompanyPortalsecuritysettingsEndpoint from pyconnectwise.endpoints.manage.CompanyStatesEndpoint import CompanyStatesEndpoint -from pyconnectwise.endpoints.manage.CompanyTeamrolesEndpoint import ( - CompanyTeamrolesEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyTeamrolesEndpoint import CompanyTeamrolesEndpoint from pyconnectwise.endpoints.manage.CompanyTracksEndpoint import CompanyTracksEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class CompanyEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "company", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "company", parent_endpoint=parent_endpoint) - self.portal_security_levels = self._register_child_endpoint( - CompanyPortalsecuritylevelsEndpoint(client, parent_endpoint=self) - ) self.address_formats = self._register_child_endpoint( CompanyAddressformatsEndpoint(client, parent_endpoint=self) ) - self.company_type_associations = self._register_child_endpoint( - CompanyCompanytypeassociationsEndpoint(client, parent_endpoint=self) - ) - self.portal_configurations = self._register_child_endpoint( - CompanyPortalconfigurationsEndpoint(client, parent_endpoint=self) - ) - self.team_roles = self._register_child_endpoint( - CompanyTeamrolesEndpoint(client, parent_endpoint=self) - ) - self.billing_setups = self._register_child_endpoint( - CompanyBillingsetupsEndpoint(client, parent_endpoint=self) - ) - self.contactsync = self._register_child_endpoint( - CompanyContactsyncEndpoint(client, parent_endpoint=self) - ) - self.m365contact = self._register_child_endpoint( - CompanyM365contactEndpoint(client, parent_endpoint=self) - ) - self.ownership_types = self._register_child_endpoint( - CompanyOwnershiptypesEndpoint(client, parent_endpoint=self) - ) - self.company_picker_items = self._register_child_endpoint( - CompanyCompanypickeritemsEndpoint(client, parent_endpoint=self) - ) + self.billing_setups = self._register_child_endpoint(CompanyBillingsetupsEndpoint(client, parent_endpoint=self)) self.communication_types = self._register_child_endpoint( CompanyCommunicationtypesEndpoint(client, parent_endpoint=self) ) - self.management = self._register_child_endpoint( - CompanyManagementEndpoint(client, parent_endpoint=self) - ) - self.entitytypes = self._register_child_endpoint( - CompanyEntitytypesEndpoint(client, parent_endpoint=self) - ) - self.note_types = self._register_child_endpoint( - CompanyNotetypesEndpoint(client, parent_endpoint=self) - ) - self.companies = self._register_child_endpoint( - CompanyCompaniesEndpoint(client, parent_endpoint=self) + self.companies = self._register_child_endpoint(CompanyCompaniesEndpoint(client, parent_endpoint=self)) + self.company_finance = self._register_child_endpoint( + CompanyCompanyfinanceEndpoint(client, parent_endpoint=self) ) - self.contact = self._register_child_endpoint( - CompanyContactEndpoint(client, parent_endpoint=self) + self.company_picker_items = self._register_child_endpoint( + CompanyCompanypickeritemsEndpoint(client, parent_endpoint=self) ) - self.expense_types = self._register_child_endpoint( - CompanyExpensetypesEndpoint(client, parent_endpoint=self) + self.company_type_associations = self._register_child_endpoint( + CompanyCompanytypeassociationsEndpoint(client, parent_endpoint=self) ) - self.configurations = self._register_child_endpoint( - CompanyConfigurationsEndpoint(client, parent_endpoint=self) + self.configurations = self._register_child_endpoint(CompanyConfigurationsEndpoint(client, parent_endpoint=self)) + self.contact_type_associations = self._register_child_endpoint( + CompanyContacttypeassociationsEndpoint(client, parent_endpoint=self) ) - self.states = self._register_child_endpoint( - CompanyStatesEndpoint(client, parent_endpoint=self) + self.contacts = self._register_child_endpoint(CompanyContactsEndpoint(client, parent_endpoint=self)) + self.countries = self._register_child_endpoint(CompanyCountriesEndpoint(client, parent_endpoint=self)) + self.entity_types = self._register_child_endpoint(CompanyEntitytypesEndpoint(client, parent_endpoint=self)) + self.entitytypes = self._register_child_endpoint(CompanyEntitytypesEndpoint(client, parent_endpoint=self)) + self.expense_types = self._register_child_endpoint(CompanyExpensetypesEndpoint(client, parent_endpoint=self)) + self.managed_devices_integrations = self._register_child_endpoint( + CompanyManageddevicesintegrationsEndpoint(client, parent_endpoint=self) ) - self.entity_types = self._register_child_endpoint( - CompanyEntitytypesEndpoint(client, parent_endpoint=self) + self.management = self._register_child_endpoint(CompanyManagementEndpoint(client, parent_endpoint=self)) + self.management_backups = self._register_child_endpoint( + CompanyManagementbackupsEndpoint(client, parent_endpoint=self) ) self.management_it_solutions = self._register_child_endpoint( CompanyManagementitsolutionsEndpoint(client, parent_endpoint=self) ) - self.managed_devices_integrations = self._register_child_endpoint( - CompanyManageddevicesintegrationsEndpoint(client, parent_endpoint=self) - ) self.market_descriptions = self._register_child_endpoint( CompanyMarketdescriptionsEndpoint(client, parent_endpoint=self) ) - self.tracks = self._register_child_endpoint( - CompanyTracksEndpoint(client, parent_endpoint=self) + self.note_types = self._register_child_endpoint(CompanyNotetypesEndpoint(client, parent_endpoint=self)) + self.ownership_types = self._register_child_endpoint( + CompanyOwnershiptypesEndpoint(client, parent_endpoint=self) ) - self.contacts = self._register_child_endpoint( - CompanyContactsEndpoint(client, parent_endpoint=self) + self.payment_types = self._register_child_endpoint(CompanyPaymenttypesEndpoint(client, parent_endpoint=self)) + self.portal_configurations = self._register_child_endpoint( + CompanyPortalconfigurationsEndpoint(client, parent_endpoint=self) ) - self.management_backups = self._register_child_endpoint( - CompanyManagementbackupsEndpoint(client, parent_endpoint=self) + self.portal_security_levels = self._register_child_endpoint( + CompanyPortalsecuritylevelsEndpoint(client, parent_endpoint=self) ) self.portal_security_settings = self._register_child_endpoint( CompanyPortalsecuritysettingsEndpoint(client, parent_endpoint=self) ) - self.contact_type_associations = self._register_child_endpoint( - CompanyContacttypeassociationsEndpoint(client, parent_endpoint=self) - ) - self.countries = self._register_child_endpoint( - CompanyCountriesEndpoint(client, parent_endpoint=self) - ) - self.company_finance = self._register_child_endpoint( - CompanyCompanyfinanceEndpoint(client, parent_endpoint=self) - ) - self.m365contactsync = self._register_child_endpoint( - CompanyM365contactsyncEndpoint(client, parent_endpoint=self) - ) - self.payment_types = self._register_child_endpoint( - CompanyPaymenttypesEndpoint(client, parent_endpoint=self) - ) + self.states = self._register_child_endpoint(CompanyStatesEndpoint(client, parent_endpoint=self)) + self.team_roles = self._register_child_endpoint(CompanyTeamrolesEndpoint(client, parent_endpoint=self)) + self.tracks = self._register_child_endpoint(CompanyTracksEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesCountEndpoint.py index 120b8e1f1..16ee6d500 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyEntitytypesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyEntitytypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/entityTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/entityTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesEndpoint.py index 4c016e92a..0d9e7cd6d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyEntitytypesIdEndpoint import ( - CompanyEntitytypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyEntitytypesInfoEndpoint import ( - CompanyEntitytypesInfoEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyEntitytypesIdEndpoint import CompanyEntitytypesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyEntitytypesInfoEndpoint import CompanyEntitytypesInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyEntitytypesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "entitytypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "entitytypes", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - CompanyEntitytypesInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyEntitytypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyEntitytypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyEntitytypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyEntitytypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyEntitytypesIdEndpoint: The initialized CompanyEntitytypesIdEndpoint object. """ child = CompanyEntitytypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdEndpoint.py index b64ced09e..c1aae764a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyEntitytypesIdInfoEndpoint import ( - CompanyEntitytypesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyEntitytypesIdInfoEndpoint import CompanyEntitytypesIdInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyEntitytypesIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - CompanyEntitytypesIdInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(CompanyEntitytypesIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdInfoEndpoint.py index 9bf5477ea..a79745f3e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import EntityTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyEntitytypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyEntitytypesIdInfoEndpoint( IGettable[EntityTypeInfo, ConnectWiseManageRequestParams], IPaginateable[EntityTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, EntityTypeInfo) IPaginateable.__init__(self, EntityTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EntityTypeInfo]: """ Performs a GET request against the /company/entitytypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EntityTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EntityTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EntityTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EntityTypeInfo: """ Performs a GET request against the /company/entitytypes/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: EntityTypeInfo: The parsed response data. """ - return self._parse_one( - EntityTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(EntityTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoCountEndpoint.py index b6aab9e54..793be1f09 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyEntitytypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyEntitytypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/entityTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/entityTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoEndpoint.py index 7d6356869..668f7d495 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyEntitytypesInfoEndpoint.py @@ -1,15 +1,57 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyEntitytypesInfoCountEndpoint import ( - CompanyEntitytypesInfoCountEndpoint, -) +from pyconnectwise.interfaces import IGettable, IPaginateable +from pyconnectwise.models.manage import EntityTypeInfo +from pyconnectwise.responses.paginated_response import PaginatedResponse +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class CompanyEntitytypesInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - self.count = self._register_child_endpoint( - CompanyEntitytypesInfoCountEndpoint(client, parent_endpoint=self) +class CompanyEntitytypesInfoEndpoint( + ConnectWiseEndpoint, + IGettable[list[EntityTypeInfo], ConnectWiseManageRequestParams], + IPaginateable[EntityTypeInfo, ConnectWiseManageRequestParams], +): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[EntityTypeInfo]) + IPaginateable.__init__(self, EntityTypeInfo) + + def paginated( + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[EntityTypeInfo]: + """ + Performs a GET request against the /company/entitytypes/info endpoint and returns an initialized PaginatedResponse object. + + Parameters: + page (int): The page number to request. + page_size (int): The number of results to return per page. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaginatedResponse[EntityTypeInfo]: The initialized PaginatedResponse object. + """ + if params: + params["page"] = page + params["pageSize"] = page_size + else: + params = {"page": page, "pageSize": page_size} + return PaginatedResponse( + super()._make_request("GET", params=params), EntityTypeInfo, self, page, page_size, params ) + + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> list[EntityTypeInfo]: + """ + Performs a GET request against the /company/entitytypes/info endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + list[EntityTypeInfo]: The parsed response data. + """ + return self._parse_many(EntityTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyExpensetypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyExpensetypesEndpoint.py index b322d3a67..3ca40490e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyExpensetypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyExpensetypesEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyExpensetypesInfoEndpoint import ( - CompanyExpensetypesInfoEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyExpensetypesInfoEndpoint import CompanyExpensetypesInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyExpensetypesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "expenseTypes", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - CompanyExpensetypesInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "expenseTypes", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(CompanyExpensetypesInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoCountEndpoint.py index 89fda89a3..e2376cefe 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyExpensetypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyExpensetypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/expenseTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/expenseTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoEndpoint.py index 174411416..0948a9e26 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyExpensetypesInfoEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyExpensetypesInfoCountEndpoint import ( - CompanyExpensetypesInfoCountEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyExpensetypesInfoCountEndpoint import CompanyExpensetypesInfoCountEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyExpensetypesInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - - self.count = self._register_child_endpoint( - CompanyExpensetypesInfoCountEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + + self.count = self._register_child_endpoint(CompanyExpensetypesInfoCountEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactCountEndpoint.py index f580e775b..19e330434 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactCountEndpoint.py @@ -17,9 +17,7 @@ class CompanyM365contactCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactEndpoint.py index 33a6343f3..9b6d5a1a8 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactEndpoint.py @@ -23,15 +23,11 @@ class CompanyM365contactEndpoint( IPaginateable[M365Contact, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "m365contact", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "m365contact", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[M365Contact]) IPaginateable.__init__(self, M365Contact) - self.count = self._register_child_endpoint( - CompanyM365contactCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyM365contactCountEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> CompanyM365contactIdEndpoint: # noqa: A002 """ @@ -90,6 +86,4 @@ def get( Returns: list[M365Contact]: The parsed response data. """ - return self._parse_many( - M365Contact, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(M365Contact, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactIdEndpoint.py index 7b2cf3586..32c94c958 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactIdEndpoint.py @@ -17,9 +17,7 @@ class CompanyM365contactIdEndpoint( IPaginateable[M365Contact, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, M365Contact) IPaginateable.__init__(self, M365Contact) @@ -67,6 +65,4 @@ def get( Returns: M365Contact: The parsed response data. """ - return self._parse_one( - M365Contact, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(M365Contact, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncEndpoint.py index ac9ffabe7..09c7b9b7e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncEndpoint.py @@ -9,9 +9,7 @@ class CompanyM365contactsyncEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "m365contactsync", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "m365contactsync", parent_endpoint=parent_endpoint) self.property = self._register_child_endpoint( CompanyM365contactsyncPropertyEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdEndpoint.py index 15325ff03..ce3ba9d35 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdEndpoint.py @@ -6,9 +6,7 @@ class CompanyM365contactsyncIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.property = self._register_child_endpoint( CompanyM365contactsyncIdPropertyEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdPropertyEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdPropertyEndpoint.py index 2038539b2..65b3dfd08 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdPropertyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncIdPropertyEndpoint.py @@ -17,9 +17,7 @@ class CompanyM365contactsyncIdPropertyEndpoint( IPaginateable[M365ContactSyncProperty, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "property", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "property", parent_endpoint=parent_endpoint) IGettable.__init__(self, M365ContactSyncProperty) IPaginateable.__init__(self, M365ContactSyncProperty) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyCountEndpoint.py index b5891047b..adc864c4b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyCountEndpoint.py @@ -17,9 +17,7 @@ class CompanyM365contactsyncPropertyCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyEndpoint.py index 532ef3b52..2b368a225 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyEndpoint.py @@ -23,9 +23,7 @@ class CompanyM365contactsyncPropertyEndpoint( IPostable[M365ContactSyncProperty, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "property", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "property", parent_endpoint=parent_endpoint) IPostable.__init__(self, M365ContactSyncProperty) self.count = self._register_child_endpoint( diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyExcludedEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyExcludedEndpoint.py index e1c9ddcfe..dff9a9e16 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyExcludedEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyExcludedEndpoint.py @@ -17,9 +17,7 @@ class CompanyM365contactsyncPropertyExcludedEndpoint( IPaginateable[M365ContactSyncProperty, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "excluded", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "excluded", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[M365ContactSyncProperty]) IPaginateable.__init__(self, M365ContactSyncProperty) diff --git a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyIncludedEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyIncludedEndpoint.py index 08ebbff45..6e5dd8dec 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyIncludedEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyM365contactsyncPropertyIncludedEndpoint.py @@ -17,9 +17,7 @@ class CompanyM365contactsyncPropertyIncludedEndpoint( IPaginateable[M365ContactSyncProperty, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "included", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "included", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[M365ContactSyncProperty]) IPaginateable.__init__(self, M365ContactSyncProperty) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsCountEndpoint.py index 5fcaf9463..c34d73fda 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManageddevicesintegrationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managedDevicesIntegrations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managedDevicesIntegrations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsEndpoint.py index 6ca23e7ef..ac5eac994 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsCountEndpoint import ( CompanyManageddevicesintegrationsCountEndpoint, @@ -8,17 +10,13 @@ from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsInfoEndpoint import ( CompanyManageddevicesintegrationsInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagedDevicesIntegration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsEndpoint( @@ -27,10 +25,8 @@ class CompanyManageddevicesintegrationsEndpoint( IPostable[ManagedDevicesIntegration, ConnectWiseManageRequestParams], IPaginateable[ManagedDevicesIntegration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managedDevicesIntegrations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managedDevicesIntegrations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagedDevicesIntegration]) IPostable.__init__(self, ManagedDevicesIntegration) IPaginateable.__init__(self, ManagedDevicesIntegration) @@ -42,26 +38,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyManageddevicesintegrationsInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyManageddevicesintegrationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyManageddevicesintegrationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManageddevicesintegrationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManageddevicesintegrationsIdEndpoint: The initialized CompanyManageddevicesintegrationsIdEndpoint object. """ - child = CompanyManageddevicesintegrationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyManageddevicesintegrationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegration]: """ Performs a GET request against the /company/managedDevicesIntegrations endpoint and returns an initialized PaginatedResponse object. @@ -79,18 +70,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagedDevicesIntegration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagedDevicesIntegration, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagedDevicesIntegration]: """ Performs a GET request against the /company/managedDevicesIntegrations endpoint. @@ -102,14 +86,11 @@ def get( list[ManagedDevicesIntegration]: The parsed response data. """ return self._parse_many( - ManagedDevicesIntegration, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegration, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegration: """ Performs a POST request against the /company/managedDevicesIntegrations endpoint. @@ -121,6 +102,5 @@ def post( ManagedDevicesIntegration: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegration, - super()._make_request("POST", data=data, params=params).json(), + ManagedDevicesIntegration, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint.py index 16891613c..4ce7e3b35 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/crossReferences/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/crossReferences/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesEndpoint.py index 8898f1aa2..d7f520635 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint import ( CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint, @@ -5,65 +7,46 @@ from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint import ( CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagedDevicesIntegrationCrossReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdCrossreferencesEndpoint( ConnectWiseEndpoint, - IGettable[ - list[ManagedDevicesIntegrationCrossReference], ConnectWiseManageRequestParams - ], + IGettable[list[ManagedDevicesIntegrationCrossReference], ConnectWiseManageRequestParams], IPostable[ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams], - IPaginateable[ - ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams - ], + IPaginateable[ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "crossReferences", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "crossReferences", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagedDevicesIntegrationCrossReference]) IPostable.__init__(self, ManagedDevicesIntegrationCrossReference) IPaginateable.__init__(self, ManagedDevicesIntegrationCrossReference) self.count = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsIdCrossreferencesCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint: + def id(self, _id: int) -> CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint: The initialized CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint object. """ - child = CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationCrossReference]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/crossReferences endpoint and returns an initialized PaginatedResponse object. @@ -90,9 +73,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagedDevicesIntegrationCrossReference]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/crossReferences endpoint. @@ -104,14 +85,11 @@ def get( list[ManagedDevicesIntegrationCrossReference]: The parsed response data. """ return self._parse_many( - ManagedDevicesIntegrationCrossReference, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationCrossReference, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationCrossReference: """ Performs a POST request against the /company/managedDevicesIntegrations/{id}/crossReferences endpoint. @@ -123,6 +101,5 @@ def post( ManagedDevicesIntegrationCrossReference: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationCrossReference, - super()._make_request("POST", data=data, params=params).json(), + ManagedDevicesIntegrationCrossReference, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint.py index de1b8d027..524bf0473 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint.py @@ -1,45 +1,33 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IDeleteable, - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IDeleteable, IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagedDevicesIntegrationCrossReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdCrossreferencesIdEndpoint( ConnectWiseEndpoint, + IDeleteable[ConnectWiseManageRequestParams], IGettable[ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams], - IPuttable[ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams], IPatchable[ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams], - IDeleteable[ConnectWiseManageRequestParams], - IPaginateable[ - ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams - ], + IPuttable[ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams], + IPaginateable[ManagedDevicesIntegrationCrossReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IDeleteable.__init__(self, None) IGettable.__init__(self, ManagedDevicesIntegrationCrossReference) - IPuttable.__init__(self, ManagedDevicesIntegrationCrossReference) IPatchable.__init__(self, ManagedDevicesIntegrationCrossReference) - IDeleteable.__init__(self, None) + IPuttable.__init__(self, ManagedDevicesIntegrationCrossReference) IPaginateable.__init__(self, ManagedDevicesIntegrationCrossReference) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationCrossReference]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,13 +53,11 @@ def paginated( params, ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def delete( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationCrossReference: """ - Performs a GET request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint. + Performs a DELETE request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -80,17 +66,14 @@ def get( ManagedDevicesIntegrationCrossReference: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationCrossReference, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationCrossReference, super()._make_request("DELETE", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationCrossReference: """ - Performs a PUT request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint. + Performs a GET request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -99,14 +82,11 @@ def put( ManagedDevicesIntegrationCrossReference: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationCrossReference, - super()._make_request("PUT", data=data, params=params).json(), + ManagedDevicesIntegrationCrossReference, super()._make_request("GET", data=data, params=params).json() ) def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationCrossReference: """ Performs a PATCH request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint. @@ -118,17 +98,14 @@ def patch( ManagedDevicesIntegrationCrossReference: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationCrossReference, - super()._make_request("PATCH", data=data, params=params).json(), + ManagedDevicesIntegrationCrossReference, super()._make_request("PATCH", data=data, params=params).json() ) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationCrossReference: """ - Performs a DELETE request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint. + Performs a PUT request against the /company/managedDevicesIntegrations/{id}/crossReferences/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +114,5 @@ def delete( ManagedDevicesIntegrationCrossReference: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationCrossReference, - super()._make_request("DELETE", data=data, params=params).json(), + ManagedDevicesIntegrationCrossReference, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdEndpoint.py index 5464825f0..0e401c2dd 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdCrossreferencesEndpoint import ( CompanyManageddevicesintegrationsIdCrossreferencesEndpoint, @@ -14,68 +16,47 @@ from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdUsagesEndpoint import ( CompanyManageddevicesintegrationsIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagedDevicesIntegration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdEndpoint( ConnectWiseEndpoint, IGettable[ManagedDevicesIntegration, ConnectWiseManageRequestParams], - IPuttable[ManagedDevicesIntegration, ConnectWiseManageRequestParams], IPatchable[ManagedDevicesIntegration, ConnectWiseManageRequestParams], + IPuttable[ManagedDevicesIntegration, ConnectWiseManageRequestParams], IPaginateable[ManagedDevicesIntegration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManagedDevicesIntegration) - IPuttable.__init__(self, ManagedDevicesIntegration) IPatchable.__init__(self, ManagedDevicesIntegration) + IPuttable.__init__(self, ManagedDevicesIntegration) IPaginateable.__init__(self, ManagedDevicesIntegration) + self.cross_references = self._register_child_endpoint( + CompanyManageddevicesintegrationsIdCrossreferencesEndpoint(client, parent_endpoint=self) + ) self.info = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdInfoEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsIdInfoEndpoint(client, parent_endpoint=self) ) self.logins = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdLoginsEndpoint( - client, parent_endpoint=self - ) - ) - self.usages = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdUsagesEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsIdLoginsEndpoint(client, parent_endpoint=self) ) self.notifications = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdNotificationsEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsIdNotificationsEndpoint(client, parent_endpoint=self) ) - self.cross_references = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdCrossreferencesEndpoint( - client, parent_endpoint=self - ) + self.usages = self._register_child_endpoint( + CompanyManageddevicesintegrationsIdUsagesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegration]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -93,54 +74,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagedDevicesIntegration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagedDevicesIntegration, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagedDevicesIntegration: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/managedDevicesIntegrations/{id} endpoint. + Performs a DELETE request against the /company/managedDevicesIntegrations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ManagedDevicesIntegration: The parsed response data. """ - return self._parse_one( - ManagedDevicesIntegration, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ManagedDevicesIntegration: """ - Performs a DELETE request against the /company/managedDevicesIntegrations/{id} endpoint. + Performs a GET request against the /company/managedDevicesIntegrations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ManagedDevicesIntegration: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ManagedDevicesIntegration, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegration: """ - Performs a PUT request against the /company/managedDevicesIntegrations/{id} endpoint. + Performs a PATCH request against the /company/managedDevicesIntegrations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -149,17 +114,14 @@ def put( ManagedDevicesIntegration: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegration, - super()._make_request("PUT", data=data, params=params).json(), + ManagedDevicesIntegration, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegration: """ - Performs a PATCH request against the /company/managedDevicesIntegrations/{id} endpoint. + Performs a PUT request against the /company/managedDevicesIntegrations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -167,7 +129,4 @@ def patch( Returns: ManagedDevicesIntegration: The parsed response data. """ - return self._parse_one( - ManagedDevicesIntegration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ManagedDevicesIntegration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdInfoEndpoint.py index 02f6fcc4f..1e7aaeb4f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ManagedDevicesIntegrationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyManageddevicesintegrationsIdInfoEndpoint( IGettable[ManagedDevicesIntegrationInfo, ConnectWiseManageRequestParams], IPaginateable[ManagedDevicesIntegrationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManagedDevicesIntegrationInfo) IPaginateable.__init__(self, ManagedDevicesIntegrationInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationInfo]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagedDevicesIntegrationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagedDevicesIntegrationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationInfo: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/info endpoint. @@ -68,6 +55,5 @@ def get( ManagedDevicesIntegrationInfo: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationInfo, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsCountEndpoint.py index a92da8f38..ba4149998 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdLoginsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManageddevicesintegrationsIdLoginsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/logins/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/logins/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsEndpoint.py index 616533041..bcfb70021 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdLoginsCountEndpoint import ( CompanyManageddevicesintegrationsIdLoginsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdLoginsIdEndpoint import ( CompanyManageddevicesintegrationsIdLoginsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagedDevicesIntegrationLogin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdLoginsEndpoint( @@ -24,42 +22,31 @@ class CompanyManageddevicesintegrationsIdLoginsEndpoint( IPostable[ManagedDevicesIntegrationLogin, ConnectWiseManageRequestParams], IPaginateable[ManagedDevicesIntegrationLogin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "logins", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "logins", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagedDevicesIntegrationLogin]) IPostable.__init__(self, ManagedDevicesIntegrationLogin) IPaginateable.__init__(self, ManagedDevicesIntegrationLogin) self.count = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdLoginsCountEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsIdLoginsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyManageddevicesintegrationsIdLoginsIdEndpoint: + def id(self, _id: int) -> CompanyManageddevicesintegrationsIdLoginsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManageddevicesintegrationsIdLoginsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManageddevicesintegrationsIdLoginsIdEndpoint: The initialized CompanyManageddevicesintegrationsIdLoginsIdEndpoint object. """ - child = CompanyManageddevicesintegrationsIdLoginsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyManageddevicesintegrationsIdLoginsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationLogin]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/logins endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagedDevicesIntegrationLogin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagedDevicesIntegrationLogin, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagedDevicesIntegrationLogin]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/logins endpoint. @@ -100,14 +80,11 @@ def get( list[ManagedDevicesIntegrationLogin]: The parsed response data. """ return self._parse_many( - ManagedDevicesIntegrationLogin, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationLogin, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationLogin: """ Performs a POST request against the /company/managedDevicesIntegrations/{id}/logins endpoint. @@ -119,6 +96,5 @@ def post( ManagedDevicesIntegrationLogin: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationLogin, - super()._make_request("POST", data=data, params=params).json(), + ManagedDevicesIntegrationLogin, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsIdEndpoint.py index f14c9fea9..3707d7c4f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdLoginsIdEndpoint.py @@ -1,43 +1,33 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IDeleteable, - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IDeleteable, IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagedDevicesIntegrationLogin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdLoginsIdEndpoint( ConnectWiseEndpoint, + IDeleteable[ConnectWiseManageRequestParams], IGettable[ManagedDevicesIntegrationLogin, ConnectWiseManageRequestParams], - IPuttable[ManagedDevicesIntegrationLogin, ConnectWiseManageRequestParams], IPatchable[ManagedDevicesIntegrationLogin, ConnectWiseManageRequestParams], - IDeleteable[ConnectWiseManageRequestParams], + IPuttable[ManagedDevicesIntegrationLogin, ConnectWiseManageRequestParams], IPaginateable[ManagedDevicesIntegrationLogin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IDeleteable.__init__(self, None) IGettable.__init__(self, ManagedDevicesIntegrationLogin) - IPuttable.__init__(self, ManagedDevicesIntegrationLogin) IPatchable.__init__(self, ManagedDevicesIntegrationLogin) - IDeleteable.__init__(self, None) + IPuttable.__init__(self, ManagedDevicesIntegrationLogin) IPaginateable.__init__(self, ManagedDevicesIntegrationLogin) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationLogin]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint and returns an initialized PaginatedResponse object. @@ -55,21 +45,14 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagedDevicesIntegrationLogin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagedDevicesIntegrationLogin, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def delete( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationLogin: """ - Performs a GET request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint. + Performs a DELETE request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -78,17 +61,14 @@ def get( ManagedDevicesIntegrationLogin: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationLogin, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationLogin, super()._make_request("DELETE", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationLogin: """ - Performs a PUT request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint. + Performs a GET request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -97,14 +77,11 @@ def put( ManagedDevicesIntegrationLogin: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationLogin, - super()._make_request("PUT", data=data, params=params).json(), + ManagedDevicesIntegrationLogin, super()._make_request("GET", data=data, params=params).json() ) def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationLogin: """ Performs a PATCH request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint. @@ -116,17 +93,14 @@ def patch( ManagedDevicesIntegrationLogin: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationLogin, - super()._make_request("PATCH", data=data, params=params).json(), + ManagedDevicesIntegrationLogin, super()._make_request("PATCH", data=data, params=params).json() ) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationLogin: """ - Performs a DELETE request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint. + Performs a PUT request against the /company/managedDevicesIntegrations/{id}/logins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,6 +109,5 @@ def delete( ManagedDevicesIntegrationLogin: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationLogin, - super()._make_request("DELETE", data=data, params=params).json(), + ManagedDevicesIntegrationLogin, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsCountEndpoint.py index 854a170bc..b2175ba66 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdNotificationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManageddevicesintegrationsIdNotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/notifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/notifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsEndpoint.py index 3daba88b4..e1fe273f3 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdNotificationsCountEndpoint import ( CompanyManageddevicesintegrationsIdNotificationsCountEndpoint, @@ -5,65 +7,46 @@ from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdNotificationsIdEndpoint import ( CompanyManageddevicesintegrationsIdNotificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagedDevicesIntegrationNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdNotificationsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[ManagedDevicesIntegrationNotification], ConnectWiseManageRequestParams - ], + IGettable[list[ManagedDevicesIntegrationNotification], ConnectWiseManageRequestParams], IPostable[ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams], - IPaginateable[ - ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams - ], + IPaginateable[ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagedDevicesIntegrationNotification]) IPostable.__init__(self, ManagedDevicesIntegrationNotification) IPaginateable.__init__(self, ManagedDevicesIntegrationNotification) self.count = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdNotificationsCountEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsIdNotificationsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyManageddevicesintegrationsIdNotificationsIdEndpoint: + def id(self, _id: int) -> CompanyManageddevicesintegrationsIdNotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManageddevicesintegrationsIdNotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManageddevicesintegrationsIdNotificationsIdEndpoint: The initialized CompanyManageddevicesintegrationsIdNotificationsIdEndpoint object. """ - child = CompanyManageddevicesintegrationsIdNotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyManageddevicesintegrationsIdNotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationNotification]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/notifications endpoint and returns an initialized PaginatedResponse object. @@ -90,9 +73,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagedDevicesIntegrationNotification]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/notifications endpoint. @@ -104,14 +85,11 @@ def get( list[ManagedDevicesIntegrationNotification]: The parsed response data. """ return self._parse_many( - ManagedDevicesIntegrationNotification, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationNotification, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationNotification: """ Performs a POST request against the /company/managedDevicesIntegrations/{id}/notifications endpoint. @@ -123,6 +101,5 @@ def post( ManagedDevicesIntegrationNotification: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationNotification, - super()._make_request("POST", data=data, params=params).json(), + ManagedDevicesIntegrationNotification, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsIdEndpoint.py index f60d899ea..bd86fd27d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdNotificationsIdEndpoint.py @@ -1,45 +1,33 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IDeleteable, - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IDeleteable, IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagedDevicesIntegrationNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdNotificationsIdEndpoint( ConnectWiseEndpoint, + IDeleteable[ConnectWiseManageRequestParams], IGettable[ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams], - IPuttable[ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams], IPatchable[ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams], - IDeleteable[ConnectWiseManageRequestParams], - IPaginateable[ - ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams - ], + IPuttable[ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams], + IPaginateable[ManagedDevicesIntegrationNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IDeleteable.__init__(self, None) IGettable.__init__(self, ManagedDevicesIntegrationNotification) - IPuttable.__init__(self, ManagedDevicesIntegrationNotification) IPatchable.__init__(self, ManagedDevicesIntegrationNotification) - IDeleteable.__init__(self, None) + IPuttable.__init__(self, ManagedDevicesIntegrationNotification) IPaginateable.__init__(self, ManagedDevicesIntegrationNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationNotification]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,13 +53,11 @@ def paginated( params, ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def delete( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationNotification: """ - Performs a GET request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint. + Performs a DELETE request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -80,17 +66,14 @@ def get( ManagedDevicesIntegrationNotification: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationNotification, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationNotification, super()._make_request("DELETE", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationNotification: """ - Performs a PUT request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint. + Performs a GET request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -99,14 +82,11 @@ def put( ManagedDevicesIntegrationNotification: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationNotification, - super()._make_request("PUT", data=data, params=params).json(), + ManagedDevicesIntegrationNotification, super()._make_request("GET", data=data, params=params).json() ) def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationNotification: """ Performs a PATCH request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint. @@ -118,17 +98,14 @@ def patch( ManagedDevicesIntegrationNotification: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationNotification, - super()._make_request("PATCH", data=data, params=params).json(), + ManagedDevicesIntegrationNotification, super()._make_request("PATCH", data=data, params=params).json() ) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagedDevicesIntegrationNotification: """ - Performs a DELETE request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint. + Performs a PUT request against the /company/managedDevicesIntegrations/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +114,5 @@ def delete( ManagedDevicesIntegrationNotification: The parsed response data. """ return self._parse_one( - ManagedDevicesIntegrationNotification, - super()._make_request("DELETE", data=data, params=params).json(), + ManagedDevicesIntegrationNotification, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesEndpoint.py index a1dc0984a..7863df33f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsIdUsagesListEndpoint import ( CompanyManageddevicesintegrationsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdUsagesEndpoint( @@ -19,24 +18,17 @@ class CompanyManageddevicesintegrationsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - CompanyManageddevicesintegrationsIdUsagesListEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesListEndpoint.py index 6f54157ff..90456d36c 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyManageddevicesintegrationsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/managedDevicesIntegrations/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoCountEndpoint.py index ecdc853fa..69a801d0a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManageddevicesintegrationsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managedDevicesIntegrations/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managedDevicesIntegrations/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoEndpoint.py index 7ba44c213..1c3062c68 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManageddevicesintegrationsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManageddevicesintegrationsInfoCountEndpoint import ( CompanyManageddevicesintegrationsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ManagedDevicesIntegrationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManageddevicesintegrationsInfoEndpoint( @@ -19,24 +18,17 @@ class CompanyManageddevicesintegrationsInfoEndpoint( IGettable[list[ManagedDevicesIntegrationInfo], ConnectWiseManageRequestParams], IPaginateable[ManagedDevicesIntegrationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagedDevicesIntegrationInfo]) IPaginateable.__init__(self, ManagedDevicesIntegrationInfo) self.count = self._register_child_endpoint( - CompanyManageddevicesintegrationsInfoCountEndpoint( - client, parent_endpoint=self - ) + CompanyManageddevicesintegrationsInfoCountEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDevicesIntegrationInfo]: """ Performs a GET request against the /company/managedDevicesIntegrations/info endpoint and returns an initialized PaginatedResponse object. @@ -54,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagedDevicesIntegrationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagedDevicesIntegrationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagedDevicesIntegrationInfo]: """ Performs a GET request against the /company/managedDevicesIntegrations/info endpoint. @@ -77,6 +62,5 @@ def get( list[ManagedDevicesIntegrationInfo]: The parsed response data. """ return self._parse_many( - ManagedDevicesIntegrationInfo, - super()._make_request("GET", data=data, params=params).json(), + ManagedDevicesIntegrationInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementCountEndpoint.py index 3c0de0aff..2c3019739 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManagementCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/management/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/management/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementEndpoint.py index c5445f7a0..41401e098 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyManagementCountEndpoint import ( - CompanyManagementCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyManagementIdEndpoint import ( - CompanyManagementIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyManagementCountEndpoint import CompanyManagementCountEndpoint +from pyconnectwise.endpoints.manage.CompanyManagementIdEndpoint import CompanyManagementIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Management from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementEndpoint( @@ -22,35 +17,28 @@ class CompanyManagementEndpoint( IGettable[list[Management], ConnectWiseManageRequestParams], IPaginateable[Management, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "management", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "management", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Management]) IPaginateable.__init__(self, Management) - self.count = self._register_child_endpoint( - CompanyManagementCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyManagementCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyManagementIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyManagementIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManagementIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManagementIdEndpoint: The initialized CompanyManagementIdEndpoint object. """ child = CompanyManagementIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Management]: """ Performs a GET request against the /company/management endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Management, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Management, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Management]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Management]: """ Performs a GET request against the /company/management endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[Management]: The parsed response data. """ - return self._parse_many( - Management, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Management, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdEndpoint.py index 565094d0d..1ec431bb6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdEndpoint.py @@ -1,69 +1,48 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManagementIdExecutemanageditsyncEndpoint import ( CompanyManagementIdExecutemanageditsyncEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyManagementIdLogEndpoint import ( - CompanyManagementIdLogEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyManagementIdLogsEndpoint import ( - CompanyManagementIdLogsEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyManagementIdLogEndpoint import CompanyManagementIdLogEndpoint +from pyconnectwise.endpoints.manage.CompanyManagementIdLogsEndpoint import CompanyManagementIdLogsEndpoint from pyconnectwise.endpoints.manage.CompanyManagementIdManagementreportnotificationsEndpoint import ( CompanyManagementIdManagementreportnotificationsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Management from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdEndpoint( ConnectWiseEndpoint, IGettable[Management, ConnectWiseManageRequestParams], - IPuttable[Management, ConnectWiseManageRequestParams], IPatchable[Management, ConnectWiseManageRequestParams], + IPuttable[Management, ConnectWiseManageRequestParams], IPaginateable[Management, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Management) - IPuttable.__init__(self, Management) IPatchable.__init__(self, Management) + IPuttable.__init__(self, Management) IPaginateable.__init__(self, Management) self.execute_managed_it_sync = self._register_child_endpoint( - CompanyManagementIdExecutemanageditsyncEndpoint( - client, parent_endpoint=self - ) - ) - self.logs = self._register_child_endpoint( - CompanyManagementIdLogsEndpoint(client, parent_endpoint=self) + CompanyManagementIdExecutemanageditsyncEndpoint(client, parent_endpoint=self) ) + self.log = self._register_child_endpoint(CompanyManagementIdLogEndpoint(client, parent_endpoint=self)) + self.logs = self._register_child_endpoint(CompanyManagementIdLogsEndpoint(client, parent_endpoint=self)) self.management_report_notifications = self._register_child_endpoint( - CompanyManagementIdManagementreportnotificationsEndpoint( - client, parent_endpoint=self - ) - ) - self.log = self._register_child_endpoint( - CompanyManagementIdLogEndpoint(client, parent_endpoint=self) + CompanyManagementIdManagementreportnotificationsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Management]: """ Performs a GET request against the /company/management/{id} endpoint and returns an initialized PaginatedResponse object. @@ -80,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Management, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Management, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Management: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Management: """ Performs a GET request against the /company/management/{id} endpoint. @@ -103,17 +71,11 @@ def get( Returns: Management: The parsed response data. """ - return self._parse_one( - Management, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Management, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Management: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Management: """ - Performs a PUT request against the /company/management/{id} endpoint. + Performs a PATCH request against the /company/management/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -121,17 +83,11 @@ def put( Returns: Management: The parsed response data. """ - return self._parse_one( - Management, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Management, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Management: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Management: """ - Performs a PATCH request against the /company/management/{id} endpoint. + Performs a PUT request against the /company/management/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,6 +95,4 @@ def patch( Returns: Management: The parsed response data. """ - return self._parse_one( - Management, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Management, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdExecutemanageditsyncEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdExecutemanageditsyncEndpoint.py index a8c3602ae..1db794a28 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdExecutemanageditsyncEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdExecutemanageditsyncEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdExecutemanageditsyncEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "executeManagedItSync", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "executeManagedItSync", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /company/management/{id}/executeManagedItSync endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogDownloadEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogDownloadEndpoint.py index bb5c73d32..6df4c1ffc 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogDownloadEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogDownloadEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdLogDownloadEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "download", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "download", parent_endpoint=parent_endpoint) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a GET request against the /company/management/{id}/log/download endpoint. diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogEndpoint.py index c98594883..756b8d824 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogEndpoint.py @@ -1,14 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyManagementIdLogDownloadEndpoint import ( - CompanyManagementIdLogDownloadEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyManagementIdLogDownloadEndpoint import CompanyManagementIdLogDownloadEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdLogEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "log", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "log", parent_endpoint=parent_endpoint) self.download = self._register_child_endpoint( CompanyManagementIdLogDownloadEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogsEndpoint.py index 923317520..51b199594 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdLogsEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ManagementLogDocumentInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdLogsEndpoint( @@ -16,18 +15,13 @@ class CompanyManagementIdLogsEndpoint( IGettable[list[ManagementLogDocumentInfo], ConnectWiseManageRequestParams], IPaginateable[ManagementLogDocumentInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "logs", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "logs", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementLogDocumentInfo]) IPaginateable.__init__(self, ManagementLogDocumentInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementLogDocumentInfo]: """ Performs a GET request against the /company/management/{id}/logs endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementLogDocumentInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementLogDocumentInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementLogDocumentInfo]: """ Performs a GET request against the /company/management/{id}/logs endpoint. @@ -68,6 +55,5 @@ def get( list[ManagementLogDocumentInfo]: The parsed response data. """ return self._parse_many( - ManagementLogDocumentInfo, - super()._make_request("GET", data=data, params=params).json(), + ManagementLogDocumentInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsCountEndpoint.py index 812b72815..b1be4c47d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdManagementreportnotificationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManagementIdManagementreportnotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/management/{id}/managementReportNotifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/management/{id}/managementReportNotifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsEndpoint.py index 10a658d04..252552a17 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManagementIdManagementreportnotificationsCountEndpoint import ( CompanyManagementIdManagementreportnotificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyManagementIdManagementreportnotificationsIdEndpoint import ( CompanyManagementIdManagementreportnotificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagementReportNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdManagementreportnotificationsEndpoint( @@ -24,45 +22,31 @@ class CompanyManagementIdManagementreportnotificationsEndpoint( IPostable[ManagementReportNotification, ConnectWiseManageRequestParams], IPaginateable[ManagementReportNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, - client, - "managementReportNotifications", - parent_endpoint=parent_endpoint, - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementReportNotifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementReportNotification]) IPostable.__init__(self, ManagementReportNotification) IPaginateable.__init__(self, ManagementReportNotification) self.count = self._register_child_endpoint( - CompanyManagementIdManagementreportnotificationsCountEndpoint( - client, parent_endpoint=self - ) + CompanyManagementIdManagementreportnotificationsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyManagementIdManagementreportnotificationsIdEndpoint: + def id(self, _id: int) -> CompanyManagementIdManagementreportnotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManagementIdManagementreportnotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManagementIdManagementreportnotificationsIdEndpoint: The initialized CompanyManagementIdManagementreportnotificationsIdEndpoint object. """ - child = CompanyManagementIdManagementreportnotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyManagementIdManagementreportnotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementReportNotification]: """ Performs a GET request against the /company/management/{id}/managementReportNotifications endpoint and returns an initialized PaginatedResponse object. @@ -80,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementReportNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementReportNotification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementReportNotification]: """ Performs a GET request against the /company/management/{id}/managementReportNotifications endpoint. @@ -103,14 +80,11 @@ def get( list[ManagementReportNotification]: The parsed response data. """ return self._parse_many( - ManagementReportNotification, - super()._make_request("GET", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportNotification: """ Performs a POST request against the /company/management/{id}/managementReportNotifications endpoint. @@ -122,6 +96,5 @@ def post( ManagementReportNotification: The parsed response data. """ return self._parse_one( - ManagementReportNotification, - super()._make_request("POST", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsIdEndpoint.py index 8dcfaa8c9..9d1e5b612 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementIdManagementreportnotificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagementReportNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementIdManagementreportnotificationsIdEndpoint( ConnectWiseEndpoint, IGettable[ManagementReportNotification, ConnectWiseManageRequestParams], - IPuttable[ManagementReportNotification, ConnectWiseManageRequestParams], IPatchable[ManagementReportNotification, ConnectWiseManageRequestParams], + IPuttable[ManagementReportNotification, ConnectWiseManageRequestParams], IPaginateable[ManagementReportNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManagementReportNotification) - IPuttable.__init__(self, ManagementReportNotification) IPatchable.__init__(self, ManagementReportNotification) + IPuttable.__init__(self, ManagementReportNotification) IPaginateable.__init__(self, ManagementReportNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementReportNotification]: """ Performs a GET request against the /company/management/{id}/managementReportNotifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementReportNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementReportNotification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementReportNotification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/management/{id}/managementReportNotifications/{id} endpoint. + Performs a DELETE request against the /company/management/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ManagementReportNotification: The parsed response data. """ - return self._parse_one( - ManagementReportNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ManagementReportNotification: """ - Performs a DELETE request against the /company/management/{id}/managementReportNotifications/{id} endpoint. + Performs a GET request against the /company/management/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ManagementReportNotification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + ManagementReportNotification, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportNotification: """ - Performs a PUT request against the /company/management/{id}/managementReportNotifications/{id} endpoint. + Performs a PATCH request against the /company/management/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( ManagementReportNotification: The parsed response data. """ return self._parse_one( - ManagementReportNotification, - super()._make_request("PUT", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementReportNotification: """ - Performs a PATCH request against the /company/management/{id}/managementReportNotifications/{id} endpoint. + Performs a PUT request against the /company/management/{id}/managementReportNotifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( ManagementReportNotification: The parsed response data. """ return self._parse_one( - ManagementReportNotification, - super()._make_request("PATCH", data=data, params=params).json(), + ManagementReportNotification, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsCountEndpoint.py index cf05617b9..c2be52001 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementbackupsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManagementbackupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managementBackups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managementBackups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsEndpoint.py index cbe0f126f..f09ddd276 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyManagementbackupsCountEndpoint import ( - CompanyManagementbackupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyManagementbackupsIdEndpoint import ( - CompanyManagementbackupsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyManagementbackupsCountEndpoint import CompanyManagementbackupsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyManagementbackupsIdEndpoint import CompanyManagementbackupsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagementBackup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementbackupsEndpoint( @@ -24,36 +18,29 @@ class CompanyManagementbackupsEndpoint( IPostable[ManagementBackup, ConnectWiseManageRequestParams], IPaginateable[ManagementBackup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managementBackups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementBackups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementBackup]) IPostable.__init__(self, ManagementBackup) IPaginateable.__init__(self, ManagementBackup) - self.count = self._register_child_endpoint( - CompanyManagementbackupsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyManagementbackupsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyManagementbackupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyManagementbackupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManagementbackupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManagementbackupsIdEndpoint: The initialized CompanyManagementbackupsIdEndpoint object. """ child = CompanyManagementbackupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementBackup]: """ Performs a GET request against the /company/managementBackups endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementBackup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementBackup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementBackup]: """ Performs a GET request against the /company/managementBackups endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[ManagementBackup]: The parsed response data. """ - return self._parse_many( - ManagementBackup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ManagementBackup, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementBackup: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ManagementBackup: """ Performs a POST request against the /company/managementBackups endpoint. @@ -112,7 +85,4 @@ def post( Returns: ManagementBackup: The parsed response data. """ - return self._parse_one( - ManagementBackup, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ManagementBackup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsIdEndpoint.py index eae3a24bf..4008f123d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementbackupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagementBackup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementbackupsIdEndpoint( ConnectWiseEndpoint, IGettable[ManagementBackup, ConnectWiseManageRequestParams], - IPuttable[ManagementBackup, ConnectWiseManageRequestParams], IPatchable[ManagementBackup, ConnectWiseManageRequestParams], + IPuttable[ManagementBackup, ConnectWiseManageRequestParams], IPaginateable[ManagementBackup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManagementBackup) - IPuttable.__init__(self, ManagementBackup) IPatchable.__init__(self, ManagementBackup) + IPuttable.__init__(self, ManagementBackup) IPaginateable.__init__(self, ManagementBackup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementBackup]: """ Performs a GET request against the /company/managementBackups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementBackup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementBackup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementBackup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/managementBackups/{id} endpoint. + Performs a DELETE request against the /company/managementBackups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ManagementBackup: The parsed response data. """ - return self._parse_one( - ManagementBackup, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ManagementBackup: """ - Performs a DELETE request against the /company/managementBackups/{id} endpoint. + Performs a GET request against the /company/managementBackups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ManagementBackup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ManagementBackup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementBackup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ManagementBackup: """ - Performs a PUT request against the /company/managementBackups/{id} endpoint. + Performs a PATCH request against the /company/managementBackups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: ManagementBackup: The parsed response data. """ - return self._parse_one( - ManagementBackup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ManagementBackup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementBackup: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ManagementBackup: """ - Performs a PATCH request against the /company/managementBackups/{id} endpoint. + Performs a PUT request against the /company/managementBackups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: ManagementBackup: The parsed response data. """ - return self._parse_one( - ManagementBackup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ManagementBackup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsCountEndpoint.py index a0eb6d885..b767a9977 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManagementitsolutionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managementItSolutions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managementItSolutions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsEndpoint.py index dfc5c78c9..ee63a2b80 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsCountEndpoint import ( CompanyManagementitsolutionsCountEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsIdEndpoint import ( - CompanyManagementitsolutionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsIdEndpoint import CompanyManagementitsolutionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagementItSolution from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsEndpoint( @@ -24,10 +20,8 @@ class CompanyManagementitsolutionsEndpoint( IPostable[ManagementItSolution, ConnectWiseManageRequestParams], IPaginateable[ManagementItSolution, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managementItSolutions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementItSolutions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementItSolution]) IPostable.__init__(self, ManagementItSolution) IPaginateable.__init__(self, ManagementItSolution) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyManagementitsolutionsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyManagementitsolutionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyManagementitsolutionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManagementitsolutionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManagementitsolutionsIdEndpoint: The initialized CompanyManagementitsolutionsIdEndpoint object. """ - child = CompanyManagementitsolutionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyManagementitsolutionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementItSolution]: """ Performs a GET request against the /company/managementItSolutions endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementItSolution, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementItSolution, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementItSolution]: """ Performs a GET request against the /company/managementItSolutions endpoint. @@ -95,15 +77,10 @@ def get( Returns: list[ManagementItSolution]: The parsed response data. """ - return self._parse_many( - ManagementItSolution, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ManagementItSolution, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolution: """ Performs a POST request against the /company/managementItSolutions endpoint. @@ -114,7 +91,4 @@ def post( Returns: ManagementItSolution: The parsed response data. """ - return self._parse_one( - ManagementItSolution, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ManagementItSolution, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdEndpoint.py index 0be8c63ce..678e72ac6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsIdManagementproductsEndpoint import ( CompanyManagementitsolutionsIdManagementproductsEndpoint, @@ -5,51 +7,38 @@ from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsIdUsagesEndpoint import ( CompanyManagementitsolutionsIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagementItSolution from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsIdEndpoint( ConnectWiseEndpoint, IGettable[ManagementItSolution, ConnectWiseManageRequestParams], - IPuttable[ManagementItSolution, ConnectWiseManageRequestParams], IPatchable[ManagementItSolution, ConnectWiseManageRequestParams], + IPuttable[ManagementItSolution, ConnectWiseManageRequestParams], IPaginateable[ManagementItSolution, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManagementItSolution) - IPuttable.__init__(self, ManagementItSolution) IPatchable.__init__(self, ManagementItSolution) + IPuttable.__init__(self, ManagementItSolution) IPaginateable.__init__(self, ManagementItSolution) self.management_products = self._register_child_endpoint( - CompanyManagementitsolutionsIdManagementproductsEndpoint( - client, parent_endpoint=self - ) + CompanyManagementitsolutionsIdManagementproductsEndpoint(client, parent_endpoint=self) ) self.usages = self._register_child_endpoint( CompanyManagementitsolutionsIdUsagesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementItSolution]: """ Performs a GET request against the /company/managementItSolutions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -67,54 +56,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementItSolution, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementItSolution, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementItSolution: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/managementItSolutions/{id} endpoint. + Performs a DELETE request against the /company/managementItSolutions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ManagementItSolution: The parsed response data. """ - return self._parse_one( - ManagementItSolution, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ManagementItSolution: """ - Performs a DELETE request against the /company/managementItSolutions/{id} endpoint. + Performs a GET request against the /company/managementItSolutions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ManagementItSolution: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ManagementItSolution, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolution: """ - Performs a PUT request against the /company/managementItSolutions/{id} endpoint. + Performs a PATCH request against the /company/managementItSolutions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -122,18 +95,13 @@ def put( Returns: ManagementItSolution: The parsed response data. """ - return self._parse_one( - ManagementItSolution, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ManagementItSolution, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolution: """ - Performs a PATCH request against the /company/managementItSolutions/{id} endpoint. + Performs a PUT request against the /company/managementItSolutions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -141,7 +109,4 @@ def patch( Returns: ManagementItSolution: The parsed response data. """ - return self._parse_one( - ManagementItSolution, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ManagementItSolution, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsCountEndpoint.py index cf3856161..48b2b8a4a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsIdManagementproductsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyManagementitsolutionsIdManagementproductsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/managementItSolutions/{id}/managementProducts/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/managementItSolutions/{id}/managementProducts/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsEndpoint.py index ca4fcedd0..cfce54dfc 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsIdManagementproductsCountEndpoint import ( CompanyManagementitsolutionsIdManagementproductsCountEndpoint, @@ -5,68 +7,46 @@ from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsIdManagementproductsIdEndpoint import ( CompanyManagementitsolutionsIdManagementproductsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagementItSolutionAgreementInterfaceParameter from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsIdManagementproductsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[ManagementItSolutionAgreementInterfaceParameter], - ConnectWiseManageRequestParams, - ], - IPostable[ - ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams - ], - IPaginateable[ - ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams - ], + IGettable[list[ManagementItSolutionAgreementInterfaceParameter], ConnectWiseManageRequestParams], + IPostable[ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams], + IPaginateable[ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managementProducts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementProducts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementItSolutionAgreementInterfaceParameter]) IPostable.__init__(self, ManagementItSolutionAgreementInterfaceParameter) IPaginateable.__init__(self, ManagementItSolutionAgreementInterfaceParameter) self.count = self._register_child_endpoint( - CompanyManagementitsolutionsIdManagementproductsCountEndpoint( - client, parent_endpoint=self - ) + CompanyManagementitsolutionsIdManagementproductsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyManagementitsolutionsIdManagementproductsIdEndpoint: + def id(self, _id: int) -> CompanyManagementitsolutionsIdManagementproductsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyManagementitsolutionsIdManagementproductsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyManagementitsolutionsIdManagementproductsIdEndpoint: The initialized CompanyManagementitsolutionsIdManagementproductsIdEndpoint object. """ - child = CompanyManagementitsolutionsIdManagementproductsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyManagementitsolutionsIdManagementproductsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementItSolutionAgreementInterfaceParameter]: """ Performs a GET request against the /company/managementItSolutions/{id}/managementProducts endpoint and returns an initialized PaginatedResponse object. @@ -93,9 +73,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementItSolutionAgreementInterfaceParameter]: """ Performs a GET request against the /company/managementItSolutions/{id}/managementProducts endpoint. @@ -112,9 +90,7 @@ def get( ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolutionAgreementInterfaceParameter: """ Performs a POST request against the /company/managementItSolutions/{id}/managementProducts endpoint. diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsIdEndpoint.py index 5b81f4b60..971c05710 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdManagementproductsIdEndpoint.py @@ -1,51 +1,33 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IDeleteable, - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IDeleteable, IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagementItSolutionAgreementInterfaceParameter from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsIdManagementproductsIdEndpoint( ConnectWiseEndpoint, - IGettable[ - ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams - ], - IPuttable[ - ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams - ], - IPatchable[ - ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams - ], IDeleteable[ConnectWiseManageRequestParams], - IPaginateable[ - ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams - ], + IGettable[ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams], + IPatchable[ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams], + IPuttable[ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams], + IPaginateable[ManagementItSolutionAgreementInterfaceParameter, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IDeleteable.__init__(self, None) IGettable.__init__(self, ManagementItSolutionAgreementInterfaceParameter) - IPuttable.__init__(self, ManagementItSolutionAgreementInterfaceParameter) IPatchable.__init__(self, ManagementItSolutionAgreementInterfaceParameter) - IDeleteable.__init__(self, None) + IPuttable.__init__(self, ManagementItSolutionAgreementInterfaceParameter) IPaginateable.__init__(self, ManagementItSolutionAgreementInterfaceParameter) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementItSolutionAgreementInterfaceParameter]: """ Performs a GET request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint and returns an initialized PaginatedResponse object. @@ -71,13 +53,11 @@ def paginated( params, ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def delete( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolutionAgreementInterfaceParameter: """ - Performs a GET request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint. + Performs a DELETE request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -87,16 +67,14 @@ def get( """ return self._parse_one( ManagementItSolutionAgreementInterfaceParameter, - super()._make_request("GET", data=data, params=params).json(), + super()._make_request("DELETE", data=data, params=params).json(), ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolutionAgreementInterfaceParameter: """ - Performs a PUT request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint. + Performs a GET request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,13 +84,11 @@ def put( """ return self._parse_one( ManagementItSolutionAgreementInterfaceParameter, - super()._make_request("PUT", data=data, params=params).json(), + super()._make_request("GET", data=data, params=params).json(), ) def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolutionAgreementInterfaceParameter: """ Performs a PATCH request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint. @@ -128,13 +104,11 @@ def patch( super()._make_request("PATCH", data=data, params=params).json(), ) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementItSolutionAgreementInterfaceParameter: """ - Performs a DELETE request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint. + Performs a PUT request against the /company/managementItSolutions/{id}/managementProducts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -144,5 +118,5 @@ def delete( """ return self._parse_one( ManagementItSolutionAgreementInterfaceParameter, - super()._make_request("DELETE", data=data, params=params).json(), + super()._make_request("PUT", data=data, params=params).json(), ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesEndpoint.py index b3e0d23e9..a1abd02c4 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyManagementitsolutionsIdUsagesListEndpoint import ( CompanyManagementitsolutionsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsIdUsagesEndpoint( @@ -19,24 +18,17 @@ class CompanyManagementitsolutionsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - CompanyManagementitsolutionsIdUsagesListEndpoint( - client, parent_endpoint=self - ) + CompanyManagementitsolutionsIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/managementItSolutions/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/managementItSolutions/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesListEndpoint.py index 3c1c9ea13..0a2d153a0 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyManagementitsolutionsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyManagementitsolutionsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyManagementitsolutionsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/managementItSolutions/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/managementItSolutions/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsCountEndpoint.py index f016e4e69..93f88810e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyMarketdescriptionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/marketDescriptions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/marketDescriptions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsEndpoint.py index afac76b22..86c30d5cc 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsCountEndpoint import ( - CompanyMarketdescriptionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsIdEndpoint import ( - CompanyMarketdescriptionsIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsInfoEndpoint import ( - CompanyMarketdescriptionsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsCountEndpoint import CompanyMarketdescriptionsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsIdEndpoint import CompanyMarketdescriptionsIdEndpoint +from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsInfoEndpoint import CompanyMarketdescriptionsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MarketDescription from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsEndpoint( @@ -27,39 +19,30 @@ class CompanyMarketdescriptionsEndpoint( IPostable[MarketDescription, ConnectWiseManageRequestParams], IPaginateable[MarketDescription, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "marketDescriptions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "marketDescriptions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MarketDescription]) IPostable.__init__(self, MarketDescription) IPaginateable.__init__(self, MarketDescription) - self.count = self._register_child_endpoint( - CompanyMarketdescriptionsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyMarketdescriptionsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyMarketdescriptionsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyMarketdescriptionsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyMarketdescriptionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyMarketdescriptionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyMarketdescriptionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyMarketdescriptionsIdEndpoint: The initialized CompanyMarketdescriptionsIdEndpoint object. """ child = CompanyMarketdescriptionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketDescription]: """ Performs a GET request against the /company/marketDescriptions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketDescription, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketDescription, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MarketDescription]: """ Performs a GET request against the /company/marketDescriptions endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[MarketDescription]: The parsed response data. """ - return self._parse_many( - MarketDescription, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MarketDescription, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketDescription: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketDescription: """ Performs a POST request against the /company/marketDescriptions endpoint. @@ -118,7 +87,4 @@ def post( Returns: MarketDescription: The parsed response data. """ - return self._parse_one( - MarketDescription, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MarketDescription, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdEndpoint.py index 34d850b8d..36370cc24 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsIdInfoEndpoint import ( CompanyMarketdescriptionsIdInfoEndpoint, @@ -5,49 +7,36 @@ from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsIdUsagesEndpoint import ( CompanyMarketdescriptionsIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MarketDescription from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsIdEndpoint( ConnectWiseEndpoint, IGettable[MarketDescription, ConnectWiseManageRequestParams], - IPuttable[MarketDescription, ConnectWiseManageRequestParams], IPatchable[MarketDescription, ConnectWiseManageRequestParams], + IPuttable[MarketDescription, ConnectWiseManageRequestParams], IPaginateable[MarketDescription, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MarketDescription) - IPuttable.__init__(self, MarketDescription) IPatchable.__init__(self, MarketDescription) + IPuttable.__init__(self, MarketDescription) IPaginateable.__init__(self, MarketDescription) + self.info = self._register_child_endpoint(CompanyMarketdescriptionsIdInfoEndpoint(client, parent_endpoint=self)) self.usages = self._register_child_endpoint( CompanyMarketdescriptionsIdUsagesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - CompanyMarketdescriptionsIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketDescription]: """ Performs a GET request against the /company/marketDescriptions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +54,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketDescription, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketDescription, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketDescription: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/marketDescriptions/{id} endpoint. + Performs a DELETE request against the /company/marketDescriptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MarketDescription: The parsed response data. """ - return self._parse_one( - MarketDescription, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketDescription: """ - Performs a DELETE request against the /company/marketDescriptions/{id} endpoint. + Performs a GET request against the /company/marketDescriptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MarketDescription: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MarketDescription, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketDescription: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MarketDescription: """ - Performs a PUT request against the /company/marketDescriptions/{id} endpoint. + Performs a PATCH request against the /company/marketDescriptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +89,11 @@ def put( Returns: MarketDescription: The parsed response data. """ - return self._parse_one( - MarketDescription, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MarketDescription, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketDescription: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketDescription: """ - Performs a PATCH request against the /company/marketDescriptions/{id} endpoint. + Performs a PUT request against the /company/marketDescriptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +101,4 @@ def patch( Returns: MarketDescription: The parsed response data. """ - return self._parse_one( - MarketDescription, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MarketDescription, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdInfoEndpoint.py index e63e1bfe3..b1343f5f0 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MarketDescriptionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyMarketdescriptionsIdInfoEndpoint( IGettable[MarketDescriptionInfo, ConnectWiseManageRequestParams], IPaginateable[MarketDescriptionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, MarketDescriptionInfo) IPaginateable.__init__(self, MarketDescriptionInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketDescriptionInfo]: """ Performs a GET request against the /company/marketDescriptions/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketDescriptionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketDescriptionInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MarketDescriptionInfo: """ Performs a GET request against the /company/marketDescriptions/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: MarketDescriptionInfo: The parsed response data. """ - return self._parse_one( - MarketDescriptionInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(MarketDescriptionInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesEndpoint.py index 05632ff94..02ec2682d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsIdUsagesListEndpoint import ( CompanyMarketdescriptionsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsIdUsagesEndpoint( @@ -19,10 +18,8 @@ class CompanyMarketdescriptionsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/marketDescriptions/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/marketDescriptions/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesListEndpoint.py index 3d0df09dd..a0a72a324 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyMarketdescriptionsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/marketDescriptions/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/marketDescriptions/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoCountEndpoint.py index e3de050a6..d04bb1f4c 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyMarketdescriptionsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/marketDescriptions/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/marketDescriptions/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoEndpoint.py index d0e6d7b90..7eb865d0d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyMarketdescriptionsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyMarketdescriptionsInfoCountEndpoint import ( CompanyMarketdescriptionsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MarketDescriptionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyMarketdescriptionsInfoEndpoint( @@ -19,10 +18,8 @@ class CompanyMarketdescriptionsInfoEndpoint( IGettable[list[MarketDescriptionInfo], ConnectWiseManageRequestParams], IPaginateable[MarketDescriptionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MarketDescriptionInfo]) IPaginateable.__init__(self, MarketDescriptionInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketDescriptionInfo]: """ Performs a GET request against the /company/marketDescriptions/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketDescriptionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketDescriptionInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MarketDescriptionInfo]: """ Performs a GET request against the /company/marketDescriptions/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[MarketDescriptionInfo]: The parsed response data. """ - return self._parse_many( - MarketDescriptionInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MarketDescriptionInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountEndpoint.py index b22a19068..a912e48ef 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyNotetypesCountInfoEndpoint import ( - CompanyNotetypesCountInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyNotetypesCountInfoEndpoint import CompanyNotetypesCountInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyNotetypesCountEndpoint( @@ -19,22 +16,15 @@ class CompanyNotetypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) - self.info = self._register_child_endpoint( - CompanyNotetypesCountInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyNotetypesCountInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/noteTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/noteTypes/count endpoint. @@ -74,6 +53,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountInfoEndpoint.py index 64ac52096..eafb6c427 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyNotetypesCountInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyNotetypesCountInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyNotetypesCountInfoEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/noteTypes/count/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/noteTypes/count/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyNotetypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyNotetypesEndpoint.py index 51fac5a66..a7328a557 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyNotetypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyNotetypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyNotetypesCountEndpoint import ( - CompanyNotetypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyNotetypesIdEndpoint import ( - CompanyNotetypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyNotetypesInfoEndpoint import ( - CompanyNotetypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyNotetypesCountEndpoint import CompanyNotetypesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyNotetypesIdEndpoint import CompanyNotetypesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyNotetypesInfoEndpoint import CompanyNotetypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CompanyNoteType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyNotetypesEndpoint( @@ -27,39 +19,30 @@ class CompanyNotetypesEndpoint( IPostable[CompanyNoteType, ConnectWiseManageRequestParams], IPaginateable[CompanyNoteType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "noteTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "noteTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyNoteType]) IPostable.__init__(self, CompanyNoteType) IPaginateable.__init__(self, CompanyNoteType) - self.count = self._register_child_endpoint( - CompanyNotetypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyNotetypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyNotetypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyNotetypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyNotetypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyNotetypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyNotetypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyNotetypesIdEndpoint: The initialized CompanyNotetypesIdEndpoint object. """ child = CompanyNotetypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyNoteType]: """ Performs a GET request against the /company/noteTypes endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyNoteType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyNoteType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyNoteType]: """ Performs a GET request against the /company/noteTypes endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[CompanyNoteType]: The parsed response data. """ - return self._parse_many( - CompanyNoteType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CompanyNoteType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNoteType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyNoteType: """ Performs a POST request against the /company/noteTypes endpoint. @@ -118,7 +87,4 @@ def post( Returns: CompanyNoteType: The parsed response data. """ - return self._parse_one( - CompanyNoteType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CompanyNoteType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdEndpoint.py index 7ec90b6fd..9e767949e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyNotetypesIdInfoEndpoint import ( - CompanyNotetypesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyNotetypesIdInfoEndpoint import CompanyNotetypesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CompanyNoteType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyNotetypesIdEndpoint( ConnectWiseEndpoint, IGettable[CompanyNoteType, ConnectWiseManageRequestParams], - IPuttable[CompanyNoteType, ConnectWiseManageRequestParams], IPatchable[CompanyNoteType, ConnectWiseManageRequestParams], + IPuttable[CompanyNoteType, ConnectWiseManageRequestParams], IPaginateable[CompanyNoteType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyNoteType) - IPuttable.__init__(self, CompanyNoteType) IPatchable.__init__(self, CompanyNoteType) + IPuttable.__init__(self, CompanyNoteType) IPaginateable.__init__(self, CompanyNoteType) - self.info = self._register_child_endpoint( - CompanyNotetypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyNotetypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyNoteType]: """ Performs a GET request against the /company/noteTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyNoteType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyNoteType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNoteType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/noteTypes/{id} endpoint. + Performs a DELETE request against the /company/noteTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CompanyNoteType: The parsed response data. """ - return self._parse_one( - CompanyNoteType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyNoteType: """ - Performs a DELETE request against the /company/noteTypes/{id} endpoint. + Performs a GET request against the /company/noteTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CompanyNoteType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CompanyNoteType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNoteType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyNoteType: """ - Performs a PUT request against the /company/noteTypes/{id} endpoint. + Performs a PATCH request against the /company/noteTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +81,11 @@ def put( Returns: CompanyNoteType: The parsed response data. """ - return self._parse_one( - CompanyNoteType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CompanyNoteType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyNoteType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyNoteType: """ - Performs a PATCH request against the /company/noteTypes/{id} endpoint. + Performs a PUT request against the /company/noteTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +93,4 @@ def patch( Returns: CompanyNoteType: The parsed response data. """ - return self._parse_one( - CompanyNoteType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyNoteType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdInfoEndpoint.py index d2e0310e8..980f05302 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyNotetypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CompanyNoteTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyNotetypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyNotetypesIdInfoEndpoint( IGettable[CompanyNoteTypeInfo, ConnectWiseManageRequestParams], IPaginateable[CompanyNoteTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyNoteTypeInfo) IPaginateable.__init__(self, CompanyNoteTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyNoteTypeInfo]: """ Performs a GET request against the /company/noteTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyNoteTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyNoteTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CompanyNoteTypeInfo: """ Performs a GET request against the /company/noteTypes/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: CompanyNoteTypeInfo: The parsed response data. """ - return self._parse_one( - CompanyNoteTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CompanyNoteTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyNotetypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyNotetypesInfoEndpoint.py index 758cf6faf..450c1eb9b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyNotetypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyNotetypesInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CompanyNoteTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyNotetypesInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyNotetypesInfoEndpoint( IGettable[list[CompanyNoteTypeInfo], ConnectWiseManageRequestParams], IPaginateable[CompanyNoteTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CompanyNoteTypeInfo]) IPaginateable.__init__(self, CompanyNoteTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyNoteTypeInfo]: """ Performs a GET request against the /company/noteTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyNoteTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyNoteTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CompanyNoteTypeInfo]: """ Performs a GET request against the /company/noteTypes/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[CompanyNoteTypeInfo]: The parsed response data. """ - return self._parse_many( - CompanyNoteTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CompanyNoteTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesCountEndpoint.py index 2eb3750af..c63d5fb14 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyOwnershiptypesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyOwnershiptypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/ownershipTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/ownershipTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesEndpoint.py index 279c2bc16..f2d7bcecc 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyOwnershiptypesCountEndpoint import ( - CompanyOwnershiptypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyOwnershiptypesIdEndpoint import ( - CompanyOwnershiptypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyOwnershiptypesInfoEndpoint import ( - CompanyOwnershiptypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyOwnershiptypesCountEndpoint import CompanyOwnershiptypesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyOwnershiptypesIdEndpoint import CompanyOwnershiptypesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyOwnershiptypesInfoEndpoint import CompanyOwnershiptypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OwnershipType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyOwnershiptypesEndpoint( @@ -27,39 +19,30 @@ class CompanyOwnershiptypesEndpoint( IPostable[OwnershipType, ConnectWiseManageRequestParams], IPaginateable[OwnershipType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ownershipTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ownershipTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OwnershipType]) IPostable.__init__(self, OwnershipType) IPaginateable.__init__(self, OwnershipType) - self.count = self._register_child_endpoint( - CompanyOwnershiptypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyOwnershiptypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyOwnershiptypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyOwnershiptypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyOwnershiptypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyOwnershiptypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyOwnershiptypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyOwnershiptypesIdEndpoint: The initialized CompanyOwnershiptypesIdEndpoint object. """ child = CompanyOwnershiptypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OwnershipType]: """ Performs a GET request against the /company/ownershipTypes endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OwnershipType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OwnershipType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OwnershipType]: """ Performs a GET request against the /company/ownershipTypes endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[OwnershipType]: The parsed response data. """ - return self._parse_many( - OwnershipType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(OwnershipType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OwnershipType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OwnershipType: """ Performs a POST request against the /company/ownershipTypes endpoint. @@ -117,7 +87,4 @@ def post( Returns: OwnershipType: The parsed response data. """ - return self._parse_one( - OwnershipType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OwnershipType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdEndpoint.py index 838c8ea07..0d3c9f36f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyOwnershiptypesIdInfoEndpoint import ( - CompanyOwnershiptypesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyOwnershiptypesIdInfoEndpoint import CompanyOwnershiptypesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OwnershipType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyOwnershiptypesIdEndpoint( ConnectWiseEndpoint, IGettable[OwnershipType, ConnectWiseManageRequestParams], - IPuttable[OwnershipType, ConnectWiseManageRequestParams], IPatchable[OwnershipType, ConnectWiseManageRequestParams], + IPuttable[OwnershipType, ConnectWiseManageRequestParams], IPaginateable[OwnershipType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OwnershipType) - IPuttable.__init__(self, OwnershipType) IPatchable.__init__(self, OwnershipType) + IPuttable.__init__(self, OwnershipType) IPaginateable.__init__(self, OwnershipType) - self.info = self._register_child_endpoint( - CompanyOwnershiptypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyOwnershiptypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OwnershipType]: """ Performs a GET request against the /company/ownershipTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OwnershipType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OwnershipType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OwnershipType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/ownershipTypes/{id} endpoint. + Performs a DELETE request against the /company/ownershipTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OwnershipType: The parsed response data. """ - return self._parse_one( - OwnershipType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OwnershipType: """ - Performs a DELETE request against the /company/ownershipTypes/{id} endpoint. + Performs a GET request against the /company/ownershipTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OwnershipType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OwnershipType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OwnershipType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OwnershipType: """ - Performs a PUT request against the /company/ownershipTypes/{id} endpoint. + Performs a PATCH request against the /company/ownershipTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: OwnershipType: The parsed response data. """ - return self._parse_one( - OwnershipType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(OwnershipType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OwnershipType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OwnershipType: """ - Performs a PATCH request against the /company/ownershipTypes/{id} endpoint. + Performs a PUT request against the /company/ownershipTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +93,4 @@ def patch( Returns: OwnershipType: The parsed response data. """ - return self._parse_one( - OwnershipType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OwnershipType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdInfoEndpoint.py index bbd776297..6afb5acd9 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OwnershipTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyOwnershiptypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyOwnershiptypesIdInfoEndpoint( IGettable[OwnershipTypeInfo, ConnectWiseManageRequestParams], IPaginateable[OwnershipTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, OwnershipTypeInfo) IPaginateable.__init__(self, OwnershipTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OwnershipTypeInfo]: """ Performs a GET request against the /company/ownershipTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OwnershipTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OwnershipTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OwnershipTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OwnershipTypeInfo: """ Performs a GET request against the /company/ownershipTypes/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: OwnershipTypeInfo: The parsed response data. """ - return self._parse_one( - OwnershipTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(OwnershipTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoCountEndpoint.py index 4c9a4d6f3..29b9ed292 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyOwnershiptypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyOwnershiptypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/ownershipTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/ownershipTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoEndpoint.py index ffc91975d..482de4e68 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyOwnershiptypesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyOwnershiptypesInfoCountEndpoint import ( - CompanyOwnershiptypesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyOwnershiptypesInfoCountEndpoint import CompanyOwnershiptypesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OwnershipTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyOwnershiptypesInfoEndpoint( @@ -19,22 +16,15 @@ class CompanyOwnershiptypesInfoEndpoint( IGettable[list[OwnershipTypeInfo], ConnectWiseManageRequestParams], IPaginateable[OwnershipTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OwnershipTypeInfo]) IPaginateable.__init__(self, OwnershipTypeInfo) - self.count = self._register_child_endpoint( - CompanyOwnershiptypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyOwnershiptypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OwnershipTypeInfo]: """ Performs a GET request against the /company/ownershipTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OwnershipTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OwnershipTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OwnershipTypeInfo]: """ Performs a GET request against the /company/ownershipTypes/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[OwnershipTypeInfo]: The parsed response data. """ - return self._parse_many( - OwnershipTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OwnershipTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesEndpoint.py index 01732ea90..0bfafb779 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyPaymenttypesInfoEndpoint import ( - CompanyPaymenttypesInfoEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyPaymenttypesInfoEndpoint import CompanyPaymenttypesInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPaymenttypesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "paymentTypes", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - CompanyPaymenttypesInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "paymentTypes", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(CompanyPaymenttypesInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoCountEndpoint.py index 3b911fa4e..1bf981bcd 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPaymenttypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPaymenttypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/paymentTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/paymentTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoEndpoint.py index 0645509da..c0a2c1ddc 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPaymenttypesInfoEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyPaymenttypesInfoCountEndpoint import ( - CompanyPaymenttypesInfoCountEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyPaymenttypesInfoCountEndpoint import CompanyPaymenttypesInfoCountEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPaymenttypesInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - - self.count = self._register_child_endpoint( - CompanyPaymenttypesInfoCountEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + + self.count = self._register_child_endpoint(CompanyPaymenttypesInfoCountEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCopyEndpoint.py index 86c32938d..6e3b09ba6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCopyEndpoint.py @@ -1,27 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import PortalConfiguration -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsCopyEndpoint( ConnectWiseEndpoint, IPostable[PortalConfiguration, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, PortalConfiguration) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfiguration: """ Performs a POST request against the /company/portalConfigurations/copy endpoint. @@ -32,7 +28,4 @@ def post( Returns: PortalConfiguration: The parsed response data. """ - return self._parse_one( - PortalConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(PortalConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCountEndpoint.py index 2dada4d21..9446622de 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalconfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/portalConfigurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/portalConfigurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsEndpoint.py index 99b936e3f..2171ff1a0 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsCopyEndpoint import ( CompanyPortalconfigurationsCopyEndpoint, @@ -5,23 +7,17 @@ from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsCountEndpoint import ( CompanyPortalconfigurationsCountEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdEndpoint import ( - CompanyPortalconfigurationsIdEndpoint, -) +from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdEndpoint import CompanyPortalconfigurationsIdEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsInvoicesetupEndpoint import ( CompanyPortalconfigurationsInvoicesetupEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PortalConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsEndpoint( @@ -30,44 +26,35 @@ class CompanyPortalconfigurationsEndpoint( IPostable[PortalConfiguration, ConnectWiseManageRequestParams], IPaginateable[PortalConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "portalConfigurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "portalConfigurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalConfiguration]) IPostable.__init__(self, PortalConfiguration) IPaginateable.__init__(self, PortalConfiguration) - self.copy = self._register_child_endpoint( - CompanyPortalconfigurationsCopyEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(CompanyPortalconfigurationsCopyEndpoint(client, parent_endpoint=self)) self.count = self._register_child_endpoint( CompanyPortalconfigurationsCountEndpoint(client, parent_endpoint=self) ) self.invoice_setup = self._register_child_endpoint( - CompanyPortalconfigurationsInvoicesetupEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsInvoicesetupEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyPortalconfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyPortalconfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalconfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalconfigurationsIdEndpoint: The initialized CompanyPortalconfigurationsIdEndpoint object. """ child = CompanyPortalconfigurationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfiguration]: """ Performs a GET request against the /company/portalConfigurations endpoint and returns an initialized PaginatedResponse object. @@ -85,18 +72,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfiguration, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalConfiguration]: """ Performs a GET request against the /company/portalConfigurations endpoint. @@ -107,15 +87,10 @@ def get( Returns: list[PortalConfiguration]: The parsed response data. """ - return self._parse_many( - PortalConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PortalConfiguration, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfiguration: """ Performs a POST request against the /company/portalConfigurations endpoint. @@ -126,7 +101,4 @@ def post( Returns: PortalConfiguration: The parsed response data. """ - return self._parse_one( - PortalConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(PortalConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdEndpoint.py index dcb4bd418..d4a56590d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdInvoicesetupsEndpoint import ( CompanyPortalconfigurationsIdInvoicesetupsEndpoint, @@ -14,68 +16,47 @@ from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdServicesetupsEndpoint import ( CompanyPortalconfigurationsIdServicesetupsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalConfiguration, ConnectWiseManageRequestParams], - IPuttable[PortalConfiguration, ConnectWiseManageRequestParams], IPatchable[PortalConfiguration, ConnectWiseManageRequestParams], + IPuttable[PortalConfiguration, ConnectWiseManageRequestParams], IPaginateable[PortalConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalConfiguration) - IPuttable.__init__(self, PortalConfiguration) IPatchable.__init__(self, PortalConfiguration) + IPuttable.__init__(self, PortalConfiguration) IPaginateable.__init__(self, PortalConfiguration) - self.password_email_setups = self._register_child_endpoint( - CompanyPortalconfigurationsIdPasswordemailsetupsEndpoint( - client, parent_endpoint=self - ) + self.invoice_setups = self._register_child_endpoint( + CompanyPortalconfigurationsIdInvoicesetupsEndpoint(client, parent_endpoint=self) ) self.opportunity_setups = self._register_child_endpoint( - CompanyPortalconfigurationsIdOpportunitysetupsEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsIdOpportunitysetupsEndpoint(client, parent_endpoint=self) ) - self.service_setups = self._register_child_endpoint( - CompanyPortalconfigurationsIdServicesetupsEndpoint( - client, parent_endpoint=self - ) - ) - self.invoice_setups = self._register_child_endpoint( - CompanyPortalconfigurationsIdInvoicesetupsEndpoint( - client, parent_endpoint=self - ) + self.password_email_setups = self._register_child_endpoint( + CompanyPortalconfigurationsIdPasswordemailsetupsEndpoint(client, parent_endpoint=self) ) self.project_setups = self._register_child_endpoint( - CompanyPortalconfigurationsIdProjectsetupsEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsIdProjectsetupsEndpoint(client, parent_endpoint=self) + ) + self.service_setups = self._register_child_endpoint( + CompanyPortalconfigurationsIdServicesetupsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfiguration]: """ Performs a GET request against the /company/portalConfigurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -93,54 +74,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfiguration, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalConfiguration: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/portalConfigurations/{id} endpoint. + Performs a DELETE request against the /company/portalConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PortalConfiguration: The parsed response data. """ - return self._parse_one( - PortalConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> PortalConfiguration: """ - Performs a DELETE request against the /company/portalConfigurations/{id} endpoint. + Performs a GET request against the /company/portalConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PortalConfiguration: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PortalConfiguration, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfiguration: """ - Performs a PUT request against the /company/portalConfigurations/{id} endpoint. + Performs a PATCH request against the /company/portalConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -148,18 +113,13 @@ def put( Returns: PortalConfiguration: The parsed response data. """ - return self._parse_one( - PortalConfiguration, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(PortalConfiguration, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfiguration: """ - Performs a PATCH request against the /company/portalConfigurations/{id} endpoint. + Performs a PUT request against the /company/portalConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -167,7 +127,4 @@ def patch( Returns: PortalConfiguration: The parsed response data. """ - return self._parse_one( - PortalConfiguration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PortalConfiguration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint.py index f5c14811d..7fb7caf47 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/portalConfigurations/{id}/invoiceSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/portalConfigurations/{id}/invoiceSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsEndpoint.py index 9cbe176d1..0e8b2bf8e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint import ( CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint import ( CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalConfigurationInvoiceSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdInvoicesetupsEndpoint( @@ -22,41 +21,30 @@ class CompanyPortalconfigurationsIdInvoicesetupsEndpoint( IGettable[list[PortalConfigurationInvoiceSetup], ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationInvoiceSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoiceSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "invoiceSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalConfigurationInvoiceSetup]) IPaginateable.__init__(self, PortalConfigurationInvoiceSetup) self.count = self._register_child_endpoint( - CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsIdInvoicesetupsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint: + def id(self, _id: int) -> CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint: The initialized CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint object. """ - child = CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationInvoiceSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/invoiceSetups endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfigurationInvoiceSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfigurationInvoiceSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalConfigurationInvoiceSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/invoiceSetups endpoint. @@ -97,6 +78,5 @@ def get( list[PortalConfigurationInvoiceSetup]: The parsed response data. """ return self._parse_many( - PortalConfigurationInvoiceSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationInvoiceSetup, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint.py index 1b1faf9b0..845e13f5a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint import ( CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalConfigurationInvoiceSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdInvoicesetupsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalConfigurationInvoiceSetup, ConnectWiseManageRequestParams], - IPuttable[PortalConfigurationInvoiceSetup, ConnectWiseManageRequestParams], IPatchable[PortalConfigurationInvoiceSetup, ConnectWiseManageRequestParams], + IPuttable[PortalConfigurationInvoiceSetup, ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationInvoiceSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalConfigurationInvoiceSetup) - IPuttable.__init__(self, PortalConfigurationInvoiceSetup) IPatchable.__init__(self, PortalConfigurationInvoiceSetup) + IPuttable.__init__(self, PortalConfigurationInvoiceSetup) IPaginateable.__init__(self, PortalConfigurationInvoiceSetup) self.test_transaction = self._register_child_endpoint( - CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationInvoiceSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/invoiceSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,18 +50,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfigurationInvoiceSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfigurationInvoiceSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationInvoiceSetup: """ Performs a GET request against the /company/portalConfigurations/{id}/invoiceSetups/{id} endpoint. @@ -84,17 +66,14 @@ def get( PortalConfigurationInvoiceSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationInvoiceSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationInvoiceSetup, super()._make_request("GET", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationInvoiceSetup: """ - Performs a PUT request against the /company/portalConfigurations/{id}/invoiceSetups/{id} endpoint. + Performs a PATCH request against the /company/portalConfigurations/{id}/invoiceSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -103,17 +82,14 @@ def put( PortalConfigurationInvoiceSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationInvoiceSetup, - super()._make_request("PUT", data=data, params=params).json(), + PortalConfigurationInvoiceSetup, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationInvoiceSetup: """ - Performs a PATCH request against the /company/portalConfigurations/{id}/invoiceSetups/{id} endpoint. + Performs a PUT request against the /company/portalConfigurations/{id}/invoiceSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -122,6 +98,5 @@ def patch( PortalConfigurationInvoiceSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationInvoiceSetup, - super()._make_request("PATCH", data=data, params=params).json(), + PortalConfigurationInvoiceSetup, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint.py index 41f0ccfb9..761da1dda 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdInvoicesetupsIdTesttransactionEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testTransaction", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testTransaction", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /company/portalConfigurations/{id}/invoiceSetups/{id}/testTransaction endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsEndpoint.py index 6fa09c2a4..d78c946c8 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsEndpoint.py @@ -1,62 +1,47 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint import ( CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalConfigurationOpportunitySetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdOpportunitysetupsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[PortalConfigurationOpportunitySetup], ConnectWiseManageRequestParams - ], - IPuttable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], + IGettable[list[PortalConfigurationOpportunitySetup], ConnectWiseManageRequestParams], IPatchable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], + IPuttable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "opportunitySetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "opportunitySetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalConfigurationOpportunitySetup]) - IPuttable.__init__(self, PortalConfigurationOpportunitySetup) IPatchable.__init__(self, PortalConfigurationOpportunitySetup) + IPuttable.__init__(self, PortalConfigurationOpportunitySetup) IPaginateable.__init__(self, PortalConfigurationOpportunitySetup) - def id( - self, id: int # noqa: A002 - ) -> CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint: + def id(self, _id: int) -> CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint: The initialized CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint object. """ - child = CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationOpportunitySetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/opportunitySetups endpoint and returns an initialized PaginatedResponse object. @@ -83,9 +68,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalConfigurationOpportunitySetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/opportunitySetups endpoint. @@ -97,17 +80,14 @@ def get( list[PortalConfigurationOpportunitySetup]: The parsed response data. """ return self._parse_many( - PortalConfigurationOpportunitySetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationOpportunitySetup, super()._make_request("GET", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationOpportunitySetup: """ - Performs a PUT request against the /company/portalConfigurations/{id}/opportunitySetups endpoint. + Performs a PATCH request against the /company/portalConfigurations/{id}/opportunitySetups endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -116,17 +96,14 @@ def put( PortalConfigurationOpportunitySetup: The parsed response data. """ return self._parse_one( - PortalConfigurationOpportunitySetup, - super()._make_request("PUT", data=data, params=params).json(), + PortalConfigurationOpportunitySetup, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationOpportunitySetup: """ - Performs a PATCH request against the /company/portalConfigurations/{id}/opportunitySetups endpoint. + Performs a PUT request against the /company/portalConfigurations/{id}/opportunitySetups endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,6 +112,5 @@ def patch( PortalConfigurationOpportunitySetup: The parsed response data. """ return self._parse_one( - PortalConfigurationOpportunitySetup, - super()._make_request("PATCH", data=data, params=params).json(), + PortalConfigurationOpportunitySetup, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint.py index e453c32a5..36cf078e4 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalConfigurationOpportunitySetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdOpportunitysetupsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], - IPuttable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], IPatchable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], + IPuttable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationOpportunitySetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalConfigurationOpportunitySetup) - IPuttable.__init__(self, PortalConfigurationOpportunitySetup) IPatchable.__init__(self, PortalConfigurationOpportunitySetup) + IPuttable.__init__(self, PortalConfigurationOpportunitySetup) IPaginateable.__init__(self, PortalConfigurationOpportunitySetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationOpportunitySetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/opportunitySetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,9 +52,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationOpportunitySetup: """ Performs a GET request against the /company/portalConfigurations/{id}/opportunitySetups/{id} endpoint. @@ -75,17 +64,14 @@ def get( PortalConfigurationOpportunitySetup: The parsed response data. """ return self._parse_one( - PortalConfigurationOpportunitySetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationOpportunitySetup, super()._make_request("GET", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationOpportunitySetup: """ - Performs a PUT request against the /company/portalConfigurations/{id}/opportunitySetups/{id} endpoint. + Performs a PATCH request against the /company/portalConfigurations/{id}/opportunitySetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -94,17 +80,14 @@ def put( PortalConfigurationOpportunitySetup: The parsed response data. """ return self._parse_one( - PortalConfigurationOpportunitySetup, - super()._make_request("PUT", data=data, params=params).json(), + PortalConfigurationOpportunitySetup, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationOpportunitySetup: """ - Performs a PATCH request against the /company/portalConfigurations/{id}/opportunitySetups/{id} endpoint. + Performs a PUT request against the /company/portalConfigurations/{id}/opportunitySetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,6 +96,5 @@ def patch( PortalConfigurationOpportunitySetup: The parsed response data. """ return self._parse_one( - PortalConfigurationOpportunitySetup, - super()._make_request("PATCH", data=data, params=params).json(), + PortalConfigurationOpportunitySetup, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsEndpoint.py index a5bee4b68..7ab4fa379 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsEndpoint.py @@ -1,57 +1,43 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint import ( CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalConfigurationPasswordEmailSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdPasswordemailsetupsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[PortalConfigurationPasswordEmailSetup], ConnectWiseManageRequestParams - ], - IPaginateable[ - PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams - ], + IGettable[list[PortalConfigurationPasswordEmailSetup], ConnectWiseManageRequestParams], + IPaginateable[PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "passwordEmailSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "passwordEmailSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalConfigurationPasswordEmailSetup]) IPaginateable.__init__(self, PortalConfigurationPasswordEmailSetup) - def id( - self, id: int # noqa: A002 - ) -> CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint: + def id(self, _id: int) -> CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint: The initialized CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint object. """ - child = CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationPasswordEmailSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/passwordEmailSetups endpoint and returns an initialized PaginatedResponse object. @@ -78,9 +64,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalConfigurationPasswordEmailSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/passwordEmailSetups endpoint. @@ -92,6 +76,5 @@ def get( list[PortalConfigurationPasswordEmailSetup]: The parsed response data. """ return self._parse_many( - PortalConfigurationPasswordEmailSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationPasswordEmailSetup, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint.py index 414c97b49..f54c0cba5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint.py @@ -1,42 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalConfigurationPasswordEmailSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdPasswordemailsetupsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams], - IPuttable[PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams], IPatchable[PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams], - IPaginateable[ - PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams - ], + IPuttable[PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams], + IPaginateable[PortalConfigurationPasswordEmailSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalConfigurationPasswordEmailSetup) - IPuttable.__init__(self, PortalConfigurationPasswordEmailSetup) IPatchable.__init__(self, PortalConfigurationPasswordEmailSetup) + IPuttable.__init__(self, PortalConfigurationPasswordEmailSetup) IPaginateable.__init__(self, PortalConfigurationPasswordEmailSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationPasswordEmailSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/passwordEmailSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -63,9 +52,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationPasswordEmailSetup: """ Performs a GET request against the /company/portalConfigurations/{id}/passwordEmailSetups/{id} endpoint. @@ -77,17 +64,14 @@ def get( PortalConfigurationPasswordEmailSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationPasswordEmailSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationPasswordEmailSetup, super()._make_request("GET", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationPasswordEmailSetup: """ - Performs a PUT request against the /company/portalConfigurations/{id}/passwordEmailSetups/{id} endpoint. + Performs a PATCH request against the /company/portalConfigurations/{id}/passwordEmailSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -96,17 +80,14 @@ def put( PortalConfigurationPasswordEmailSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationPasswordEmailSetup, - super()._make_request("PUT", data=data, params=params).json(), + PortalConfigurationPasswordEmailSetup, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationPasswordEmailSetup: """ - Performs a PATCH request against the /company/portalConfigurations/{id}/passwordEmailSetups/{id} endpoint. + Performs a PUT request against the /company/portalConfigurations/{id}/passwordEmailSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -115,6 +96,5 @@ def patch( PortalConfigurationPasswordEmailSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationPasswordEmailSetup, - super()._make_request("PATCH", data=data, params=params).json(), + PortalConfigurationPasswordEmailSetup, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsCountEndpoint.py index b7710867f..afbb3f4f6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdProjectsetupsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalconfigurationsIdProjectsetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/portalConfigurations/{id}/projectSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/portalConfigurations/{id}/projectSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsEndpoint.py index 0e0e38fd3..7c1ef6e9b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdProjectsetupsCountEndpoint import ( CompanyPortalconfigurationsIdProjectsetupsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdProjectsetupsIdEndpoint import ( CompanyPortalconfigurationsIdProjectsetupsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalConfigurationProjectSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdProjectsetupsEndpoint( @@ -22,41 +21,30 @@ class CompanyPortalconfigurationsIdProjectsetupsEndpoint( IGettable[list[PortalConfigurationProjectSetup], ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationProjectSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "projectSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "projectSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalConfigurationProjectSetup]) IPaginateable.__init__(self, PortalConfigurationProjectSetup) self.count = self._register_child_endpoint( - CompanyPortalconfigurationsIdProjectsetupsCountEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsIdProjectsetupsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyPortalconfigurationsIdProjectsetupsIdEndpoint: + def id(self, _id: int) -> CompanyPortalconfigurationsIdProjectsetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalconfigurationsIdProjectsetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalconfigurationsIdProjectsetupsIdEndpoint: The initialized CompanyPortalconfigurationsIdProjectsetupsIdEndpoint object. """ - child = CompanyPortalconfigurationsIdProjectsetupsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyPortalconfigurationsIdProjectsetupsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationProjectSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/projectSetups endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfigurationProjectSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfigurationProjectSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalConfigurationProjectSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/projectSetups endpoint. @@ -97,6 +78,5 @@ def get( list[PortalConfigurationProjectSetup]: The parsed response data. """ return self._parse_many( - PortalConfigurationProjectSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationProjectSetup, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsIdEndpoint.py index f8b7715f4..83695812c 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdProjectsetupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalConfigurationProjectSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdProjectsetupsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalConfigurationProjectSetup, ConnectWiseManageRequestParams], - IPuttable[PortalConfigurationProjectSetup, ConnectWiseManageRequestParams], IPatchable[PortalConfigurationProjectSetup, ConnectWiseManageRequestParams], + IPuttable[PortalConfigurationProjectSetup, ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationProjectSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalConfigurationProjectSetup) - IPuttable.__init__(self, PortalConfigurationProjectSetup) IPatchable.__init__(self, PortalConfigurationProjectSetup) + IPuttable.__init__(self, PortalConfigurationProjectSetup) IPaginateable.__init__(self, PortalConfigurationProjectSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationProjectSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/projectSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfigurationProjectSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfigurationProjectSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationProjectSetup: """ Performs a GET request against the /company/portalConfigurations/{id}/projectSetups/{id} endpoint. @@ -75,17 +59,14 @@ def get( PortalConfigurationProjectSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationProjectSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationProjectSetup, super()._make_request("GET", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationProjectSetup: """ - Performs a PUT request against the /company/portalConfigurations/{id}/projectSetups/{id} endpoint. + Performs a PATCH request against the /company/portalConfigurations/{id}/projectSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -94,17 +75,14 @@ def put( PortalConfigurationProjectSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationProjectSetup, - super()._make_request("PUT", data=data, params=params).json(), + PortalConfigurationProjectSetup, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationProjectSetup: """ - Performs a PATCH request against the /company/portalConfigurations/{id}/projectSetups/{id} endpoint. + Performs a PUT request against the /company/portalConfigurations/{id}/projectSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,6 +91,5 @@ def patch( PortalConfigurationProjectSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationProjectSetup, - super()._make_request("PATCH", data=data, params=params).json(), + PortalConfigurationProjectSetup, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsCountEndpoint.py index 0aa54ee96..13c29de0d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdServicesetupsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalconfigurationsIdServicesetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/portalConfigurations/{id}/serviceSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/portalConfigurations/{id}/serviceSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsEndpoint.py index c80c5bbc0..005c91e49 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdServicesetupsCountEndpoint import ( CompanyPortalconfigurationsIdServicesetupsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsIdServicesetupsIdEndpoint import ( CompanyPortalconfigurationsIdServicesetupsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalConfigurationServiceSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdServicesetupsEndpoint( @@ -22,41 +21,30 @@ class CompanyPortalconfigurationsIdServicesetupsEndpoint( IGettable[list[PortalConfigurationServiceSetup], ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationServiceSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "serviceSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "serviceSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalConfigurationServiceSetup]) IPaginateable.__init__(self, PortalConfigurationServiceSetup) self.count = self._register_child_endpoint( - CompanyPortalconfigurationsIdServicesetupsCountEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsIdServicesetupsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyPortalconfigurationsIdServicesetupsIdEndpoint: + def id(self, _id: int) -> CompanyPortalconfigurationsIdServicesetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalconfigurationsIdServicesetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalconfigurationsIdServicesetupsIdEndpoint: The initialized CompanyPortalconfigurationsIdServicesetupsIdEndpoint object. """ - child = CompanyPortalconfigurationsIdServicesetupsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyPortalconfigurationsIdServicesetupsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationServiceSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/serviceSetups endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfigurationServiceSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfigurationServiceSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalConfigurationServiceSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/serviceSetups endpoint. @@ -97,6 +78,5 @@ def get( list[PortalConfigurationServiceSetup]: The parsed response data. """ return self._parse_many( - PortalConfigurationServiceSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationServiceSetup, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsIdEndpoint.py index ab1aeddda..780ef2b2e 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsIdServicesetupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalConfigurationServiceSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsIdServicesetupsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalConfigurationServiceSetup, ConnectWiseManageRequestParams], - IPuttable[PortalConfigurationServiceSetup, ConnectWiseManageRequestParams], IPatchable[PortalConfigurationServiceSetup, ConnectWiseManageRequestParams], + IPuttable[PortalConfigurationServiceSetup, ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationServiceSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalConfigurationServiceSetup) - IPuttable.__init__(self, PortalConfigurationServiceSetup) IPatchable.__init__(self, PortalConfigurationServiceSetup) + IPuttable.__init__(self, PortalConfigurationServiceSetup) IPaginateable.__init__(self, PortalConfigurationServiceSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationServiceSetup]: """ Performs a GET request against the /company/portalConfigurations/{id}/serviceSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalConfigurationServiceSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalConfigurationServiceSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationServiceSetup: """ Performs a GET request against the /company/portalConfigurations/{id}/serviceSetups/{id} endpoint. @@ -75,17 +59,14 @@ def get( PortalConfigurationServiceSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationServiceSetup, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationServiceSetup, super()._make_request("GET", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationServiceSetup: """ - Performs a PUT request against the /company/portalConfigurations/{id}/serviceSetups/{id} endpoint. + Performs a PATCH request against the /company/portalConfigurations/{id}/serviceSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -94,17 +75,14 @@ def put( PortalConfigurationServiceSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationServiceSetup, - super()._make_request("PUT", data=data, params=params).json(), + PortalConfigurationServiceSetup, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationServiceSetup: """ - Performs a PATCH request against the /company/portalConfigurations/{id}/serviceSetups/{id} endpoint. + Performs a PUT request against the /company/portalConfigurations/{id}/serviceSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,6 +91,5 @@ def patch( PortalConfigurationServiceSetup: The parsed response data. """ return self._parse_one( - PortalConfigurationServiceSetup, - super()._make_request("PATCH", data=data, params=params).json(), + PortalConfigurationServiceSetup, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupEndpoint.py index 5d00bf625..385e82739 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupEndpoint.py @@ -1,17 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint import ( CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class CompanyPortalconfigurationsInvoicesetupEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoiceSetup", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "invoiceSetup", parent_endpoint=parent_endpoint) self.payment_processors = self._register_child_endpoint( - CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint.py index 081aff737..26034be39 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/portalConfigurations/invoiceSetup/paymentProcessors/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/portalConfigurations/invoiceSetup/paymentProcessors/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint.py index 27a40542f..23e8c5cd5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint import ( CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint, @@ -5,60 +7,44 @@ from pyconnectwise.endpoints.manage.CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint import ( CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalConfigurationPaymentProcessor from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsInvoicesetupPaymentprocessorsEndpoint( ConnectWiseEndpoint, - IGettable[ - list[PortalConfigurationPaymentProcessor], ConnectWiseManageRequestParams - ], + IGettable[list[PortalConfigurationPaymentProcessor], ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationPaymentProcessor, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "paymentProcessors", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "paymentProcessors", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalConfigurationPaymentProcessor]) IPaginateable.__init__(self, PortalConfigurationPaymentProcessor) self.count = self._register_child_endpoint( - CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint( - client, parent_endpoint=self - ) + CompanyPortalconfigurationsInvoicesetupPaymentprocessorsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint: + def id(self, _id: int) -> CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint: The initialized CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint object. """ - child = CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationPaymentProcessor]: """ Performs a GET request against the /company/portalConfigurations/invoiceSetup/paymentProcessors endpoint and returns an initialized PaginatedResponse object. @@ -85,9 +71,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalConfigurationPaymentProcessor]: """ Performs a GET request against the /company/portalConfigurations/invoiceSetup/paymentProcessors endpoint. @@ -99,6 +83,5 @@ def get( list[PortalConfigurationPaymentProcessor]: The parsed response data. """ return self._parse_many( - PortalConfigurationPaymentProcessor, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationPaymentProcessor, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint.py index 80ab755e9..bc1688b61 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalConfigurationPaymentProcessor from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalconfigurationsInvoicesetupPaymentprocessorsIdEndpoint( IGettable[PortalConfigurationPaymentProcessor, ConnectWiseManageRequestParams], IPaginateable[PortalConfigurationPaymentProcessor, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalConfigurationPaymentProcessor) IPaginateable.__init__(self, PortalConfigurationPaymentProcessor) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalConfigurationPaymentProcessor]: """ Performs a GET request against the /company/portalConfigurations/invoiceSetup/paymentProcessors/{id} endpoint and returns an initialized PaginatedResponse object. @@ -54,9 +48,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalConfigurationPaymentProcessor: """ Performs a GET request against the /company/portalConfigurations/invoiceSetup/paymentProcessors/{id} endpoint. @@ -68,6 +60,5 @@ def get( PortalConfigurationPaymentProcessor: The parsed response data. """ return self._parse_one( - PortalConfigurationPaymentProcessor, - super()._make_request("GET", data=data, params=params).json(), + PortalConfigurationPaymentProcessor, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsCountEndpoint.py index 6d1298a50..81ff0d7eb 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalsecuritylevelsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalsecuritylevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/portalSecurityLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/portalSecurityLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsEndpoint.py index beda03c4e..10efc7d3a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalsecuritylevelsCountEndpoint import ( CompanyPortalsecuritylevelsCountEndpoint, ) -from pyconnectwise.endpoints.manage.CompanyPortalsecuritylevelsIdEndpoint import ( - CompanyPortalsecuritylevelsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyPortalsecuritylevelsIdEndpoint import CompanyPortalsecuritylevelsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalSecurityLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalsecuritylevelsEndpoint( @@ -22,10 +19,8 @@ class CompanyPortalsecuritylevelsEndpoint( IGettable[list[PortalSecurityLevel], ConnectWiseManageRequestParams], IPaginateable[PortalSecurityLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "portalSecurityLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "portalSecurityLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalSecurityLevel]) IPaginateable.__init__(self, PortalSecurityLevel) @@ -33,24 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyPortalsecuritylevelsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyPortalsecuritylevelsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyPortalsecuritylevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalsecuritylevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalsecuritylevelsIdEndpoint: The initialized CompanyPortalsecuritylevelsIdEndpoint object. """ child = CompanyPortalsecuritylevelsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalSecurityLevel]: """ Performs a GET request against the /company/portalSecurityLevels endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalSecurityLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalSecurityLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalSecurityLevel]: """ Performs a GET request against the /company/portalSecurityLevels endpoint. @@ -90,7 +75,4 @@ def get( Returns: list[PortalSecurityLevel]: The parsed response data. """ - return self._parse_many( - PortalSecurityLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PortalSecurityLevel, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsIdEndpoint.py index f6f2312a3..a098ea7e4 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritylevelsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalSecurityLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalsecuritylevelsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalSecurityLevel, ConnectWiseManageRequestParams], - IPuttable[PortalSecurityLevel, ConnectWiseManageRequestParams], IPatchable[PortalSecurityLevel, ConnectWiseManageRequestParams], + IPuttable[PortalSecurityLevel, ConnectWiseManageRequestParams], IPaginateable[PortalSecurityLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalSecurityLevel) - IPuttable.__init__(self, PortalSecurityLevel) IPatchable.__init__(self, PortalSecurityLevel) + IPuttable.__init__(self, PortalSecurityLevel) IPaginateable.__init__(self, PortalSecurityLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalSecurityLevel]: """ Performs a GET request against the /company/portalSecurityLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalSecurityLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalSecurityLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalSecurityLevel: """ Performs a GET request against the /company/portalSecurityLevels/{id} endpoint. @@ -74,18 +58,13 @@ def get( Returns: PortalSecurityLevel: The parsed response data. """ - return self._parse_one( - PortalSecurityLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(PortalSecurityLevel, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalSecurityLevel: """ - Performs a PUT request against the /company/portalSecurityLevels/{id} endpoint. + Performs a PATCH request against the /company/portalSecurityLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +72,13 @@ def put( Returns: PortalSecurityLevel: The parsed response data. """ - return self._parse_one( - PortalSecurityLevel, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(PortalSecurityLevel, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalSecurityLevel: """ - Performs a PATCH request against the /company/portalSecurityLevels/{id} endpoint. + Performs a PUT request against the /company/portalSecurityLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +86,4 @@ def patch( Returns: PortalSecurityLevel: The parsed response data. """ - return self._parse_one( - PortalSecurityLevel, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PortalSecurityLevel, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsCountEndpoint.py index 551b7856a..7b26bb767 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalsecuritysettingsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyPortalsecuritysettingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/portalSecuritySettings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/portalSecuritySettings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsEndpoint.py index 0292e86a3..c517b2d80 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.CompanyPortalsecuritysettingsCountEndpoint import ( CompanyPortalsecuritysettingsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.CompanyPortalsecuritysettingsIdEndpoint import ( CompanyPortalsecuritysettingsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalSecuritySetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalsecuritysettingsEndpoint( @@ -22,10 +21,8 @@ class CompanyPortalsecuritysettingsEndpoint( IGettable[list[PortalSecuritySetting], ConnectWiseManageRequestParams], IPaginateable[PortalSecuritySetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "portalSecuritySettings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "portalSecuritySettings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalSecuritySetting]) IPaginateable.__init__(self, PortalSecuritySetting) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 CompanyPortalsecuritysettingsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> CompanyPortalsecuritysettingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyPortalsecuritysettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyPortalsecuritysettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyPortalsecuritysettingsIdEndpoint: The initialized CompanyPortalsecuritysettingsIdEndpoint object. """ - child = CompanyPortalsecuritysettingsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = CompanyPortalsecuritysettingsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalSecuritySetting]: """ Performs a GET request against the /company/portalSecuritySettings endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalSecuritySetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalSecuritySetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalSecuritySetting]: """ Performs a GET request against the /company/portalSecuritySettings endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[PortalSecuritySetting]: The parsed response data. """ - return self._parse_many( - PortalSecuritySetting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PortalSecuritySetting, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsIdEndpoint.py index 34a286487..6b91ea09f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyPortalsecuritysettingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalSecuritySetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyPortalsecuritysettingsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalSecuritySetting, ConnectWiseManageRequestParams], - IPuttable[PortalSecuritySetting, ConnectWiseManageRequestParams], IPatchable[PortalSecuritySetting, ConnectWiseManageRequestParams], + IPuttable[PortalSecuritySetting, ConnectWiseManageRequestParams], IPaginateable[PortalSecuritySetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalSecuritySetting) - IPuttable.__init__(self, PortalSecuritySetting) IPatchable.__init__(self, PortalSecuritySetting) + IPuttable.__init__(self, PortalSecuritySetting) IPaginateable.__init__(self, PortalSecuritySetting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalSecuritySetting]: """ Performs a GET request against the /company/portalSecuritySettings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalSecuritySetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalSecuritySetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalSecuritySetting: """ Performs a GET request against the /company/portalSecuritySettings/{id} endpoint. @@ -74,18 +58,13 @@ def get( Returns: PortalSecuritySetting: The parsed response data. """ - return self._parse_one( - PortalSecuritySetting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(PortalSecuritySetting, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PortalSecuritySetting: """ - Performs a PUT request against the /company/portalSecuritySettings/{id} endpoint. + Performs a PATCH request against the /company/portalSecuritySettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +72,13 @@ def put( Returns: PortalSecuritySetting: The parsed response data. """ - return self._parse_one( - PortalSecuritySetting, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(PortalSecuritySetting, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PortalSecuritySetting: """ - Performs a PATCH request against the /company/portalSecuritySettings/{id} endpoint. + Performs a PUT request against the /company/portalSecuritySettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +86,4 @@ def patch( Returns: PortalSecuritySetting: The parsed response data. """ - return self._parse_one( - PortalSecuritySetting, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PortalSecuritySetting, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesCountEndpoint.py index 3f04a489c..29094c11f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyStatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/states/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/states/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesEndpoint.py index a27c9feae..466662a50 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyStatesCountEndpoint import ( - CompanyStatesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyStatesIdEndpoint import ( - CompanyStatesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyStatesInfoEndpoint import ( - CompanyStatesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyStatesCountEndpoint import CompanyStatesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyStatesIdEndpoint import CompanyStatesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyStatesInfoEndpoint import CompanyStatesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import State from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesEndpoint( @@ -27,39 +19,30 @@ class CompanyStatesEndpoint( IPostable[State, ConnectWiseManageRequestParams], IPaginateable[State, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "states", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "states", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[State]) IPostable.__init__(self, State) IPaginateable.__init__(self, State) - self.count = self._register_child_endpoint( - CompanyStatesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyStatesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyStatesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyStatesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyStatesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyStatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyStatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyStatesIdEndpoint: The initialized CompanyStatesIdEndpoint object. """ child = CompanyStatesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[State]: """ Performs a GET request against the /company/states endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - State, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), State, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[State]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[State]: """ Performs a GET request against the /company/states endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[State]: The parsed response data. """ - return self._parse_many( - State, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(State, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> State: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> State: """ Performs a POST request against the /company/states endpoint. @@ -117,6 +83,4 @@ def post( Returns: State: The parsed response data. """ - return self._parse_one( - State, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(State, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesIdEndpoint.py index 18d7aab76..37b1d76b6 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyStatesIdInfoEndpoint import ( - CompanyStatesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyStatesIdUsagesEndpoint import ( - CompanyStatesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyStatesIdInfoEndpoint import CompanyStatesIdInfoEndpoint +from pyconnectwise.endpoints.manage.CompanyStatesIdUsagesEndpoint import CompanyStatesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import State from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesIdEndpoint( ConnectWiseEndpoint, IGettable[State, ConnectWiseManageRequestParams], - IPuttable[State, ConnectWiseManageRequestParams], IPatchable[State, ConnectWiseManageRequestParams], + IPuttable[State, ConnectWiseManageRequestParams], IPaginateable[State, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, State) - IPuttable.__init__(self, State) IPatchable.__init__(self, State) + IPuttable.__init__(self, State) IPaginateable.__init__(self, State) - self.usages = self._register_child_endpoint( - CompanyStatesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyStatesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyStatesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(CompanyStatesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[State]: """ Performs a GET request against the /company/states/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,40 +47,21 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - State, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), State, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> State: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/states/{id} endpoint. + Performs a DELETE request against the /company/states/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - State: The parsed response data. """ - return self._parse_one( - State, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> State: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> State: """ - Performs a PUT request against the /company/states/{id} endpoint. + Performs a GET request against the /company/states/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -105,15 +69,9 @@ def put( Returns: State: The parsed response data. """ - return self._parse_one( - State, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(State, super()._make_request("GET", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> State: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> State: """ Performs a PATCH request against the /company/states/{id} endpoint. @@ -123,20 +81,16 @@ def patch( Returns: State: The parsed response data. """ - return self._parse_one( - State, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(State, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> State: """ - Performs a DELETE request against the /company/states/{id} endpoint. + Performs a PUT request against the /company/states/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + State: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(State, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesIdInfoEndpoint.py index 8b4c5642c..a5f9dfde4 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import StateInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyStatesIdInfoEndpoint( IGettable[StateInfo, ConnectWiseManageRequestParams], IPaginateable[StateInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, StateInfo) IPaginateable.__init__(self, StateInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StateInfo]: """ Performs a GET request against the /company/states/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - StateInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), StateInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> StateInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> StateInfo: """ Performs a GET request against the /company/states/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: StateInfo: The parsed response data. """ - return self._parse_one( - StateInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(StateInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesEndpoint.py index d0c5c317e..e2db3073d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyStatesIdUsagesListEndpoint import ( - CompanyStatesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyStatesIdUsagesListEndpoint import CompanyStatesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class CompanyStatesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - CompanyStatesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(CompanyStatesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/states/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/states/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesListEndpoint.py index 18921acf2..9a013ed52 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyStatesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/states/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/states/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesInfoCountEndpoint.py index 288137cf2..7b2c66c0b 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyStatesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/states/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/states/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyStatesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyStatesInfoEndpoint.py index f4ef27d84..f282d95f7 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyStatesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyStatesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyStatesInfoCountEndpoint import ( - CompanyStatesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyStatesInfoCountEndpoint import CompanyStatesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import StateInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyStatesInfoEndpoint( @@ -19,22 +16,15 @@ class CompanyStatesInfoEndpoint( IGettable[list[StateInfo], ConnectWiseManageRequestParams], IPaginateable[StateInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[StateInfo]) IPaginateable.__init__(self, StateInfo) - self.count = self._register_child_endpoint( - CompanyStatesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyStatesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StateInfo]: """ Performs a GET request against the /company/states/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - StateInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), StateInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[StateInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[StateInfo]: """ Performs a GET request against the /company/states/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[StateInfo]: The parsed response data. """ - return self._parse_many( - StateInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(StateInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesCountEndpoint.py index aaf87b64c..458411ef9 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesCountEndpoint( @@ -16,18 +15,13 @@ class CompanyTeamrolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/teamRoles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/teamRoles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesEndpoint.py index ac3a19222..c7bbb0bb1 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyTeamrolesCountEndpoint import ( - CompanyTeamrolesCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyTeamrolesIdEndpoint import ( - CompanyTeamrolesIdEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyTeamrolesInfoEndpoint import ( - CompanyTeamrolesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyTeamrolesCountEndpoint import CompanyTeamrolesCountEndpoint +from pyconnectwise.endpoints.manage.CompanyTeamrolesIdEndpoint import CompanyTeamrolesIdEndpoint +from pyconnectwise.endpoints.manage.CompanyTeamrolesInfoEndpoint import CompanyTeamrolesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TeamRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesEndpoint( @@ -27,39 +19,30 @@ class CompanyTeamrolesEndpoint( IPostable[TeamRole, ConnectWiseManageRequestParams], IPaginateable[TeamRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "teamRoles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "teamRoles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TeamRole]) IPostable.__init__(self, TeamRole) IPaginateable.__init__(self, TeamRole) - self.count = self._register_child_endpoint( - CompanyTeamrolesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyTeamrolesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyTeamrolesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(CompanyTeamrolesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyTeamrolesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyTeamrolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyTeamrolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyTeamrolesIdEndpoint: The initialized CompanyTeamrolesIdEndpoint object. """ child = CompanyTeamrolesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TeamRole]: """ Performs a GET request against the /company/teamRoles endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TeamRole, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TeamRole, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TeamRole]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TeamRole]: """ Performs a GET request against the /company/teamRoles endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[TeamRole]: The parsed response data. """ - return self._parse_many( - TeamRole, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TeamRole, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TeamRole: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TeamRole: """ Performs a POST request against the /company/teamRoles endpoint. @@ -117,6 +83,4 @@ def post( Returns: TeamRole: The parsed response data. """ - return self._parse_one( - TeamRole, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TeamRole, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdEndpoint.py index a90ecbcb4..254c41b96 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyTeamrolesIdInfoEndpoint import ( - CompanyTeamrolesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyTeamrolesIdUsagesEndpoint import ( - CompanyTeamrolesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyTeamrolesIdInfoEndpoint import CompanyTeamrolesIdInfoEndpoint +from pyconnectwise.endpoints.manage.CompanyTeamrolesIdUsagesEndpoint import CompanyTeamrolesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TeamRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesIdEndpoint( ConnectWiseEndpoint, IGettable[TeamRole, ConnectWiseManageRequestParams], - IPuttable[TeamRole, ConnectWiseManageRequestParams], IPatchable[TeamRole, ConnectWiseManageRequestParams], + IPuttable[TeamRole, ConnectWiseManageRequestParams], IPaginateable[TeamRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TeamRole) - IPuttable.__init__(self, TeamRole) IPatchable.__init__(self, TeamRole) + IPuttable.__init__(self, TeamRole) IPaginateable.__init__(self, TeamRole) - self.usages = self._register_child_endpoint( - CompanyTeamrolesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - CompanyTeamrolesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(CompanyTeamrolesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(CompanyTeamrolesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TeamRole]: """ Performs a GET request against the /company/teamRoles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +47,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TeamRole, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TeamRole, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TeamRole: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/teamRoles/{id} endpoint. + Performs a DELETE request against the /company/teamRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TeamRole: The parsed response data. """ - return self._parse_one( - TeamRole, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TeamRole: """ - Performs a DELETE request against the /company/teamRoles/{id} endpoint. + Performs a GET request against the /company/teamRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TeamRole: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TeamRole, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TeamRole: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TeamRole: """ - Performs a PUT request against the /company/teamRoles/{id} endpoint. + Performs a PATCH request against the /company/teamRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +81,11 @@ def put( Returns: TeamRole: The parsed response data. """ - return self._parse_one( - TeamRole, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TeamRole, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TeamRole: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TeamRole: """ - Performs a PATCH request against the /company/teamRoles/{id} endpoint. + Performs a PUT request against the /company/teamRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +93,4 @@ def patch( Returns: TeamRole: The parsed response data. """ - return self._parse_one( - TeamRole, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TeamRole, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdInfoEndpoint.py index 624f23655..5817b7c80 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TeamRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesIdInfoEndpoint( @@ -16,18 +15,13 @@ class CompanyTeamrolesIdInfoEndpoint( IGettable[TeamRoleInfo, ConnectWiseManageRequestParams], IPaginateable[TeamRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, TeamRoleInfo) IPaginateable.__init__(self, TeamRoleInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TeamRoleInfo]: """ Performs a GET request against the /company/teamRoles/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TeamRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TeamRoleInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TeamRoleInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TeamRoleInfo: """ Performs a GET request against the /company/teamRoles/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: TeamRoleInfo: The parsed response data. """ - return self._parse_one( - TeamRoleInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(TeamRoleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesEndpoint.py index 9cb797099..6fcd2afd0 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyTeamrolesIdUsagesListEndpoint import ( - CompanyTeamrolesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyTeamrolesIdUsagesListEndpoint import CompanyTeamrolesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class CompanyTeamrolesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - CompanyTeamrolesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(CompanyTeamrolesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/teamRoles/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/teamRoles/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesListEndpoint.py index 3bdfb9e66..49c29bda7 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class CompanyTeamrolesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /company/teamRoles/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /company/teamRoles/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoCountEndpoint.py index 8ffbc5b22..301195995 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesInfoCountEndpoint( @@ -16,18 +15,13 @@ class CompanyTeamrolesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/teamRoles/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/teamRoles/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoEndpoint.py index bdccc1ebc..c7ba6915f 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTeamrolesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyTeamrolesInfoCountEndpoint import ( - CompanyTeamrolesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.CompanyTeamrolesInfoCountEndpoint import CompanyTeamrolesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TeamRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTeamrolesInfoEndpoint( @@ -19,22 +16,15 @@ class CompanyTeamrolesInfoEndpoint( IGettable[list[TeamRoleInfo], ConnectWiseManageRequestParams], IPaginateable[TeamRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TeamRoleInfo]) IPaginateable.__init__(self, TeamRoleInfo) - self.count = self._register_child_endpoint( - CompanyTeamrolesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyTeamrolesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TeamRoleInfo]: """ Performs a GET request against the /company/teamRoles/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TeamRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TeamRoleInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TeamRoleInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TeamRoleInfo]: """ Performs a GET request against the /company/teamRoles/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[TeamRoleInfo]: The parsed response data. """ - return self._parse_many( - TeamRoleInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TeamRoleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTracksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTracksCountEndpoint.py index 997144700..7ee5d001a 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTracksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTracksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTracksCountEndpoint( @@ -16,18 +15,13 @@ class CompanyTracksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/tracks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/tracks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTracksEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTracksEndpoint.py index cf46aa163..f5037ec62 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTracksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTracksEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyTracksCountEndpoint import ( - CompanyTracksCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyTracksIdEndpoint import ( - CompanyTracksIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyTracksCountEndpoint import CompanyTracksCountEndpoint +from pyconnectwise.endpoints.manage.CompanyTracksIdEndpoint import CompanyTracksIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Track from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTracksEndpoint( @@ -24,36 +18,29 @@ class CompanyTracksEndpoint( IPostable[Track, ConnectWiseManageRequestParams], IPaginateable[Track, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tracks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tracks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Track]) IPostable.__init__(self, Track) IPaginateable.__init__(self, Track) - self.count = self._register_child_endpoint( - CompanyTracksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyTracksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyTracksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyTracksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyTracksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyTracksIdEndpoint: The initialized CompanyTracksIdEndpoint object. """ child = CompanyTracksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Track]: """ Performs a GET request against the /company/tracks endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Track, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Track, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Track]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Track]: """ Performs a GET request against the /company/tracks endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Track]: The parsed response data. """ - return self._parse_many( - Track, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Track, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Track: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Track: """ Performs a POST request against the /company/tracks endpoint. @@ -111,6 +81,4 @@ def post( Returns: Track: The parsed response data. """ - return self._parse_one( - Track, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Track, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsCountEndpoint.py index 0675808a0..f64889805 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTracksIdActionsCountEndpoint( @@ -16,18 +15,13 @@ class CompanyTracksIdActionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /company/tracks/{id}/actions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /company/tracks/{id}/actions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsEndpoint.py index 44e6a6503..758e8533d 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyTracksIdActionsCountEndpoint import ( - CompanyTracksIdActionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.CompanyTracksIdActionsIdEndpoint import ( - CompanyTracksIdActionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.CompanyTracksIdActionsCountEndpoint import CompanyTracksIdActionsCountEndpoint +from pyconnectwise.endpoints.manage.CompanyTracksIdActionsIdEndpoint import CompanyTracksIdActionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TrackAction from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTracksIdActionsEndpoint( @@ -24,36 +18,29 @@ class CompanyTracksIdActionsEndpoint( IPostable[TrackAction, ConnectWiseManageRequestParams], IPaginateable[TrackAction, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "actions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "actions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TrackAction]) IPostable.__init__(self, TrackAction) IPaginateable.__init__(self, TrackAction) - self.count = self._register_child_endpoint( - CompanyTracksIdActionsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(CompanyTracksIdActionsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> CompanyTracksIdActionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> CompanyTracksIdActionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized CompanyTracksIdActionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: CompanyTracksIdActionsIdEndpoint: The initialized CompanyTracksIdActionsIdEndpoint object. """ child = CompanyTracksIdActionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TrackAction]: """ Performs a GET request against the /company/tracks/{id}/actions endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TrackAction, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TrackAction, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TrackAction]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TrackAction]: """ Performs a GET request against the /company/tracks/{id}/actions endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[TrackAction]: The parsed response data. """ - return self._parse_many( - TrackAction, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TrackAction, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TrackAction: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TrackAction: """ Performs a POST request against the /company/tracks/{id}/actions endpoint. @@ -111,6 +83,4 @@ def post( Returns: TrackAction: The parsed response data. """ - return self._parse_one( - TrackAction, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TrackAction, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsIdEndpoint.py index 847ba235f..400910acd 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTracksIdActionsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TrackAction from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTracksIdActionsIdEndpoint( ConnectWiseEndpoint, IGettable[TrackAction, ConnectWiseManageRequestParams], - IPuttable[TrackAction, ConnectWiseManageRequestParams], IPatchable[TrackAction, ConnectWiseManageRequestParams], + IPuttable[TrackAction, ConnectWiseManageRequestParams], IPaginateable[TrackAction, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TrackAction) - IPuttable.__init__(self, TrackAction) IPatchable.__init__(self, TrackAction) + IPuttable.__init__(self, TrackAction) IPaginateable.__init__(self, TrackAction) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TrackAction]: """ Performs a GET request against the /company/tracks/{id}/actions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,39 +43,22 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TrackAction, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TrackAction, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TrackAction: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/tracks/{id}/actions/{id} endpoint. + Performs a DELETE request against the /company/tracks/{id}/actions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TrackAction: The parsed response data. """ - return self._parse_one( - TrackAction, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TrackAction: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TrackAction: """ - Performs a PUT request against the /company/tracks/{id}/actions/{id} endpoint. + Performs a GET request against the /company/tracks/{id}/actions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,15 +66,9 @@ def put( Returns: TrackAction: The parsed response data. """ - return self._parse_one( - TrackAction, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TrackAction, super()._make_request("GET", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TrackAction: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TrackAction: """ Performs a PATCH request against the /company/tracks/{id}/actions/{id} endpoint. @@ -110,20 +78,16 @@ def patch( Returns: TrackAction: The parsed response data. """ - return self._parse_one( - TrackAction, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TrackAction, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TrackAction: """ - Performs a DELETE request against the /company/tracks/{id}/actions/{id} endpoint. + Performs a PUT request against the /company/tracks/{id}/actions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TrackAction: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TrackAction, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/CompanyTracksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/CompanyTracksIdEndpoint.py index a32343c0e..151c70ff5 100644 --- a/src/pyconnectwise/endpoints/manage/CompanyTracksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/CompanyTracksIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.CompanyTracksIdActionsEndpoint import ( - CompanyTracksIdActionsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.CompanyTracksIdActionsEndpoint import CompanyTracksIdActionsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Track from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class CompanyTracksIdEndpoint( ConnectWiseEndpoint, IGettable[Track, ConnectWiseManageRequestParams], - IPuttable[Track, ConnectWiseManageRequestParams], IPatchable[Track, ConnectWiseManageRequestParams], + IPuttable[Track, ConnectWiseManageRequestParams], IPaginateable[Track, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Track) - IPuttable.__init__(self, Track) IPatchable.__init__(self, Track) + IPuttable.__init__(self, Track) IPaginateable.__init__(self, Track) - self.actions = self._register_child_endpoint( - CompanyTracksIdActionsEndpoint(client, parent_endpoint=self) - ) + self.actions = self._register_child_endpoint(CompanyTracksIdActionsEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Track]: """ Performs a GET request against the /company/tracks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Track, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Track, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Track: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /company/tracks/{id} endpoint. + Performs a DELETE request against the /company/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Track: The parsed response data. """ - return self._parse_one( - Track, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Track: """ - Performs a DELETE request against the /company/tracks/{id} endpoint. + Performs a GET request against the /company/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Track: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Track, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Track: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Track: """ - Performs a PUT request against the /company/tracks/{id} endpoint. + Performs a PATCH request against the /company/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: Track: The parsed response data. """ - return self._parse_one( - Track, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Track, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Track: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Track: """ - Performs a PATCH request against the /company/tracks/{id} endpoint. + Performs a PUT request against the /company/tracks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: Track: The parsed response data. """ - return self._parse_one( - Track, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Track, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsEndpoint.py index 621d6a53b..01d525daf 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ConfigurationsTypesEndpoint import ( - ConfigurationsTypesEndpoint, -) +from pyconnectwise.endpoints.manage.ConfigurationsTypesEndpoint import ConfigurationsTypesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "configurations", parent_endpoint=parent_endpoint - ) - - self.types = self._register_child_endpoint( - ConfigurationsTypesEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "configurations", parent_endpoint=parent_endpoint) + + self.types = self._register_child_endpoint(ConfigurationsTypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesEndpoint.py index 7e96533b0..d618aca75 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ConfigurationsTypesIdEndpoint import ( - ConfigurationsTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ConfigurationsTypesInfoEndpoint import ( - ConfigurationsTypesInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ConfigurationsTypesIdEndpoint import ConfigurationsTypesIdEndpoint +from pyconnectwise.endpoints.manage.ConfigurationsTypesInfoEndpoint import ConfigurationsTypesInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - ConfigurationsTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ConfigurationsTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ConfigurationsTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ConfigurationsTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ConfigurationsTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ConfigurationsTypesIdEndpoint: The initialized ConfigurationsTypesIdEndpoint object. """ child = ConfigurationsTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdEndpoint.py index bd5e3f765..30082a6bb 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdEndpoint.py @@ -1,14 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsEndpoint import ( - ConfigurationsTypesIdQuestionsEndpoint, -) +from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsEndpoint import ConfigurationsTypesIdQuestionsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.questions = self._register_child_endpoint( ConfigurationsTypesIdQuestionsEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsEndpoint.py index b3b7e465b..16f53e66b 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsIdEndpoint import ( ConfigurationsTypesIdQuestionsIdEndpoint, @@ -6,28 +8,27 @@ ConfigurationsTypesIdQuestionsInfoEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ConfigurationsTypesIdQuestionsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "questions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "questions", parent_endpoint=parent_endpoint) self.info = self._register_child_endpoint( ConfigurationsTypesIdQuestionsInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ConfigurationsTypesIdQuestionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ConfigurationsTypesIdQuestionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ConfigurationsTypesIdQuestionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ConfigurationsTypesIdQuestionsIdEndpoint: The initialized ConfigurationsTypesIdQuestionsIdEndpoint object. """ - child = ConfigurationsTypesIdQuestionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ConfigurationsTypesIdQuestionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdEndpoint.py index 71670f80e..172f9aead 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsIdInfoEndpoint import ( ConfigurationsTypesIdQuestionsIdInfoEndpoint, @@ -6,16 +8,17 @@ ConfigurationsTypesIdQuestionsIdValuesEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ConfigurationsTypesIdQuestionsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.values = self._register_child_endpoint( - ConfigurationsTypesIdQuestionsIdValuesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( ConfigurationsTypesIdQuestionsIdInfoEndpoint(client, parent_endpoint=self) ) + self.values = self._register_child_endpoint( + ConfigurationsTypesIdQuestionsIdValuesEndpoint(client, parent_endpoint=self) + ) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdInfoEndpoint.py index 283697d8c..f786153ae 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationTypeQuestionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesIdQuestionsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ConfigurationsTypesIdQuestionsIdInfoEndpoint( IGettable[ConfigurationTypeQuestionInfo, ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationTypeQuestionInfo) IPaginateable.__init__(self, ConfigurationTypeQuestionInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestionInfo]: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeQuestionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeQuestionInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestionInfo: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/info endpoint. @@ -68,6 +55,5 @@ def get( ConfigurationTypeQuestionInfo: The parsed response data. """ return self._parse_one( - ConfigurationTypeQuestionInfo, - super()._make_request("GET", data=data, params=params).json(), + ConfigurationTypeQuestionInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesEndpoint.py index 8867a6696..2f7e13246 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsIdValuesIdEndpoint import ( ConfigurationsTypesIdQuestionsIdValuesIdEndpoint, @@ -6,32 +8,27 @@ ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ConfigurationsTypesIdQuestionsIdValuesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "values", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "values", parent_endpoint=parent_endpoint) self.info = self._register_child_endpoint( - ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint( - client, parent_endpoint=self - ) + ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ConfigurationsTypesIdQuestionsIdValuesIdEndpoint: + def id(self, _id: int) -> ConfigurationsTypesIdQuestionsIdValuesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ConfigurationsTypesIdQuestionsIdValuesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ConfigurationsTypesIdQuestionsIdValuesIdEndpoint: The initialized ConfigurationsTypesIdQuestionsIdValuesIdEndpoint object. """ - child = ConfigurationsTypesIdQuestionsIdValuesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ConfigurationsTypesIdQuestionsIdValuesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py index a39fe3781..fc599b589 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdEndpoint.py @@ -1,17 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint import ( ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ConfigurationsTypesIdQuestionsIdValuesIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.info = self._register_child_endpoint( - ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint( - client, parent_endpoint=self - ) + ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint.py index a13a498ef..f42920321 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationTypeQuestionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ConfigurationsTypesIdQuestionsIdValuesIdInfoEndpoint( IGettable[ConfigurationTypeQuestionInfo, ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationTypeQuestionInfo) IPaginateable.__init__(self, ConfigurationTypeQuestionInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestionInfo]: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/values/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeQuestionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeQuestionInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationTypeQuestionInfo: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/values/{id}/info endpoint. @@ -68,6 +55,5 @@ def get( ConfigurationTypeQuestionInfo: The parsed response data. """ return self._parse_one( - ConfigurationTypeQuestionInfo, - super()._make_request("GET", data=data, params=params).json(), + ConfigurationTypeQuestionInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint.py index e0d252c51..fa69250c7 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/values/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/values/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint.py index cc1f43814..e9b5d6310 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint import ( ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationTypeQuestionValueInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint( @@ -19,24 +18,17 @@ class ConfigurationsTypesIdQuestionsIdValuesInfoEndpoint( IGettable[list[ConfigurationTypeQuestionValueInfo], ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestionValueInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationTypeQuestionValueInfo]) IPaginateable.__init__(self, ConfigurationTypeQuestionValueInfo) self.count = self._register_child_endpoint( - ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint( - client, parent_endpoint=self - ) + ConfigurationsTypesIdQuestionsIdValuesInfoCountEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestionValueInfo]: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/values/info endpoint and returns an initialized PaginatedResponse object. @@ -63,9 +55,7 @@ def paginated( ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationTypeQuestionValueInfo]: """ Performs a GET request against the /configurations/types/{id}/questions/{id}/values/info endpoint. @@ -77,6 +67,5 @@ def get( list[ConfigurationTypeQuestionValueInfo]: The parsed response data. """ return self._parse_many( - ConfigurationTypeQuestionValueInfo, - super()._make_request("GET", data=data, params=params).json(), + ConfigurationTypeQuestionValueInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoCountEndpoint.py index 7bd771f32..79f7e80f8 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesIdQuestionsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ConfigurationsTypesIdQuestionsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /configurations/types/{id}/questions/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /configurations/types/{id}/questions/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoEndpoint.py index 4848e7e3f..87895ac16 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesIdQuestionsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ConfigurationsTypesIdQuestionsInfoCountEndpoint import ( ConfigurationsTypesIdQuestionsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationTypeQuestionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesIdQuestionsInfoEndpoint( @@ -19,24 +18,17 @@ class ConfigurationsTypesIdQuestionsInfoEndpoint( IGettable[list[ConfigurationTypeQuestionInfo], ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeQuestionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationTypeQuestionInfo]) IPaginateable.__init__(self, ConfigurationTypeQuestionInfo) self.count = self._register_child_endpoint( - ConfigurationsTypesIdQuestionsInfoCountEndpoint( - client, parent_endpoint=self - ) + ConfigurationsTypesIdQuestionsInfoCountEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeQuestionInfo]: """ Performs a GET request against the /configurations/types/{id}/questions/info endpoint and returns an initialized PaginatedResponse object. @@ -54,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeQuestionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeQuestionInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationTypeQuestionInfo]: """ Performs a GET request against the /configurations/types/{id}/questions/info endpoint. @@ -77,6 +62,5 @@ def get( list[ConfigurationTypeQuestionInfo]: The parsed response data. """ return self._parse_many( - ConfigurationTypeQuestionInfo, - super()._make_request("GET", data=data, params=params).json(), + ConfigurationTypeQuestionInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoCountEndpoint.py index 7cbff52d0..ff8f530f9 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ConfigurationsTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /configurations/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /configurations/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoEndpoint.py index 15146d1f1..4d88d8e8a 100644 --- a/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ConfigurationsTypesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ConfigurationsTypesInfoCountEndpoint import ( - ConfigurationsTypesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ConfigurationsTypesInfoCountEndpoint import ConfigurationsTypesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ConfigurationsTypesInfoEndpoint( @@ -19,22 +16,15 @@ class ConfigurationsTypesInfoEndpoint( IGettable[list[ConfigurationTypeInfo], ConnectWiseManageRequestParams], IPaginateable[ConfigurationTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationTypeInfo]) IPaginateable.__init__(self, ConfigurationTypeInfo) - self.count = self._register_child_endpoint( - ConfigurationsTypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ConfigurationsTypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationTypeInfo]: """ Performs a GET request against the /configurations/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationTypeInfo]: """ Performs a GET request against the /configurations/types/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ConfigurationTypeInfo]: The parsed response data. """ - return self._parse_many( - ConfigurationTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConfigurationTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseClassificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseClassificationsCountEndpoint.py index 794cb6630..843135f39 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseClassificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseClassificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseClassificationsCountEndpoint( @@ -16,18 +15,13 @@ class ExpenseClassificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/classifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/classifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseClassificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseClassificationsEndpoint.py index e2784abe4..acb71caea 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseClassificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseClassificationsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseClassificationsCountEndpoint import ( - ExpenseClassificationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseClassificationsIdEndpoint import ( - ExpenseClassificationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ExpenseClassificationsCountEndpoint import ExpenseClassificationsCountEndpoint +from pyconnectwise.endpoints.manage.ExpenseClassificationsIdEndpoint import ExpenseClassificationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Classification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseClassificationsEndpoint( @@ -22,35 +17,28 @@ class ExpenseClassificationsEndpoint( IGettable[list[Classification], ConnectWiseManageRequestParams], IPaginateable[Classification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "classifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "classifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Classification]) IPaginateable.__init__(self, Classification) - self.count = self._register_child_endpoint( - ExpenseClassificationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpenseClassificationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpenseClassificationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpenseClassificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpenseClassificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpenseClassificationsIdEndpoint: The initialized ExpenseClassificationsIdEndpoint object. """ child = ExpenseClassificationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Classification]: """ Performs a GET request against the /expense/classifications endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Classification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Classification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[Classification]: """ Performs a GET request against the /expense/classifications endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[Classification]: The parsed response data. """ - return self._parse_many( - Classification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(Classification, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseClassificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseClassificationsIdEndpoint.py index fcee9610a..5d2465b3b 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseClassificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseClassificationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Classification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseClassificationsIdEndpoint( @@ -16,18 +15,13 @@ class ExpenseClassificationsIdEndpoint( IGettable[Classification, ConnectWiseManageRequestParams], IPaginateable[Classification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Classification) IPaginateable.__init__(self, Classification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Classification]: """ Performs a GET request against the /expense/classifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Classification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Classification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Classification: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Classification: """ Performs a GET request against the /expense/classifications/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: Classification: The parsed response data. """ - return self._parse_one( - Classification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(Classification, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseEndpoint.py index 97991c081..4362e7a70 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseEndpoint.py @@ -1,37 +1,26 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseClassificationsEndpoint import ( - ExpenseClassificationsEndpoint, -) +from pyconnectwise.endpoints.manage.ExpenseClassificationsEndpoint import ExpenseClassificationsEndpoint from pyconnectwise.endpoints.manage.ExpenseEntriesEndpoint import ExpenseEntriesEndpoint from pyconnectwise.endpoints.manage.ExpenseInfoEndpoint import ExpenseInfoEndpoint -from pyconnectwise.endpoints.manage.ExpensePaymenttypesEndpoint import ( - ExpensePaymenttypesEndpoint, -) +from pyconnectwise.endpoints.manage.ExpensePaymenttypesEndpoint import ExpensePaymenttypesEndpoint from pyconnectwise.endpoints.manage.ExpenseReportsEndpoint import ExpenseReportsEndpoint from pyconnectwise.endpoints.manage.ExpenseTypesEndpoint import ExpenseTypesEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ExpenseEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "expense", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "expense", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - ExpenseInfoEndpoint(client, parent_endpoint=self) - ) self.classifications = self._register_child_endpoint( ExpenseClassificationsEndpoint(client, parent_endpoint=self) ) - self.entries = self._register_child_endpoint( - ExpenseEntriesEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - ExpenseTypesEndpoint(client, parent_endpoint=self) - ) - self.payment_types = self._register_child_endpoint( - ExpensePaymenttypesEndpoint(client, parent_endpoint=self) - ) - self.reports = self._register_child_endpoint( - ExpenseReportsEndpoint(client, parent_endpoint=self) - ) + self.entries = self._register_child_endpoint(ExpenseEntriesEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ExpenseInfoEndpoint(client, parent_endpoint=self)) + self.payment_types = self._register_child_endpoint(ExpensePaymenttypesEndpoint(client, parent_endpoint=self)) + self.reports = self._register_child_endpoint(ExpenseReportsEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(ExpenseTypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseEntriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseEntriesCountEndpoint.py index c04905537..b5eba0b80 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseEntriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseEntriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseEntriesCountEndpoint( @@ -16,18 +15,13 @@ class ExpenseEntriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/entries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/entries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseEntriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseEntriesEndpoint.py index 67ec54aae..b976188d7 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseEntriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseEntriesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseEntriesCountEndpoint import ( - ExpenseEntriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseEntriesIdEndpoint import ( - ExpenseEntriesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ExpenseEntriesCountEndpoint import ExpenseEntriesCountEndpoint +from pyconnectwise.endpoints.manage.ExpenseEntriesIdEndpoint import ExpenseEntriesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ExpenseEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseEntriesEndpoint( @@ -24,36 +18,29 @@ class ExpenseEntriesEndpoint( IPostable[ExpenseEntry, ConnectWiseManageRequestParams], IPaginateable[ExpenseEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "entries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "entries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseEntry]) IPostable.__init__(self, ExpenseEntry) IPaginateable.__init__(self, ExpenseEntry) - self.count = self._register_child_endpoint( - ExpenseEntriesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpenseEntriesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpenseEntriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpenseEntriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpenseEntriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpenseEntriesIdEndpoint: The initialized ExpenseEntriesIdEndpoint object. """ child = ExpenseEntriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseEntry]: """ Performs a GET request against the /expense/entries endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseEntry, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseEntry, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ExpenseEntry]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ExpenseEntry]: """ Performs a GET request against the /expense/entries endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ExpenseEntry]: The parsed response data. """ - return self._parse_many( - ExpenseEntry, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ExpenseEntry, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseEntry: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseEntry: """ Performs a POST request against the /expense/entries endpoint. @@ -111,6 +83,4 @@ def post( Returns: ExpenseEntry: The parsed response data. """ - return self._parse_one( - ExpenseEntry, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ExpenseEntry, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsCountEndpoint.py index db4435ac6..7cc519704 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseEntriesIdAuditsCountEndpoint( @@ -16,18 +15,13 @@ class ExpenseEntriesIdAuditsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/entries/{id}/audits/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/entries/{id}/audits/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsEndpoint.py index 268d1197a..1cab1f92e 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseEntriesIdAuditsCountEndpoint import ( - ExpenseEntriesIdAuditsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseEntriesIdAuditsIdEndpoint import ( - ExpenseEntriesIdAuditsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ExpenseEntriesIdAuditsCountEndpoint import ExpenseEntriesIdAuditsCountEndpoint +from pyconnectwise.endpoints.manage.ExpenseEntriesIdAuditsIdEndpoint import ExpenseEntriesIdAuditsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseEntryAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseEntriesIdAuditsEndpoint( @@ -22,35 +17,28 @@ class ExpenseEntriesIdAuditsEndpoint( IGettable[list[ExpenseEntryAudit], ConnectWiseManageRequestParams], IPaginateable[ExpenseEntryAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "audits", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "audits", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseEntryAudit]) IPaginateable.__init__(self, ExpenseEntryAudit) - self.count = self._register_child_endpoint( - ExpenseEntriesIdAuditsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpenseEntriesIdAuditsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpenseEntriesIdAuditsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpenseEntriesIdAuditsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpenseEntriesIdAuditsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpenseEntriesIdAuditsIdEndpoint: The initialized ExpenseEntriesIdAuditsIdEndpoint object. """ child = ExpenseEntriesIdAuditsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseEntryAudit]: """ Performs a GET request against the /expense/entries/{id}/audits endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseEntryAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseEntryAudit, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ExpenseEntryAudit]: """ Performs a GET request against the /expense/entries/{id}/audits endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ExpenseEntryAudit]: The parsed response data. """ - return self._parse_many( - ExpenseEntryAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ExpenseEntryAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsIdEndpoint.py index 9b3bac035..0890aa554 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdAuditsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseEntryAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseEntriesIdAuditsIdEndpoint( @@ -16,18 +15,13 @@ class ExpenseEntriesIdAuditsIdEndpoint( IGettable[ExpenseEntryAudit, ConnectWiseManageRequestParams], IPaginateable[ExpenseEntryAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseEntryAudit) IPaginateable.__init__(self, ExpenseEntryAudit) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseEntryAudit]: """ Performs a GET request against the /expense/entries/{id}/audits/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseEntryAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseEntryAudit, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseEntryAudit: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseEntryAudit: """ Performs a GET request against the /expense/entries/{id}/audits/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: ExpenseEntryAudit: The parsed response data. """ - return self._parse_one( - ExpenseEntryAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ExpenseEntryAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdEndpoint.py index e6b2ecf9c..e8d081231 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseEntriesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseEntriesIdAuditsEndpoint import ( - ExpenseEntriesIdAuditsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ExpenseEntriesIdAuditsEndpoint import ExpenseEntriesIdAuditsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ExpenseEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseEntriesIdEndpoint( ConnectWiseEndpoint, IGettable[ExpenseEntry, ConnectWiseManageRequestParams], - IPuttable[ExpenseEntry, ConnectWiseManageRequestParams], IPatchable[ExpenseEntry, ConnectWiseManageRequestParams], + IPuttable[ExpenseEntry, ConnectWiseManageRequestParams], IPaginateable[ExpenseEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseEntry) - IPuttable.__init__(self, ExpenseEntry) IPatchable.__init__(self, ExpenseEntry) + IPuttable.__init__(self, ExpenseEntry) IPaginateable.__init__(self, ExpenseEntry) - self.audits = self._register_child_endpoint( - ExpenseEntriesIdAuditsEndpoint(client, parent_endpoint=self) - ) + self.audits = self._register_child_endpoint(ExpenseEntriesIdAuditsEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseEntry]: """ Performs a GET request against the /expense/entries/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseEntry, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseEntry, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseEntry: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /expense/entries/{id} endpoint. + Performs a DELETE request against the /expense/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ExpenseEntry: The parsed response data. """ - return self._parse_one( - ExpenseEntry, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseEntry: """ - Performs a DELETE request against the /expense/entries/{id} endpoint. + Performs a GET request against the /expense/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ExpenseEntry: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ExpenseEntry, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseEntry: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ExpenseEntry: """ - Performs a PUT request against the /expense/entries/{id} endpoint. + Performs a PATCH request against the /expense/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: ExpenseEntry: The parsed response data. """ - return self._parse_one( - ExpenseEntry, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ExpenseEntry, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseEntry: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseEntry: """ - Performs a PATCH request against the /expense/entries/{id} endpoint. + Performs a PUT request against the /expense/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +93,4 @@ def patch( Returns: ExpenseEntry: The parsed response data. """ - return self._parse_one( - ExpenseEntry, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ExpenseEntry, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseInfoEndpoint.py index 6ab49e884..1a0f8d101 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseInfoEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseInfoTaxtypesEndpoint import ( - ExpenseInfoTaxtypesEndpoint, -) +from pyconnectwise.endpoints.manage.ExpenseInfoTaxtypesEndpoint import ExpenseInfoTaxtypesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - - self.tax_types = self._register_child_endpoint( - ExpenseInfoTaxtypesEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + + self.tax_types = self._register_child_endpoint(ExpenseInfoTaxtypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesCountEndpoint.py index b180dd1ad..31bbf3331 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseInfoTaxtypesCountEndpoint( @@ -16,18 +15,13 @@ class ExpenseInfoTaxtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/info/taxTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/info/taxTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesEndpoint.py index 255f0121f..916f3cdec 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseInfoTaxtypesCountEndpoint import ( - ExpenseInfoTaxtypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseInfoTaxtypesIdEndpoint import ( - ExpenseInfoTaxtypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ExpenseInfoTaxtypesCountEndpoint import ExpenseInfoTaxtypesCountEndpoint +from pyconnectwise.endpoints.manage.ExpenseInfoTaxtypesIdEndpoint import ExpenseInfoTaxtypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseTaxTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseInfoTaxtypesEndpoint( @@ -22,35 +17,28 @@ class ExpenseInfoTaxtypesEndpoint( IGettable[list[ExpenseTaxTypeInfo], ConnectWiseManageRequestParams], IPaginateable[ExpenseTaxTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseTaxTypeInfo]) IPaginateable.__init__(self, ExpenseTaxTypeInfo) - self.count = self._register_child_endpoint( - ExpenseInfoTaxtypesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpenseInfoTaxtypesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpenseInfoTaxtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpenseInfoTaxtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpenseInfoTaxtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpenseInfoTaxtypesIdEndpoint: The initialized ExpenseInfoTaxtypesIdEndpoint object. """ child = ExpenseInfoTaxtypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseTaxTypeInfo]: """ Performs a GET request against the /expense/info/taxTypes endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseTaxTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseTaxTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ExpenseTaxTypeInfo]: """ Performs a GET request against the /expense/info/taxTypes endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ExpenseTaxTypeInfo]: The parsed response data. """ - return self._parse_many( - ExpenseTaxTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ExpenseTaxTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesIdEndpoint.py index d72ed5398..12f68a282 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseInfoTaxtypesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseTaxTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseInfoTaxtypesIdEndpoint( @@ -16,18 +15,13 @@ class ExpenseInfoTaxtypesIdEndpoint( IGettable[ExpenseTaxTypeInfo, ConnectWiseManageRequestParams], IPaginateable[ExpenseTaxTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseTaxTypeInfo) IPaginateable.__init__(self, ExpenseTaxTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseTaxTypeInfo]: """ Performs a GET request against the /expense/info/taxTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseTaxTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseTaxTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseTaxTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseTaxTypeInfo: """ Performs a GET request against the /expense/info/taxTypes/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: ExpenseTaxTypeInfo: The parsed response data. """ - return self._parse_one( - ExpenseTaxTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ExpenseTaxTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesCountEndpoint.py index 855487e26..b4933064b 100644 --- a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpensePaymenttypesCountEndpoint( @@ -16,18 +15,13 @@ class ExpensePaymenttypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/paymentTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/paymentTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesEndpoint.py index 6b7bf5791..889563faa 100644 --- a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpensePaymenttypesCountEndpoint import ( - ExpensePaymenttypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ExpensePaymenttypesIdEndpoint import ( - ExpensePaymenttypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ExpensePaymenttypesInfoEndpoint import ( - ExpensePaymenttypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ExpensePaymenttypesCountEndpoint import ExpensePaymenttypesCountEndpoint +from pyconnectwise.endpoints.manage.ExpensePaymenttypesIdEndpoint import ExpensePaymenttypesIdEndpoint +from pyconnectwise.endpoints.manage.ExpensePaymenttypesInfoEndpoint import ExpensePaymenttypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PaymentType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpensePaymenttypesEndpoint( @@ -27,39 +19,30 @@ class ExpensePaymenttypesEndpoint( IPostable[PaymentType, ConnectWiseManageRequestParams], IPaginateable[PaymentType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "paymentTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "paymentTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PaymentType]) IPostable.__init__(self, PaymentType) IPaginateable.__init__(self, PaymentType) - self.count = self._register_child_endpoint( - ExpensePaymenttypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ExpensePaymenttypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpensePaymenttypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ExpensePaymenttypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpensePaymenttypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpensePaymenttypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpensePaymenttypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpensePaymenttypesIdEndpoint: The initialized ExpensePaymenttypesIdEndpoint object. """ child = ExpensePaymenttypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PaymentType]: """ Performs a GET request against the /expense/paymentTypes endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PaymentType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PaymentType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[PaymentType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[PaymentType]: """ Performs a GET request against the /expense/paymentTypes endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[PaymentType]: The parsed response data. """ - return self._parse_many( - PaymentType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PaymentType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaymentType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PaymentType: """ Performs a POST request against the /expense/paymentTypes endpoint. @@ -117,6 +85,4 @@ def post( Returns: PaymentType: The parsed response data. """ - return self._parse_one( - PaymentType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(PaymentType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdEndpoint.py index cce3562db..60e08e278 100644 --- a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpensePaymenttypesIdInfoEndpoint import ( - ExpensePaymenttypesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ExpensePaymenttypesIdInfoEndpoint import ExpensePaymenttypesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PaymentType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpensePaymenttypesIdEndpoint( ConnectWiseEndpoint, IGettable[PaymentType, ConnectWiseManageRequestParams], - IPuttable[PaymentType, ConnectWiseManageRequestParams], IPatchable[PaymentType, ConnectWiseManageRequestParams], + IPuttable[PaymentType, ConnectWiseManageRequestParams], IPaginateable[PaymentType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PaymentType) - IPuttable.__init__(self, PaymentType) IPatchable.__init__(self, PaymentType) + IPuttable.__init__(self, PaymentType) IPaginateable.__init__(self, PaymentType) - self.info = self._register_child_endpoint( - ExpensePaymenttypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ExpensePaymenttypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PaymentType]: """ Performs a GET request against the /expense/paymentTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PaymentType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PaymentType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaymentType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /expense/paymentTypes/{id} endpoint. + Performs a DELETE request against the /expense/paymentTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PaymentType: The parsed response data. """ - return self._parse_one( - PaymentType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PaymentType: """ - Performs a DELETE request against the /expense/paymentTypes/{id} endpoint. + Performs a GET request against the /expense/paymentTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaymentType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PaymentType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaymentType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PaymentType: """ - Performs a PUT request against the /expense/paymentTypes/{id} endpoint. + Performs a PATCH request against the /expense/paymentTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: PaymentType: The parsed response data. """ - return self._parse_one( - PaymentType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(PaymentType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaymentType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PaymentType: """ - Performs a PATCH request against the /expense/paymentTypes/{id} endpoint. + Performs a PUT request against the /expense/paymentTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +93,4 @@ def patch( Returns: PaymentType: The parsed response data. """ - return self._parse_one( - PaymentType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(PaymentType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdInfoEndpoint.py index c13ab24ac..e1e726ec6 100644 --- a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PaymentTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpensePaymenttypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ExpensePaymenttypesIdInfoEndpoint( IGettable[PaymentTypeInfo, ConnectWiseManageRequestParams], IPaginateable[PaymentTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, PaymentTypeInfo) IPaginateable.__init__(self, PaymentTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PaymentTypeInfo]: """ Performs a GET request against the /expense/paymentTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PaymentTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PaymentTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaymentTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PaymentTypeInfo: """ Performs a GET request against the /expense/paymentTypes/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: PaymentTypeInfo: The parsed response data. """ - return self._parse_one( - PaymentTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(PaymentTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesInfoEndpoint.py index 21ee46e7d..e3a618275 100644 --- a/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpensePaymenttypesInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PaymentTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpensePaymenttypesInfoEndpoint( @@ -16,18 +15,13 @@ class ExpensePaymenttypesInfoEndpoint( IGettable[list[PaymentTypeInfo], ConnectWiseManageRequestParams], IPaginateable[PaymentTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PaymentTypeInfo]) IPaginateable.__init__(self, PaymentTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PaymentTypeInfo]: """ Performs a GET request against the /expense/paymentTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PaymentTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PaymentTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PaymentTypeInfo]: """ Performs a GET request against the /expense/paymentTypes/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[PaymentTypeInfo]: The parsed response data. """ - return self._parse_many( - PaymentTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PaymentTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsCountEndpoint.py index 9ae1e2403..a3addc839 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseReportsCountEndpoint( @@ -16,18 +15,13 @@ class ExpenseReportsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/reports/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/reports/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsEndpoint.py index d488d9716..1aaafcc6a 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseReportsCountEndpoint import ( - ExpenseReportsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseReportsIdEndpoint import ( - ExpenseReportsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ExpenseReportsCountEndpoint import ExpenseReportsCountEndpoint +from pyconnectwise.endpoints.manage.ExpenseReportsIdEndpoint import ExpenseReportsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseReport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseReportsEndpoint( @@ -22,35 +17,28 @@ class ExpenseReportsEndpoint( IGettable[list[ExpenseReport], ConnectWiseManageRequestParams], IPaginateable[ExpenseReport, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reports", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reports", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseReport]) IPaginateable.__init__(self, ExpenseReport) - self.count = self._register_child_endpoint( - ExpenseReportsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpenseReportsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpenseReportsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpenseReportsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpenseReportsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpenseReportsIdEndpoint: The initialized ExpenseReportsIdEndpoint object. """ child = ExpenseReportsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseReport]: """ Performs a GET request against the /expense/reports endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseReport, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseReport, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ExpenseReport]: """ Performs a GET request against the /expense/reports endpoint. @@ -90,6 +71,4 @@ def get( Returns: list[ExpenseReport]: The parsed response data. """ - return self._parse_many( - ExpenseReport, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ExpenseReport, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdApproveEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdApproveEndpoint.py index c91994319..1f857c885 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdApproveEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdApproveEndpoint.py @@ -9,13 +9,9 @@ ) -class ExpenseReportsIdApproveEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): +class ExpenseReportsIdApproveEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "approve", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "approve", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) def post( diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsCountEndpoint.py index a87240d68..9da9f67df 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseReportsIdAuditsCountEndpoint( @@ -16,18 +15,13 @@ class ExpenseReportsIdAuditsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/reports/{id}/audits/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/reports/{id}/audits/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsEndpoint.py index 46c59493d..bc158ea9c 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseReportsIdAuditsCountEndpoint import ( - ExpenseReportsIdAuditsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseReportsIdAuditsIdEndpoint import ( - ExpenseReportsIdAuditsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ExpenseReportsIdAuditsCountEndpoint import ExpenseReportsIdAuditsCountEndpoint +from pyconnectwise.endpoints.manage.ExpenseReportsIdAuditsIdEndpoint import ExpenseReportsIdAuditsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseReportAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseReportsIdAuditsEndpoint( @@ -22,35 +17,28 @@ class ExpenseReportsIdAuditsEndpoint( IGettable[list[ExpenseReportAudit], ConnectWiseManageRequestParams], IPaginateable[ExpenseReportAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "audits", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "audits", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseReportAudit]) IPaginateable.__init__(self, ExpenseReportAudit) - self.count = self._register_child_endpoint( - ExpenseReportsIdAuditsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpenseReportsIdAuditsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpenseReportsIdAuditsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpenseReportsIdAuditsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpenseReportsIdAuditsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpenseReportsIdAuditsIdEndpoint: The initialized ExpenseReportsIdAuditsIdEndpoint object. """ child = ExpenseReportsIdAuditsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseReportAudit]: """ Performs a GET request against the /expense/reports/{id}/audits endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseReportAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseReportAudit, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ExpenseReportAudit]: """ Performs a GET request against the /expense/reports/{id}/audits endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ExpenseReportAudit]: The parsed response data. """ - return self._parse_many( - ExpenseReportAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ExpenseReportAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsIdEndpoint.py index 9c8bbe2bc..8f0f9b2d5 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdAuditsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseReportAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseReportsIdAuditsIdEndpoint( @@ -16,18 +15,13 @@ class ExpenseReportsIdAuditsIdEndpoint( IGettable[ExpenseReportAudit, ConnectWiseManageRequestParams], IPaginateable[ExpenseReportAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseReportAudit) IPaginateable.__init__(self, ExpenseReportAudit) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseReportAudit]: """ Performs a GET request against the /expense/reports/{id}/audits/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseReportAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseReportAudit, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseReportAudit: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseReportAudit: """ Performs a GET request against the /expense/reports/{id}/audits/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: ExpenseReportAudit: The parsed response data. """ - return self._parse_one( - ExpenseReportAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ExpenseReportAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdEndpoint.py index b98e38acb..b31224b18 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdEndpoint.py @@ -1,29 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseReportsIdApproveEndpoint import ( - ExpenseReportsIdApproveEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseReportsIdAuditsEndpoint import ( - ExpenseReportsIdAuditsEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseReportsIdRejectEndpoint import ( - ExpenseReportsIdRejectEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseReportsIdReverseEndpoint import ( - ExpenseReportsIdReverseEndpoint, -) -from pyconnectwise.endpoints.manage.ExpenseReportsIdSubmitEndpoint import ( - ExpenseReportsIdSubmitEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ExpenseReportsIdAuditsEndpoint import ExpenseReportsIdAuditsEndpoint +from pyconnectwise.endpoints.manage.ExpenseReportsIdReverseEndpoint import ExpenseReportsIdReverseEndpoint +from pyconnectwise.endpoints.manage.ExpenseReportsIdSubmitEndpoint import ExpenseReportsIdSubmitEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseReport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseReportsIdEndpoint( @@ -31,34 +18,17 @@ class ExpenseReportsIdEndpoint( IGettable[ExpenseReport, ConnectWiseManageRequestParams], IPaginateable[ExpenseReport, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseReport) IPaginateable.__init__(self, ExpenseReport) - self.submit = self._register_child_endpoint( - ExpenseReportsIdSubmitEndpoint(client, parent_endpoint=self) - ) - self.audits = self._register_child_endpoint( - ExpenseReportsIdAuditsEndpoint(client, parent_endpoint=self) - ) - self.reject = self._register_child_endpoint( - ExpenseReportsIdRejectEndpoint(client, parent_endpoint=self) - ) - self.approve = self._register_child_endpoint( - ExpenseReportsIdApproveEndpoint(client, parent_endpoint=self) - ) - self.reverse = self._register_child_endpoint( - ExpenseReportsIdReverseEndpoint(client, parent_endpoint=self) - ) + self.audits = self._register_child_endpoint(ExpenseReportsIdAuditsEndpoint(client, parent_endpoint=self)) + self.reverse = self._register_child_endpoint(ExpenseReportsIdReverseEndpoint(client, parent_endpoint=self)) + self.submit = self._register_child_endpoint(ExpenseReportsIdSubmitEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseReport]: """ Performs a GET request against the /expense/reports/{id} endpoint and returns an initialized PaginatedResponse object. @@ -76,19 +46,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseReport, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseReport, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseReport: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseReport: """ Performs a GET request against the /expense/reports/{id} endpoint. @@ -98,6 +59,4 @@ def get( Returns: ExpenseReport: The parsed response data. """ - return self._parse_one( - ExpenseReport, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ExpenseReport, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdRejectEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdRejectEndpoint.py index 8e1b558b2..16198acbe 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdRejectEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdRejectEndpoint.py @@ -9,13 +9,9 @@ ) -class ExpenseReportsIdRejectEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): +class ExpenseReportsIdRejectEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reject", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "reject", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) def post( diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdReverseEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdReverseEndpoint.py index b3edf16d4..3645fb4f7 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdReverseEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdReverseEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ExpenseReportsIdReverseEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reverse", parent_endpoint=parent_endpoint - ) +class ExpenseReportsIdReverseEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reverse", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /expense/reports/{id}/reverse endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdSubmitEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdSubmitEndpoint.py index 9e39f7567..d20fe451a 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseReportsIdSubmitEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseReportsIdSubmitEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ExpenseReportsIdSubmitEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "submit", parent_endpoint=parent_endpoint - ) +class ExpenseReportsIdSubmitEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "submit", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /expense/reports/{id}/submit endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseTypesCountEndpoint.py index a9c766ba8..15cf4af7d 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseTypesCountEndpoint( @@ -16,18 +15,13 @@ class ExpenseTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /expense/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /expense/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseTypesEndpoint.py index b4d2f29c4..314b604a4 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseTypesEndpoint.py @@ -1,22 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseTypesCountEndpoint import ( - ExpenseTypesCountEndpoint, -) +from pyconnectwise.endpoints.manage.ExpenseTypesCountEndpoint import ExpenseTypesCountEndpoint from pyconnectwise.endpoints.manage.ExpenseTypesIdEndpoint import ExpenseTypesIdEndpoint -from pyconnectwise.endpoints.manage.ExpenseTypesInfoEndpoint import ( - ExpenseTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ExpenseTypesInfoEndpoint import ExpenseTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ExpenseType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseTypesEndpoint( @@ -25,39 +19,30 @@ class ExpenseTypesEndpoint( IPostable[ExpenseType, ConnectWiseManageRequestParams], IPaginateable[ExpenseType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseType]) IPostable.__init__(self, ExpenseType) IPaginateable.__init__(self, ExpenseType) - self.count = self._register_child_endpoint( - ExpenseTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ExpenseTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ExpenseTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ExpenseTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ExpenseTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ExpenseTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ExpenseTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ExpenseTypesIdEndpoint: The initialized ExpenseTypesIdEndpoint object. """ child = ExpenseTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseType]: """ Performs a GET request against the /expense/types endpoint and returns an initialized PaginatedResponse object. @@ -75,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ExpenseType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ExpenseType]: """ Performs a GET request against the /expense/types endpoint. @@ -97,15 +73,9 @@ def get( Returns: list[ExpenseType]: The parsed response data. """ - return self._parse_many( - ExpenseType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ExpenseType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseType: """ Performs a POST request against the /expense/types endpoint. @@ -115,6 +85,4 @@ def post( Returns: ExpenseType: The parsed response data. """ - return self._parse_one( - ExpenseType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ExpenseType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseTypesIdEndpoint.py index fb7ca2d3e..785929df9 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseTypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ExpenseTypesIdInfoEndpoint import ( - ExpenseTypesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ExpenseTypesIdInfoEndpoint import ExpenseTypesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ExpenseType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseTypesIdEndpoint( ConnectWiseEndpoint, IGettable[ExpenseType, ConnectWiseManageRequestParams], - IPuttable[ExpenseType, ConnectWiseManageRequestParams], IPatchable[ExpenseType, ConnectWiseManageRequestParams], + IPuttable[ExpenseType, ConnectWiseManageRequestParams], IPaginateable[ExpenseType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseType) - IPuttable.__init__(self, ExpenseType) IPatchable.__init__(self, ExpenseType) + IPuttable.__init__(self, ExpenseType) IPaginateable.__init__(self, ExpenseType) - self.info = self._register_child_endpoint( - ExpenseTypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ExpenseTypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseType]: """ Performs a GET request against the /expense/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /expense/types/{id} endpoint. + Performs a DELETE request against the /expense/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ExpenseType: The parsed response data. """ - return self._parse_one( - ExpenseType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseType: """ - Performs a DELETE request against the /expense/types/{id} endpoint. + Performs a GET request against the /expense/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ExpenseType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ExpenseType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ExpenseType: """ - Performs a PUT request against the /expense/types/{id} endpoint. + Performs a PATCH request against the /expense/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: ExpenseType: The parsed response data. """ - return self._parse_one( - ExpenseType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ExpenseType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseType: """ - Performs a PATCH request against the /expense/types/{id} endpoint. + Performs a PUT request against the /expense/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +93,4 @@ def patch( Returns: ExpenseType: The parsed response data. """ - return self._parse_one( - ExpenseType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ExpenseType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseTypesIdInfoEndpoint.py index 540454cdd..12945ad51 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ExpenseTypesIdInfoEndpoint( IGettable[ExpenseTypeInfo, ConnectWiseManageRequestParams], IPaginateable[ExpenseTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseTypeInfo) IPaginateable.__init__(self, ExpenseTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseTypeInfo]: """ Performs a GET request against the /expense/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ExpenseTypeInfo: """ Performs a GET request against the /expense/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ExpenseTypeInfo: The parsed response data. """ - return self._parse_one( - ExpenseTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ExpenseTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ExpenseTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ExpenseTypesInfoEndpoint.py index 57afb174c..b7b7d85fd 100644 --- a/src/pyconnectwise/endpoints/manage/ExpenseTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ExpenseTypesInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ExpenseTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ExpenseTypesInfoEndpoint( @@ -16,18 +15,13 @@ class ExpenseTypesInfoEndpoint( IGettable[list[ExpenseTypeInfo], ConnectWiseManageRequestParams], IPaginateable[ExpenseTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseTypeInfo]) IPaginateable.__init__(self, ExpenseTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseTypeInfo]: """ Performs a GET request against the /expense/types/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ExpenseTypeInfo]: """ Performs a GET request against the /expense/types/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[ExpenseTypeInfo]: The parsed response data. """ - return self._parse_many( - ExpenseTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ExpenseTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesCountEndpoint.py index d8739c28b..675fa6bab 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingBatchesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingBatchesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/batches/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/batches/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesEndpoint.py index 4d50b433e..a8eb8e8d4 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAccountingBatchesCountEndpoint import ( - FinanceAccountingBatchesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAccountingBatchesIdEndpoint import ( - FinanceAccountingBatchesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceAccountingBatchesCountEndpoint import FinanceAccountingBatchesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceAccountingBatchesIdEndpoint import FinanceAccountingBatchesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AccountingBatch, GLExport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingBatchesEndpoint( @@ -24,36 +18,29 @@ class FinanceAccountingBatchesEndpoint( IPostable[GLExport, ConnectWiseManageRequestParams], IPaginateable[AccountingBatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "batches", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "batches", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AccountingBatch]) IPostable.__init__(self, GLExport) IPaginateable.__init__(self, AccountingBatch) - self.count = self._register_child_endpoint( - FinanceAccountingBatchesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceAccountingBatchesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceAccountingBatchesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAccountingBatchesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingBatchesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingBatchesIdEndpoint: The initialized FinanceAccountingBatchesIdEndpoint object. """ child = FinanceAccountingBatchesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AccountingBatch]: """ Performs a GET request against the /finance/accounting/batches endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AccountingBatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AccountingBatch, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AccountingBatch]: """ Performs a GET request against the /finance/accounting/batches endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[AccountingBatch]: The parsed response data. """ - return self._parse_many( - AccountingBatch, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AccountingBatch, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLExport: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLExport: """ Performs a POST request against the /finance/accounting/batches endpoint. @@ -112,6 +85,4 @@ def post( Returns: GLExport: The parsed response data. """ - return self._parse_one( - GLExport, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(GLExport, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEndpoint.py index 07f49735b..77038e1ba 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingBatchesIdEntriesEndpoint import ( FinanceAccountingBatchesIdEntriesEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingBatchesIdExportEndpoint import ( FinanceAccountingBatchesIdExportEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AccountingBatch from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingBatchesIdEndpoint( @@ -22,25 +21,20 @@ class FinanceAccountingBatchesIdEndpoint( IGettable[AccountingBatch, ConnectWiseManageRequestParams], IPaginateable[AccountingBatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AccountingBatch) IPaginateable.__init__(self, AccountingBatch) - self.export = self._register_child_endpoint( - FinanceAccountingBatchesIdExportEndpoint(client, parent_endpoint=self) - ) self.entries = self._register_child_endpoint( FinanceAccountingBatchesIdEntriesEndpoint(client, parent_endpoint=self) ) + self.export = self._register_child_endpoint( + FinanceAccountingBatchesIdExportEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AccountingBatch]: """ Performs a GET request against the /finance/accounting/batches/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,43 +52,27 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AccountingBatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AccountingBatch, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AccountingBatch: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/accounting/batches/{id} endpoint. + Performs a DELETE request against the /finance/accounting/batches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AccountingBatch: The parsed response data. """ - return self._parse_one( - AccountingBatch, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AccountingBatch: """ - Performs a DELETE request against the /finance/accounting/batches/{id} endpoint. + Performs a GET request against the /finance/accounting/batches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AccountingBatch: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AccountingBatch, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesCountEndpoint.py index 51c9d9a7e..cd1201626 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingBatchesIdEntriesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingBatchesIdEntriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/batches/{id}/entries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/batches/{id}/entries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesEndpoint.py index 34235f66e..0b1a4cc7a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingBatchesIdEntriesCountEndpoint import ( FinanceAccountingBatchesIdEntriesCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingBatchesIdEntriesIdEndpoint import ( FinanceAccountingBatchesIdEntriesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BatchEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingBatchesIdEntriesEndpoint( @@ -22,10 +21,8 @@ class FinanceAccountingBatchesIdEntriesEndpoint( IGettable[list[BatchEntry], ConnectWiseManageRequestParams], IPaginateable[BatchEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "entries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "entries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BatchEntry]) IPaginateable.__init__(self, BatchEntry) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAccountingBatchesIdEntriesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAccountingBatchesIdEntriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAccountingBatchesIdEntriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingBatchesIdEntriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingBatchesIdEntriesIdEndpoint: The initialized FinanceAccountingBatchesIdEntriesIdEndpoint object. """ - child = FinanceAccountingBatchesIdEntriesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingBatchesIdEntriesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BatchEntry]: """ Performs a GET request against the /finance/accounting/batches/{id}/entries endpoint and returns an initialized PaginatedResponse object. @@ -69,20 +61,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BatchEntry, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BatchEntry, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BatchEntry]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BatchEntry]: """ Performs a GET request against the /finance/accounting/batches/{id}/entries endpoint. @@ -92,6 +73,4 @@ def get( Returns: list[BatchEntry]: The parsed response data. """ - return self._parse_many( - BatchEntry, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BatchEntry, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesIdEndpoint.py index 3bb91eb01..23974979e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdEntriesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BatchEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingBatchesIdEntriesIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingBatchesIdEntriesIdEndpoint( IGettable[BatchEntry, ConnectWiseManageRequestParams], IPaginateable[BatchEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BatchEntry) IPaginateable.__init__(self, BatchEntry) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BatchEntry]: """ Performs a GET request against the /finance/accounting/batches/{id}/entries/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BatchEntry, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BatchEntry, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BatchEntry: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BatchEntry: """ Performs a GET request against the /finance/accounting/batches/{id}/entries/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: BatchEntry: The parsed response data. """ - return self._parse_one( - BatchEntry, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(BatchEntry, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdExportEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdExportEndpoint.py index 549b28601..d0fe04ed3 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdExportEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingBatchesIdExportEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import GLExport -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingBatchesIdExportEndpoint( ConnectWiseEndpoint, IPostable[GLExport, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "export", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "export", parent_endpoint=parent_endpoint) IPostable.__init__(self, GLExport) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLExport: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLExport: """ Performs a POST request against the /finance/accounting/batches/{id}/export endpoint. @@ -32,6 +26,4 @@ def post( Returns: GLExport: The parsed response data. """ - return self._parse_one( - GLExport, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(GLExport, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingEndpoint.py index a95384610..a8a0040a1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingEndpoint.py @@ -1,10 +1,8 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAccountingBatchesEndpoint import ( - FinanceAccountingBatchesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAccountingExportEndpoint import ( - FinanceAccountingExportEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceAccountingBatchesEndpoint import FinanceAccountingBatchesEndpoint +from pyconnectwise.endpoints.manage.FinanceAccountingExportEndpoint import FinanceAccountingExportEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedexpensesEndpoint import ( FinanceAccountingUnpostedexpensesEndpoint, ) @@ -15,25 +13,22 @@ FinanceAccountingUnpostedprocurementEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class FinanceAccountingEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "accounting", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "accounting", parent_endpoint=parent_endpoint) + self.batches = self._register_child_endpoint(FinanceAccountingBatchesEndpoint(client, parent_endpoint=self)) + self.export = self._register_child_endpoint(FinanceAccountingExportEndpoint(client, parent_endpoint=self)) + self.unpostedexpenses = self._register_child_endpoint( + FinanceAccountingUnpostedexpensesEndpoint(client, parent_endpoint=self) + ) self.unpostedinvoices = self._register_child_endpoint( FinanceAccountingUnpostedinvoicesEndpoint(client, parent_endpoint=self) ) self.unpostedprocurement = self._register_child_endpoint( FinanceAccountingUnpostedprocurementEndpoint(client, parent_endpoint=self) ) - self.unpostedexpenses = self._register_child_endpoint( - FinanceAccountingUnpostedexpensesEndpoint(client, parent_endpoint=self) - ) - self.batches = self._register_child_endpoint( - FinanceAccountingBatchesEndpoint(client, parent_endpoint=self) - ) - self.export = self._register_child_endpoint( - FinanceAccountingExportEndpoint(client, parent_endpoint=self) - ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingExportEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingExportEndpoint.py index 511249f8a..645eeb977 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingExportEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingExportEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import GLExport -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class FinanceAccountingExportEndpoint( - ConnectWiseEndpoint, IPostable[GLExport, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "export", parent_endpoint=parent_endpoint - ) +class FinanceAccountingExportEndpoint(ConnectWiseEndpoint, IPostable[GLExport, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "export", parent_endpoint=parent_endpoint) IPostable.__init__(self, GLExport) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLExport: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLExport: """ Performs a POST request against the /finance/accounting/export endpoint. @@ -32,6 +24,4 @@ def post( Returns: GLExport: The parsed response data. """ - return self._parse_one( - GLExport, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(GLExport, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesCountEndpoint.py index f74d8b56a..8748b53ec 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedexpensesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedexpensesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/unpostedexpenses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/unpostedexpenses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesEndpoint.py index cedf9ff34..ee21a6e80 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedexpensesCountEndpoint import ( FinanceAccountingUnpostedexpensesCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedexpensesIdEndpoint import ( FinanceAccountingUnpostedexpensesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedExpense from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedexpensesEndpoint( @@ -22,10 +21,8 @@ class FinanceAccountingUnpostedexpensesEndpoint( IGettable[list[UnpostedExpense], ConnectWiseManageRequestParams], IPaginateable[UnpostedExpense, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "unpostedexpenses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "unpostedexpenses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UnpostedExpense]) IPaginateable.__init__(self, UnpostedExpense) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAccountingUnpostedexpensesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAccountingUnpostedexpensesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAccountingUnpostedexpensesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingUnpostedexpensesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingUnpostedexpensesIdEndpoint: The initialized FinanceAccountingUnpostedexpensesIdEndpoint object. """ - child = FinanceAccountingUnpostedexpensesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingUnpostedexpensesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedExpense]: """ Performs a GET request against the /finance/accounting/unpostedexpenses endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedExpense, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedExpense, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UnpostedExpense]: """ Performs a GET request against the /finance/accounting/unpostedexpenses endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[UnpostedExpense]: The parsed response data. """ - return self._parse_many( - UnpostedExpense, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(UnpostedExpense, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdEndpoint.py index 5f94ffcf4..2f633458f 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint import ( FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedExpense from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedexpensesIdEndpoint( @@ -19,24 +18,17 @@ class FinanceAccountingUnpostedexpensesIdEndpoint( IGettable[UnpostedExpense, ConnectWiseManageRequestParams], IPaginateable[UnpostedExpense, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UnpostedExpense) IPaginateable.__init__(self, UnpostedExpense) self.taxable_levels = self._register_child_endpoint( - FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint( - client, parent_endpoint=self - ) + FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedExpense]: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -54,19 +46,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedExpense, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedExpense, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UnpostedExpense: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UnpostedExpense: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id} endpoint. @@ -76,7 +59,4 @@ def get( Returns: UnpostedExpense: The parsed response data. """ - return self._parse_one( - UnpostedExpense, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(UnpostedExpense, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint.py index 1ccef13e0..8bfc6f459 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id}/taxableLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id}/taxableLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint.py index 67684ddbd..c1a920590 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint import ( FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint import ( FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedExpenseTaxableLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint( @@ -22,41 +21,30 @@ class FinanceAccountingUnpostedexpensesIdTaxablelevelsEndpoint( IGettable[list[UnpostedExpenseTaxableLevel], ConnectWiseManageRequestParams], IPaginateable[UnpostedExpenseTaxableLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxableLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxableLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UnpostedExpenseTaxableLevel]) IPaginateable.__init__(self, UnpostedExpenseTaxableLevel) self.count = self._register_child_endpoint( - FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAccountingUnpostedexpensesIdTaxablelevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint: + def id(self, _id: int) -> FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint: The initialized FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint object. """ - child = FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedExpenseTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id}/taxableLevels endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedExpenseTaxableLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedExpenseTaxableLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UnpostedExpenseTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id}/taxableLevels endpoint. @@ -97,6 +78,5 @@ def get( list[UnpostedExpenseTaxableLevel]: The parsed response data. """ return self._parse_many( - UnpostedExpenseTaxableLevel, - super()._make_request("GET", data=data, params=params).json(), + UnpostedExpenseTaxableLevel, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint.py index 07973a2cd..d6294c8eb 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedExpenseTaxableLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedexpensesIdTaxablelevelsIdEndpoint( IGettable[UnpostedExpenseTaxableLevel, ConnectWiseManageRequestParams], IPaginateable[UnpostedExpenseTaxableLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UnpostedExpenseTaxableLevel) IPaginateable.__init__(self, UnpostedExpenseTaxableLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedExpenseTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id}/taxableLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedExpenseTaxableLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedExpenseTaxableLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> UnpostedExpenseTaxableLevel: """ Performs a GET request against the /finance/accounting/unpostedexpenses/{id}/taxableLevels/{id} endpoint. @@ -68,6 +55,5 @@ def get( UnpostedExpenseTaxableLevel: The parsed response data. """ return self._parse_one( - UnpostedExpenseTaxableLevel, - super()._make_request("GET", data=data, params=params).json(), + UnpostedExpenseTaxableLevel, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesCountEndpoint.py index 11479645c..df0a97fb5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedinvoicesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedinvoicesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/unpostedinvoices/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/unpostedinvoices/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesEndpoint.py index d924fa8f2..019789442 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedinvoicesCountEndpoint import ( FinanceAccountingUnpostedinvoicesCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedinvoicesIdEndpoint import ( FinanceAccountingUnpostedinvoicesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedInvoice from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedinvoicesEndpoint( @@ -22,10 +21,8 @@ class FinanceAccountingUnpostedinvoicesEndpoint( IGettable[list[UnpostedInvoice], ConnectWiseManageRequestParams], IPaginateable[UnpostedInvoice, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "unpostedinvoices", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "unpostedinvoices", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UnpostedInvoice]) IPaginateable.__init__(self, UnpostedInvoice) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAccountingUnpostedinvoicesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAccountingUnpostedinvoicesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAccountingUnpostedinvoicesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingUnpostedinvoicesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingUnpostedinvoicesIdEndpoint: The initialized FinanceAccountingUnpostedinvoicesIdEndpoint object. """ - child = FinanceAccountingUnpostedinvoicesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingUnpostedinvoicesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedInvoice]: """ Performs a GET request against the /finance/accounting/unpostedinvoices endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedInvoice, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedInvoice, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UnpostedInvoice]: """ Performs a GET request against the /finance/accounting/unpostedinvoices endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[UnpostedInvoice]: The parsed response data. """ - return self._parse_many( - UnpostedInvoice, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(UnpostedInvoice, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdEndpoint.py index 5cce02227..4d50afa23 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint import ( FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedInvoice from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedinvoicesIdEndpoint( @@ -19,24 +18,17 @@ class FinanceAccountingUnpostedinvoicesIdEndpoint( IGettable[UnpostedInvoice, ConnectWiseManageRequestParams], IPaginateable[UnpostedInvoice, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UnpostedInvoice) IPaginateable.__init__(self, UnpostedInvoice) self.taxable_levels = self._register_child_endpoint( - FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint( - client, parent_endpoint=self - ) + FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedInvoice]: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id} endpoint and returns an initialized PaginatedResponse object. @@ -54,19 +46,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedInvoice, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedInvoice, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UnpostedInvoice: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UnpostedInvoice: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id} endpoint. @@ -76,7 +59,4 @@ def get( Returns: UnpostedInvoice: The parsed response data. """ - return self._parse_one( - UnpostedInvoice, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(UnpostedInvoice, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint.py index a8208af19..915c92e61 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id}/taxableLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id}/taxableLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint.py index 40be01aa0..e1f9bd5e9 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint import ( FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint import ( FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedInvoiceTaxableLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint( @@ -22,41 +21,30 @@ class FinanceAccountingUnpostedinvoicesIdTaxablelevelsEndpoint( IGettable[list[UnpostedInvoiceTaxableLevel], ConnectWiseManageRequestParams], IPaginateable[UnpostedInvoiceTaxableLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxableLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxableLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UnpostedInvoiceTaxableLevel]) IPaginateable.__init__(self, UnpostedInvoiceTaxableLevel) self.count = self._register_child_endpoint( - FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAccountingUnpostedinvoicesIdTaxablelevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint: + def id(self, _id: int) -> FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint: The initialized FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint object. """ - child = FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedInvoiceTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id}/taxableLevels endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedInvoiceTaxableLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedInvoiceTaxableLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UnpostedInvoiceTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id}/taxableLevels endpoint. @@ -97,6 +78,5 @@ def get( list[UnpostedInvoiceTaxableLevel]: The parsed response data. """ return self._parse_many( - UnpostedInvoiceTaxableLevel, - super()._make_request("GET", data=data, params=params).json(), + UnpostedInvoiceTaxableLevel, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint.py index 96bf283e4..020ba09d9 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedInvoiceTaxableLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedinvoicesIdTaxablelevelsIdEndpoint( IGettable[UnpostedInvoiceTaxableLevel, ConnectWiseManageRequestParams], IPaginateable[UnpostedInvoiceTaxableLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UnpostedInvoiceTaxableLevel) IPaginateable.__init__(self, UnpostedInvoiceTaxableLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedInvoiceTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id}/taxableLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedInvoiceTaxableLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedInvoiceTaxableLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> UnpostedInvoiceTaxableLevel: """ Performs a GET request against the /finance/accounting/unpostedinvoices/{id}/taxableLevels/{id} endpoint. @@ -68,6 +55,5 @@ def get( UnpostedInvoiceTaxableLevel: The parsed response data. """ return self._parse_one( - UnpostedInvoiceTaxableLevel, - super()._make_request("GET", data=data, params=params).json(), + UnpostedInvoiceTaxableLevel, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementCountEndpoint.py index 85ef0fc07..428296728 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedprocurementCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedprocurementCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/unpostedprocurement/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/unpostedprocurement/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementEndpoint.py index ea85e52f6..542f98bb7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedprocurementCountEndpoint import ( FinanceAccountingUnpostedprocurementCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedprocurementIdEndpoint import ( FinanceAccountingUnpostedprocurementIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedProcurement from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedprocurementEndpoint( @@ -22,41 +21,30 @@ class FinanceAccountingUnpostedprocurementEndpoint( IGettable[list[UnpostedProcurement], ConnectWiseManageRequestParams], IPaginateable[UnpostedProcurement, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "unpostedprocurement", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "unpostedprocurement", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UnpostedProcurement]) IPaginateable.__init__(self, UnpostedProcurement) self.count = self._register_child_endpoint( - FinanceAccountingUnpostedprocurementCountEndpoint( - client, parent_endpoint=self - ) + FinanceAccountingUnpostedprocurementCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAccountingUnpostedprocurementIdEndpoint: + def id(self, _id: int) -> FinanceAccountingUnpostedprocurementIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingUnpostedprocurementIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingUnpostedprocurementIdEndpoint: The initialized FinanceAccountingUnpostedprocurementIdEndpoint object. """ - child = FinanceAccountingUnpostedprocurementIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingUnpostedprocurementIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedProcurement]: """ Performs a GET request against the /finance/accounting/unpostedprocurement endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedProcurement, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedProcurement, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UnpostedProcurement]: """ Performs a GET request against the /finance/accounting/unpostedprocurement endpoint. @@ -96,7 +77,4 @@ def get( Returns: list[UnpostedProcurement]: The parsed response data. """ - return self._parse_many( - UnpostedProcurement, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(UnpostedProcurement, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdEndpoint.py index ce3a59b50..938cace6a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint import ( FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedProcurement from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedprocurementIdEndpoint( @@ -19,24 +18,17 @@ class FinanceAccountingUnpostedprocurementIdEndpoint( IGettable[UnpostedProcurement, ConnectWiseManageRequestParams], IPaginateable[UnpostedProcurement, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UnpostedProcurement) IPaginateable.__init__(self, UnpostedProcurement) self.taxable_levels = self._register_child_endpoint( - FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint( - client, parent_endpoint=self - ) + FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedProcurement]: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id} endpoint and returns an initialized PaginatedResponse object. @@ -54,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedProcurement, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedProcurement, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> UnpostedProcurement: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id} endpoint. @@ -76,7 +61,4 @@ def get( Returns: UnpostedProcurement: The parsed response data. """ - return self._parse_one( - UnpostedProcurement, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(UnpostedProcurement, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint.py index b2a088a8e..6ce182db3 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id}/taxableLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id}/taxableLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint.py index f14857826..e140ceb17 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint import ( FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint import ( FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedProcurementTaxableLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint( @@ -22,41 +21,30 @@ class FinanceAccountingUnpostedprocurementIdTaxablelevelsEndpoint( IGettable[list[UnpostedProcurementTaxableLevel], ConnectWiseManageRequestParams], IPaginateable[UnpostedProcurementTaxableLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxableLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxableLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UnpostedProcurementTaxableLevel]) IPaginateable.__init__(self, UnpostedProcurementTaxableLevel) self.count = self._register_child_endpoint( - FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAccountingUnpostedprocurementIdTaxablelevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint: + def id(self, _id: int) -> FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint: The initialized FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint object. """ - child = FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedProcurementTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id}/taxableLevels endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedProcurementTaxableLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedProcurementTaxableLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UnpostedProcurementTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id}/taxableLevels endpoint. @@ -97,6 +78,5 @@ def get( list[UnpostedProcurementTaxableLevel]: The parsed response data. """ return self._parse_many( - UnpostedProcurementTaxableLevel, - super()._make_request("GET", data=data, params=params).json(), + UnpostedProcurementTaxableLevel, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint.py index 297046cf1..6ab5f3e09 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UnpostedProcurementTaxableLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingUnpostedprocurementIdTaxablelevelsIdEndpoint( IGettable[UnpostedProcurementTaxableLevel, ConnectWiseManageRequestParams], IPaginateable[UnpostedProcurementTaxableLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UnpostedProcurementTaxableLevel) IPaginateable.__init__(self, UnpostedProcurementTaxableLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnpostedProcurementTaxableLevel]: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id}/taxableLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnpostedProcurementTaxableLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnpostedProcurementTaxableLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> UnpostedProcurementTaxableLevel: """ Performs a GET request against the /finance/accounting/unpostedprocurement/{id}/taxableLevels/{id} endpoint. @@ -68,6 +55,5 @@ def get( UnpostedProcurementTaxableLevel: The parsed response data. """ return self._parse_one( - UnpostedProcurementTaxableLevel, - super()._make_request("GET", data=data, params=params).json(), + UnpostedProcurementTaxableLevel, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesCountEndpoint.py index ef41a3fb8..0ad80bb90 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingpackagesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingpackagesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accountingPackages/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accountingPackages/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesEndpoint.py index 43cc02910..c7e146db2 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAccountingpackagesCountEndpoint import ( - FinanceAccountingpackagesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAccountingpackagesIdEndpoint import ( - FinanceAccountingpackagesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceAccountingpackagesCountEndpoint import FinanceAccountingpackagesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceAccountingpackagesIdEndpoint import FinanceAccountingpackagesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AccountingPackage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingpackagesEndpoint( @@ -22,35 +17,28 @@ class FinanceAccountingpackagesEndpoint( IGettable[list[AccountingPackage], ConnectWiseManageRequestParams], IPaginateable[AccountingPackage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "accountingPackages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "accountingPackages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AccountingPackage]) IPaginateable.__init__(self, AccountingPackage) - self.count = self._register_child_endpoint( - FinanceAccountingpackagesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceAccountingpackagesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceAccountingpackagesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAccountingpackagesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingpackagesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingpackagesIdEndpoint: The initialized FinanceAccountingpackagesIdEndpoint object. """ child = FinanceAccountingpackagesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AccountingPackage]: """ Performs a GET request against the /finance/accountingPackages endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AccountingPackage, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AccountingPackage, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AccountingPackage]: """ Performs a GET request against the /finance/accountingPackages endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[AccountingPackage]: The parsed response data. """ - return self._parse_many( - AccountingPackage, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AccountingPackage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesIdEndpoint.py index 6da0f47a5..71e20518e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AccountingPackage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingpackagesIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingpackagesIdEndpoint( IGettable[AccountingPackage, ConnectWiseManageRequestParams], IPaginateable[AccountingPackage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AccountingPackage) IPaginateable.__init__(self, AccountingPackage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AccountingPackage]: """ Performs a GET request against the /finance/accountingPackages/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AccountingPackage, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AccountingPackage, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AccountingPackage: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AccountingPackage: """ Performs a GET request against the /finance/accountingPackages/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: AccountingPackage: The parsed response data. """ - return self._parse_one( - AccountingPackage, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(AccountingPackage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupCountEndpoint.py index 9edabc180..b625f69fa 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingpackagesetupCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAccountingpackagesetupCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/accountingPackageSetup/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/accountingPackageSetup/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupEndpoint.py index c1adcc62c..b7f4536bd 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAccountingpackagesetupCountEndpoint import ( FinanceAccountingpackagesetupCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAccountingpackagesetupIdEndpoint import ( FinanceAccountingpackagesetupIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AccountingPackageSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingpackagesetupEndpoint( @@ -22,10 +21,8 @@ class FinanceAccountingpackagesetupEndpoint( IGettable[list[AccountingPackageSetup], ConnectWiseManageRequestParams], IPaginateable[AccountingPackageSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "accountingPackageSetup", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "accountingPackageSetup", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AccountingPackageSetup]) IPaginateable.__init__(self, AccountingPackageSetup) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAccountingpackagesetupCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAccountingpackagesetupIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAccountingpackagesetupIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAccountingpackagesetupIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAccountingpackagesetupIdEndpoint: The initialized FinanceAccountingpackagesetupIdEndpoint object. """ - child = FinanceAccountingpackagesetupIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAccountingpackagesetupIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AccountingPackageSetup]: """ Performs a GET request against the /finance/accountingPackageSetup endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AccountingPackageSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AccountingPackageSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AccountingPackageSetup]: """ Performs a GET request against the /finance/accountingPackageSetup endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[AccountingPackageSetup]: The parsed response data. """ - return self._parse_many( - AccountingPackageSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AccountingPackageSetup, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupIdEndpoint.py index 05ab917fa..87cceb0fb 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAccountingpackagesetupIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AccountingPackageSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAccountingpackagesetupIdEndpoint( ConnectWiseEndpoint, IGettable[AccountingPackageSetup, ConnectWiseManageRequestParams], - IPuttable[AccountingPackageSetup, ConnectWiseManageRequestParams], IPatchable[AccountingPackageSetup, ConnectWiseManageRequestParams], + IPuttable[AccountingPackageSetup, ConnectWiseManageRequestParams], IPaginateable[AccountingPackageSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AccountingPackageSetup) - IPuttable.__init__(self, AccountingPackageSetup) IPatchable.__init__(self, AccountingPackageSetup) + IPuttable.__init__(self, AccountingPackageSetup) IPaginateable.__init__(self, AccountingPackageSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AccountingPackageSetup]: """ Performs a GET request against the /finance/accountingPackageSetup/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AccountingPackageSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AccountingPackageSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AccountingPackageSetup: """ Performs a GET request against the /finance/accountingPackageSetup/{id} endpoint. @@ -74,18 +58,13 @@ def get( Returns: AccountingPackageSetup: The parsed response data. """ - return self._parse_one( - AccountingPackageSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(AccountingPackageSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> AccountingPackageSetup: """ - Performs a PUT request against the /finance/accountingPackageSetup/{id} endpoint. + Performs a PATCH request against the /finance/accountingPackageSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +72,13 @@ def put( Returns: AccountingPackageSetup: The parsed response data. """ - return self._parse_one( - AccountingPackageSetup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AccountingPackageSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AccountingPackageSetup: """ - Performs a PATCH request against the /finance/accountingPackageSetup/{id} endpoint. + Performs a PUT request against the /finance/accountingPackageSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +86,4 @@ def patch( Returns: AccountingPackageSetup: The parsed response data. """ - return self._parse_one( - AccountingPackageSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AccountingPackageSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapEndpoint.py index 419d02b01..a866b1c02 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapEndpoint.py @@ -6,9 +6,7 @@ class FinanceAgreementrecapEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "agreementrecap", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "agreementrecap", parent_endpoint=parent_endpoint) def id(self, id: int) -> FinanceAgreementrecapIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapIdEndpoint.py index d99d618b4..b5ec9a7a0 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementrecapIdEndpoint.py @@ -17,9 +17,7 @@ class FinanceAgreementrecapIdEndpoint( IPaginateable[AgreementRecap, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementRecap) IPaginateable.__init__(self, AgreementRecap) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsCountEndpoint.py index 3c3d821b6..c62b8e700 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsEndpoint.py index a713196e5..3b91736c3 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAgreementsCountEndpoint import ( - FinanceAgreementsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdEndpoint import ( - FinanceAgreementsIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsTypesEndpoint import ( - FinanceAgreementsTypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsCountEndpoint import FinanceAgreementsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsIdEndpoint import FinanceAgreementsIdEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsTypesEndpoint import FinanceAgreementsTypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Agreement from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsEndpoint( @@ -27,39 +19,30 @@ class FinanceAgreementsEndpoint( IPostable[Agreement, ConnectWiseManageRequestParams], IPaginateable[Agreement, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "agreements", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "agreements", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Agreement]) IPostable.__init__(self, Agreement) IPaginateable.__init__(self, Agreement) - self.count = self._register_child_endpoint( - FinanceAgreementsCountEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - FinanceAgreementsTypesEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceAgreementsCountEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(FinanceAgreementsTypesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceAgreementsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdEndpoint: The initialized FinanceAgreementsIdEndpoint object. """ child = FinanceAgreementsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Agreement]: """ Performs a GET request against the /finance/agreements endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Agreement, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Agreement, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Agreement]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Agreement]: """ Performs a GET request against the /finance/agreements endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Agreement]: The parsed response data. """ - return self._parse_many( - Agreement, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Agreement, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Agreement: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Agreement: """ Performs a POST request against the /finance/agreements endpoint. @@ -117,6 +83,4 @@ def post( Returns: Agreement: The parsed response data. """ - return self._parse_one( - Agreement, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Agreement, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsCountEndpoint.py index 20e68be0a..312574ae2 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdAdditionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdAdditionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/additions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/additions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsEndpoint.py index 25abcaa7c..1d74e8a35 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdditionsCountEndpoint import ( FinanceAgreementsIdAdditionsCountEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdditionsIdEndpoint import ( - FinanceAgreementsIdAdditionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdditionsIdEndpoint import FinanceAgreementsIdAdditionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Addition from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdAdditionsEndpoint( @@ -24,10 +20,8 @@ class FinanceAgreementsIdAdditionsEndpoint( IPostable[Addition, ConnectWiseManageRequestParams], IPaginateable[Addition, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "additions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "additions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Addition]) IPostable.__init__(self, Addition) IPaginateable.__init__(self, Addition) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementsIdAdditionsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementsIdAdditionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdAdditionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdAdditionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdAdditionsIdEndpoint: The initialized FinanceAgreementsIdAdditionsIdEndpoint object. """ - child = FinanceAgreementsIdAdditionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdAdditionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Addition]: """ Performs a GET request against the /finance/agreements/{id}/additions endpoint and returns an initialized PaginatedResponse object. @@ -72,20 +61,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Addition, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Addition, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Addition]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Addition]: """ Performs a GET request against the /finance/agreements/{id}/additions endpoint. @@ -95,15 +73,9 @@ def get( Returns: list[Addition]: The parsed response data. """ - return self._parse_many( - Addition, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Addition, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Addition: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Addition: """ Performs a POST request against the /finance/agreements/{id}/additions endpoint. @@ -113,6 +85,4 @@ def post( Returns: Addition: The parsed response data. """ - return self._parse_one( - Addition, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Addition, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsIdEndpoint.py index deaa4bf5f..c0ae12854 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdditionsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Addition from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdAdditionsIdEndpoint( ConnectWiseEndpoint, IGettable[Addition, ConnectWiseManageRequestParams], - IPuttable[Addition, ConnectWiseManageRequestParams], IPatchable[Addition, ConnectWiseManageRequestParams], + IPuttable[Addition, ConnectWiseManageRequestParams], IPaginateable[Addition, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Addition) - IPuttable.__init__(self, Addition) IPatchable.__init__(self, Addition) + IPuttable.__init__(self, Addition) IPaginateable.__init__(self, Addition) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Addition]: """ Performs a GET request against the /finance/agreements/{id}/additions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Addition, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Addition, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Addition: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id}/additions/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id}/additions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Addition: The parsed response data. """ - return self._parse_one( - Addition, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Addition: """ - Performs a DELETE request against the /finance/agreements/{id}/additions/{id} endpoint. + Performs a GET request against the /finance/agreements/{id}/additions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Addition: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Addition, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Addition: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Addition: """ - Performs a PUT request against the /finance/agreements/{id}/additions/{id} endpoint. + Performs a PATCH request against the /finance/agreements/{id}/additions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Addition: The parsed response data. """ - return self._parse_one( - Addition, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Addition, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Addition: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Addition: """ - Performs a PATCH request against the /finance/agreements/{id}/additions/{id} endpoint. + Performs a PUT request against the /finance/agreements/{id}/additions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Addition: The parsed response data. """ - return self._parse_one( - Addition, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Addition, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsCountEndpoint.py index 0a42ef63a..c6662dc36 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdAdjustmentsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdAdjustmentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/adjustments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/adjustments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsEndpoint.py index a319526d3..3ab1af81b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdjustmentsCountEndpoint import ( FinanceAgreementsIdAdjustmentsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdjustmentsIdEndpoint import ( FinanceAgreementsIdAdjustmentsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementAdjustment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdAdjustmentsEndpoint( @@ -24,10 +22,8 @@ class FinanceAgreementsIdAdjustmentsEndpoint( IPostable[AgreementAdjustment, ConnectWiseManageRequestParams], IPaginateable[AgreementAdjustment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "adjustments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "adjustments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementAdjustment]) IPostable.__init__(self, AgreementAdjustment) IPaginateable.__init__(self, AgreementAdjustment) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementsIdAdjustmentsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementsIdAdjustmentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdAdjustmentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdAdjustmentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdAdjustmentsIdEndpoint: The initialized FinanceAgreementsIdAdjustmentsIdEndpoint object. """ - child = FinanceAgreementsIdAdjustmentsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdAdjustmentsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementAdjustment]: """ Performs a GET request against the /finance/agreements/{id}/adjustments endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementAdjustment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementAdjustment, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementAdjustment]: """ Performs a GET request against the /finance/agreements/{id}/adjustments endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[AgreementAdjustment]: The parsed response data. """ - return self._parse_many( - AgreementAdjustment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AgreementAdjustment, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementAdjustment: """ Performs a POST request against the /finance/agreements/{id}/adjustments endpoint. @@ -114,7 +93,4 @@ def post( Returns: AgreementAdjustment: The parsed response data. """ - return self._parse_one( - AgreementAdjustment, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AgreementAdjustment, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsIdEndpoint.py index 0e5950807..c00512971 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdAdjustmentsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementAdjustment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdAdjustmentsIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementAdjustment, ConnectWiseManageRequestParams], - IPuttable[AgreementAdjustment, ConnectWiseManageRequestParams], IPatchable[AgreementAdjustment, ConnectWiseManageRequestParams], + IPuttable[AgreementAdjustment, ConnectWiseManageRequestParams], IPaginateable[AgreementAdjustment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementAdjustment) - IPuttable.__init__(self, AgreementAdjustment) IPatchable.__init__(self, AgreementAdjustment) + IPuttable.__init__(self, AgreementAdjustment) IPaginateable.__init__(self, AgreementAdjustment) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementAdjustment]: """ Performs a GET request against the /finance/agreements/{id}/adjustments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementAdjustment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementAdjustment, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementAdjustment: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id}/adjustments/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id}/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementAdjustment: The parsed response data. """ - return self._parse_one( - AgreementAdjustment, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> AgreementAdjustment: """ - Performs a DELETE request against the /finance/agreements/{id}/adjustments/{id} endpoint. + Performs a GET request against the /finance/agreements/{id}/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementAdjustment: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementAdjustment, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> AgreementAdjustment: """ - Performs a PUT request against the /finance/agreements/{id}/adjustments/{id} endpoint. + Performs a PATCH request against the /finance/agreements/{id}/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: AgreementAdjustment: The parsed response data. """ - return self._parse_one( - AgreementAdjustment, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AgreementAdjustment, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementAdjustment: """ - Performs a PATCH request against the /finance/agreements/{id}/adjustments/{id} endpoint. + Performs a PUT request against the /finance/agreements/{id}/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: AgreementAdjustment: The parsed response data. """ - return self._parse_one( - AgreementAdjustment, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementAdjustment, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersEndpoint.py index ec93324c0..7620bb37d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersEndpoint.py @@ -6,13 +6,9 @@ class FinanceAgreementsIdApplicationparametersEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "applicationParameters", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "applicationParameters", parent_endpoint=parent_endpoint) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementsIdApplicationparametersIdEndpoint: + def id(self, id: int) -> FinanceAgreementsIdApplicationparametersIdEndpoint: # noqa: A002 """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdApplicationparametersIdEndpoint object to move down the chain. @@ -21,8 +17,6 @@ def id( Returns: FinanceAgreementsIdApplicationparametersIdEndpoint: The initialized FinanceAgreementsIdApplicationparametersIdEndpoint object. """ - child = FinanceAgreementsIdApplicationparametersIdEndpoint( - self.client, parent_endpoint=self - ) + child = FinanceAgreementsIdApplicationparametersIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersIdEndpoint.py index 7c001cc89..df30dba77 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdApplicationparametersIdEndpoint.py @@ -17,9 +17,7 @@ class FinanceAgreementsIdApplicationparametersIdEndpoint( IPaginateable[AgreementApplicationParameters, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementApplicationParameters) IPaginateable.__init__(self, AgreementApplicationParameters) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsCountEndpoint.py index bb92cbd73..bf533329e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdBoarddefaultsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdBoarddefaultsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/boardDefaults/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/boardDefaults/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsEndpoint.py index 2bf694a92..a5a9e5469 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdBoarddefaultsCountEndpoint import ( FinanceAgreementsIdBoarddefaultsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementsIdBoarddefaultsIdEndpoint import ( FinanceAgreementsIdBoarddefaultsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardDefault from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdBoarddefaultsEndpoint( @@ -24,10 +22,8 @@ class FinanceAgreementsIdBoarddefaultsEndpoint( IPostable[BoardDefault, ConnectWiseManageRequestParams], IPaginateable[BoardDefault, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "boardDefaults", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "boardDefaults", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardDefault]) IPostable.__init__(self, BoardDefault) IPaginateable.__init__(self, BoardDefault) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementsIdBoarddefaultsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementsIdBoarddefaultsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdBoarddefaultsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdBoarddefaultsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdBoarddefaultsIdEndpoint: The initialized FinanceAgreementsIdBoarddefaultsIdEndpoint object. """ - child = FinanceAgreementsIdBoarddefaultsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdBoarddefaultsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardDefault]: """ Performs a GET request against the /finance/agreements/{id}/boardDefaults endpoint and returns an initialized PaginatedResponse object. @@ -73,19 +64,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardDefault, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardDefault, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BoardDefault]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BoardDefault]: """ Performs a GET request against the /finance/agreements/{id}/boardDefaults endpoint. @@ -95,15 +77,9 @@ def get( Returns: list[BoardDefault]: The parsed response data. """ - return self._parse_many( - BoardDefault, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardDefault, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardDefault: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardDefault: """ Performs a POST request against the /finance/agreements/{id}/boardDefaults endpoint. @@ -113,6 +89,4 @@ def post( Returns: BoardDefault: The parsed response data. """ - return self._parse_one( - BoardDefault, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BoardDefault, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsIdEndpoint.py index 9142f448c..d5e9eee6b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdBoarddefaultsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardDefault from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdBoarddefaultsIdEndpoint( ConnectWiseEndpoint, IGettable[BoardDefault, ConnectWiseManageRequestParams], - IPuttable[BoardDefault, ConnectWiseManageRequestParams], IPatchable[BoardDefault, ConnectWiseManageRequestParams], + IPuttable[BoardDefault, ConnectWiseManageRequestParams], IPaginateable[BoardDefault, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardDefault) - IPuttable.__init__(self, BoardDefault) IPatchable.__init__(self, BoardDefault) + IPuttable.__init__(self, BoardDefault) IPaginateable.__init__(self, BoardDefault) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardDefault]: """ Performs a GET request against the /finance/agreements/{id}/boardDefaults/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardDefault, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardDefault, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardDefault: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardDefault: The parsed response data. """ - return self._parse_one( - BoardDefault, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardDefault: """ - Performs a DELETE request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. + Performs a GET request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardDefault: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardDefault, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardDefault: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardDefault: """ - Performs a PUT request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. + Performs a PATCH request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: BoardDefault: The parsed response data. """ - return self._parse_one( - BoardDefault, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BoardDefault, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardDefault: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardDefault: """ - Performs a PATCH request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. + Performs a PUT request against the /finance/agreements/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: BoardDefault: The parsed response data. """ - return self._parse_one( - BoardDefault, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BoardDefault, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsCountEndpoint.py index 1d10b2053..4f29a3246 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdConfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdConfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/configurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/configurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsEndpoint.py index 78dadb1ed..1e1d597fc 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdConfigurationsCountEndpoint import ( FinanceAgreementsIdConfigurationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementsIdConfigurationsIdEndpoint import ( FinanceAgreementsIdConfigurationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConfigurationReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdConfigurationsEndpoint( @@ -24,10 +22,8 @@ class FinanceAgreementsIdConfigurationsEndpoint( IPostable[ConfigurationReference, ConnectWiseManageRequestParams], IPaginateable[ConfigurationReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "configurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "configurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationReference]) IPostable.__init__(self, ConfigurationReference) IPaginateable.__init__(self, ConfigurationReference) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementsIdConfigurationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementsIdConfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdConfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdConfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdConfigurationsIdEndpoint: The initialized FinanceAgreementsIdConfigurationsIdEndpoint object. """ - child = FinanceAgreementsIdConfigurationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdConfigurationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationReference]: """ Performs a GET request against the /finance/agreements/{id}/configurations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationReference]: """ Performs a GET request against the /finance/agreements/{id}/configurations endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[ConfigurationReference]: The parsed response data. """ - return self._parse_many( - ConfigurationReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConfigurationReference, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationReference: """ Performs a POST request against the /finance/agreements/{id}/configurations endpoint. @@ -114,7 +93,4 @@ def post( Returns: ConfigurationReference: The parsed response data. """ - return self._parse_one( - ConfigurationReference, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationReference, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsIdEndpoint.py index 2c007a16f..7599e5175 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdConfigurationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdConfigurationsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdConfigurationsIdEndpoint( IGettable[ConfigurationReference, ConnectWiseManageRequestParams], IPaginateable[ConfigurationReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationReference) IPaginateable.__init__(self, ConfigurationReference) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationReference]: """ Performs a GET request against the /finance/agreements/{id}/configurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,29 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationReference, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationReference: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id}/configurations/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id}/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConfigurationReference: The parsed response data. """ - return self._parse_one( - ConfigurationReference, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ConfigurationReference: """ - Performs a DELETE request against the /finance/agreements/{id}/configurations/{id} endpoint. + Performs a GET request against the /finance/agreements/{id}/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConfigurationReference: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ConfigurationReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdCopyEndpoint.py index 5c4224152..99128adef 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdCopyEndpoint.py @@ -9,13 +9,9 @@ ) -class FinanceAgreementsIdCopyEndpoint( - ConnectWiseEndpoint, IPostable[Agreement, ConnectWiseManageRequestParams] -): +class FinanceAgreementsIdCopyEndpoint(ConnectWiseEndpoint, IPostable[Agreement, ConnectWiseManageRequestParams]): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, Agreement) def post( @@ -32,6 +28,4 @@ def post( Returns: Agreement: The parsed response data. """ - return self._parse_one( - Agreement, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Agreement, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdEndpoint.py index f9e7b7655..2446d2423 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdEndpoint.py @@ -1,121 +1,74 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdditionsEndpoint import ( - FinanceAgreementsIdAdditionsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdjustmentsEndpoint import ( - FinanceAgreementsIdAdjustmentsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdApplicationparametersEndpoint import ( - FinanceAgreementsIdApplicationparametersEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdditionsEndpoint import FinanceAgreementsIdAdditionsEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsIdAdjustmentsEndpoint import FinanceAgreementsIdAdjustmentsEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdBoarddefaultsEndpoint import ( FinanceAgreementsIdBoarddefaultsEndpoint, ) from pyconnectwise.endpoints.manage.FinanceAgreementsIdConfigurationsEndpoint import ( FinanceAgreementsIdConfigurationsEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdCopyEndpoint import ( - FinanceAgreementsIdCopyEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdInvoiceEndpoint import ( - FinanceAgreementsIdInvoiceEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdRecurringparametersEndpoint import ( - FinanceAgreementsIdRecurringparametersEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdSitesEndpoint import ( - FinanceAgreementsIdSitesEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdSitesEndpoint import FinanceAgreementsIdSitesEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkroleexclusionsEndpoint import ( FinanceAgreementsIdWorkroleexclusionsEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkrolesEndpoint import ( - FinanceAgreementsIdWorkrolesEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkrolesEndpoint import FinanceAgreementsIdWorkrolesEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypeexclusionsEndpoint import ( FinanceAgreementsIdWorktypeexclusionsEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypesEndpoint import ( - FinanceAgreementsIdWorktypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypesEndpoint import FinanceAgreementsIdWorktypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Agreement from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdEndpoint( ConnectWiseEndpoint, IGettable[Agreement, ConnectWiseManageRequestParams], - IPuttable[Agreement, ConnectWiseManageRequestParams], IPatchable[Agreement, ConnectWiseManageRequestParams], + IPuttable[Agreement, ConnectWiseManageRequestParams], IPaginateable[Agreement, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Agreement) - IPuttable.__init__(self, Agreement) IPatchable.__init__(self, Agreement) + IPuttable.__init__(self, Agreement) IPaginateable.__init__(self, Agreement) - self.configurations = self._register_child_endpoint( - FinanceAgreementsIdConfigurationsEndpoint(client, parent_endpoint=self) - ) - self.workroles = self._register_child_endpoint( - FinanceAgreementsIdWorkrolesEndpoint(client, parent_endpoint=self) - ) - self.copy = self._register_child_endpoint( - FinanceAgreementsIdCopyEndpoint(client, parent_endpoint=self) - ) - self.sites = self._register_child_endpoint( - FinanceAgreementsIdSitesEndpoint(client, parent_endpoint=self) - ) - self.application_parameters = self._register_child_endpoint( - FinanceAgreementsIdApplicationparametersEndpoint( - client, parent_endpoint=self - ) + self.additions = self._register_child_endpoint( + FinanceAgreementsIdAdditionsEndpoint(client, parent_endpoint=self) ) self.adjustments = self._register_child_endpoint( FinanceAgreementsIdAdjustmentsEndpoint(client, parent_endpoint=self) ) - self.additions = self._register_child_endpoint( - FinanceAgreementsIdAdditionsEndpoint(client, parent_endpoint=self) - ) self.board_defaults = self._register_child_endpoint( FinanceAgreementsIdBoarddefaultsEndpoint(client, parent_endpoint=self) ) + self.configurations = self._register_child_endpoint( + FinanceAgreementsIdConfigurationsEndpoint(client, parent_endpoint=self) + ) + self.sites = self._register_child_endpoint(FinanceAgreementsIdSitesEndpoint(client, parent_endpoint=self)) self.work_role_exclusions = self._register_child_endpoint( FinanceAgreementsIdWorkroleexclusionsEndpoint(client, parent_endpoint=self) ) - self.recurring_parameters = self._register_child_endpoint( - FinanceAgreementsIdRecurringparametersEndpoint(client, parent_endpoint=self) + self.work_type_exclusions = self._register_child_endpoint( + FinanceAgreementsIdWorktypeexclusionsEndpoint(client, parent_endpoint=self) + ) + self.workroles = self._register_child_endpoint( + FinanceAgreementsIdWorkrolesEndpoint(client, parent_endpoint=self) ) self.worktypes = self._register_child_endpoint( FinanceAgreementsIdWorktypesEndpoint(client, parent_endpoint=self) ) - self.invoice = self._register_child_endpoint( - FinanceAgreementsIdInvoiceEndpoint(client, parent_endpoint=self) - ) - self.work_type_exclusions = self._register_child_endpoint( - FinanceAgreementsIdWorktypeexclusionsEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Agreement]: """ Performs a GET request against the /finance/agreements/{id} endpoint and returns an initialized PaginatedResponse object. @@ -132,54 +85,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Agreement, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Agreement, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Agreement: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Agreement: The parsed response data. """ - return self._parse_one( - Agreement, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Agreement: """ - Performs a DELETE request against the /finance/agreements/{id} endpoint. + Performs a GET request against the /finance/agreements/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Agreement: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Agreement, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Agreement: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Agreement: """ - Performs a PUT request against the /finance/agreements/{id} endpoint. + Performs a PATCH request against the /finance/agreements/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -187,17 +119,11 @@ def put( Returns: Agreement: The parsed response data. """ - return self._parse_one( - Agreement, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Agreement, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Agreement: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Agreement: """ - Performs a PATCH request against the /finance/agreements/{id} endpoint. + Performs a PUT request against the /finance/agreements/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -205,6 +131,4 @@ def patch( Returns: Agreement: The parsed response data. """ - return self._parse_one( - Agreement, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Agreement, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdInvoiceEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdInvoiceEndpoint.py index 48f607e2b..0e39e22e9 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdInvoiceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdInvoiceEndpoint.py @@ -3,6 +3,4 @@ class FinanceAgreementsIdInvoiceEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoice", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "invoice", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersEndpoint.py index 6fc8ace21..e57510c04 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersEndpoint.py @@ -6,13 +6,9 @@ class FinanceAgreementsIdRecurringparametersEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "recurringParameters", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "recurringParameters", parent_endpoint=parent_endpoint) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementsIdRecurringparametersIdEndpoint: + def id(self, id: int) -> FinanceAgreementsIdRecurringparametersIdEndpoint: # noqa: A002 """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdRecurringparametersIdEndpoint object to move down the chain. @@ -21,8 +17,6 @@ def id( Returns: FinanceAgreementsIdRecurringparametersIdEndpoint: The initialized FinanceAgreementsIdRecurringparametersIdEndpoint object. """ - child = FinanceAgreementsIdRecurringparametersIdEndpoint( - self.client, parent_endpoint=self - ) + child = FinanceAgreementsIdRecurringparametersIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersIdEndpoint.py index d6693710e..672164727 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdRecurringparametersIdEndpoint.py @@ -17,9 +17,7 @@ class FinanceAgreementsIdRecurringparametersIdEndpoint( IPaginateable[AgreementRecurringParameters, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementRecurringParameters) IPaginateable.__init__(self, AgreementRecurringParameters) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesCountEndpoint.py index f33895c17..d0af386ae 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdSitesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdSitesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/sites/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/sites/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesEndpoint.py index 96f67c7ed..6eccdbc1f 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAgreementsIdSitesCountEndpoint import ( - FinanceAgreementsIdSitesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdSitesIdEndpoint import ( - FinanceAgreementsIdSitesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdSitesCountEndpoint import FinanceAgreementsIdSitesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsIdSitesIdEndpoint import FinanceAgreementsIdSitesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementSite from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdSitesEndpoint( @@ -24,36 +18,29 @@ class FinanceAgreementsIdSitesEndpoint( IPostable[AgreementSite, ConnectWiseManageRequestParams], IPaginateable[AgreementSite, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "sites", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "sites", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementSite]) IPostable.__init__(self, AgreementSite) IPaginateable.__init__(self, AgreementSite) - self.count = self._register_child_endpoint( - FinanceAgreementsIdSitesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceAgreementsIdSitesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceAgreementsIdSitesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdSitesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdSitesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdSitesIdEndpoint: The initialized FinanceAgreementsIdSitesIdEndpoint object. """ child = FinanceAgreementsIdSitesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementSite]: """ Performs a GET request against the /finance/agreements/{id}/sites endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementSite, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementSite, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementSite]: """ Performs a GET request against the /finance/agreements/{id}/sites endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[AgreementSite]: The parsed response data. """ - return self._parse_many( - AgreementSite, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(AgreementSite, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementSite: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementSite: """ Performs a POST request against the /finance/agreements/{id}/sites endpoint. @@ -111,7 +85,4 @@ def post( Returns: AgreementSite: The parsed response data. """ - return self._parse_one( - AgreementSite, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AgreementSite, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesIdEndpoint.py index 1b6a1a54e..fc5a42a24 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdSitesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementSite from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdSitesIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementSite, ConnectWiseManageRequestParams], - IPuttable[AgreementSite, ConnectWiseManageRequestParams], IPatchable[AgreementSite, ConnectWiseManageRequestParams], + IPuttable[AgreementSite, ConnectWiseManageRequestParams], IPaginateable[AgreementSite, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementSite) - IPuttable.__init__(self, AgreementSite) IPatchable.__init__(self, AgreementSite) + IPuttable.__init__(self, AgreementSite) IPaginateable.__init__(self, AgreementSite) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementSite]: """ Performs a GET request against the /finance/agreements/{id}/sites/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementSite, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementSite, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementSite: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id}/sites/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementSite: The parsed response data. """ - return self._parse_one( - AgreementSite, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementSite: """ - Performs a DELETE request against the /finance/agreements/{id}/sites/{id} endpoint. + Performs a GET request against the /finance/agreements/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementSite: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementSite, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementSite: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AgreementSite: """ - Performs a PUT request against the /finance/agreements/{id}/sites/{id} endpoint. + Performs a PATCH request against the /finance/agreements/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: AgreementSite: The parsed response data. """ - return self._parse_one( - AgreementSite, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(AgreementSite, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementSite: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementSite: """ - Performs a PATCH request against the /finance/agreements/{id}/sites/{id} endpoint. + Performs a PUT request against the /finance/agreements/{id}/sites/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: AgreementSite: The parsed response data. """ - return self._parse_one( - AgreementSite, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementSite, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsCountEndpoint.py index c22f3c861..95e864432 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorkroleexclusionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdWorkroleexclusionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/workRoleExclusions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/workRoleExclusions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsEndpoint.py index 62962ee16..d0aec449c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkroleexclusionsCountEndpoint import ( FinanceAgreementsIdWorkroleexclusionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkroleexclusionsIdEndpoint import ( FinanceAgreementsIdWorkroleexclusionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementWorkRoleExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorkroleexclusionsEndpoint( @@ -24,42 +22,31 @@ class FinanceAgreementsIdWorkroleexclusionsEndpoint( IPostable[AgreementWorkRoleExclusion, ConnectWiseManageRequestParams], IPaginateable[AgreementWorkRoleExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workRoleExclusions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workRoleExclusions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementWorkRoleExclusion]) IPostable.__init__(self, AgreementWorkRoleExclusion) IPaginateable.__init__(self, AgreementWorkRoleExclusion) self.count = self._register_child_endpoint( - FinanceAgreementsIdWorkroleexclusionsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAgreementsIdWorkroleexclusionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementsIdWorkroleexclusionsIdEndpoint: + def id(self, _id: int) -> FinanceAgreementsIdWorkroleexclusionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdWorkroleexclusionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdWorkroleexclusionsIdEndpoint: The initialized FinanceAgreementsIdWorkroleexclusionsIdEndpoint object. """ - child = FinanceAgreementsIdWorkroleexclusionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdWorkroleexclusionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementWorkRoleExclusion]: """ Performs a GET request against the /finance/agreements/{id}/workRoleExclusions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementWorkRoleExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementWorkRoleExclusion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementWorkRoleExclusion]: """ Performs a GET request against the /finance/agreements/{id}/workRoleExclusions endpoint. @@ -100,14 +80,11 @@ def get( list[AgreementWorkRoleExclusion]: The parsed response data. """ return self._parse_many( - AgreementWorkRoleExclusion, - super()._make_request("GET", data=data, params=params).json(), + AgreementWorkRoleExclusion, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementWorkRoleExclusion: """ Performs a POST request against the /finance/agreements/{id}/workRoleExclusions endpoint. @@ -119,6 +96,5 @@ def post( AgreementWorkRoleExclusion: The parsed response data. """ return self._parse_one( - AgreementWorkRoleExclusion, - super()._make_request("POST", data=data, params=params).json(), + AgreementWorkRoleExclusion, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsIdEndpoint.py index bd86341b0..d41b357a1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkroleexclusionsIdEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorkroleexclusionsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a DELETE request against the /finance/agreements/{id}/workRoleExclusions/{id} endpoint. diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesCountEndpoint.py index 84c10e285..334221da2 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorkrolesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdWorkrolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/workroles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/workroles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesEndpoint.py index 9229bdf3c..3360a515c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkrolesCountEndpoint import ( FinanceAgreementsIdWorkrolesCountEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkrolesIdEndpoint import ( - FinanceAgreementsIdWorkrolesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorkrolesIdEndpoint import FinanceAgreementsIdWorkrolesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementWorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorkrolesEndpoint( @@ -24,10 +20,8 @@ class FinanceAgreementsIdWorkrolesEndpoint( IPostable[AgreementWorkRole, ConnectWiseManageRequestParams], IPaginateable[AgreementWorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workroles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workroles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementWorkRole]) IPostable.__init__(self, AgreementWorkRole) IPaginateable.__init__(self, AgreementWorkRole) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementsIdWorkrolesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementsIdWorkrolesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdWorkrolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdWorkrolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdWorkrolesIdEndpoint: The initialized FinanceAgreementsIdWorkrolesIdEndpoint object. """ - child = FinanceAgreementsIdWorkrolesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdWorkrolesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementWorkRole]: """ Performs a GET request against the /finance/agreements/{id}/workroles endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementWorkRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementWorkRole, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementWorkRole]: """ Performs a GET request against the /finance/agreements/{id}/workroles endpoint. @@ -95,16 +77,9 @@ def get( Returns: list[AgreementWorkRole]: The parsed response data. """ - return self._parse_many( - AgreementWorkRole, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AgreementWorkRole, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkRole: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkRole: """ Performs a POST request against the /finance/agreements/{id}/workroles endpoint. @@ -114,7 +89,4 @@ def post( Returns: AgreementWorkRole: The parsed response data. """ - return self._parse_one( - AgreementWorkRole, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AgreementWorkRole, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesIdEndpoint.py index 16802d986..f2df912d7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorkrolesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementWorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorkrolesIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementWorkRole, ConnectWiseManageRequestParams], - IPuttable[AgreementWorkRole, ConnectWiseManageRequestParams], IPatchable[AgreementWorkRole, ConnectWiseManageRequestParams], + IPuttable[AgreementWorkRole, ConnectWiseManageRequestParams], IPaginateable[AgreementWorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementWorkRole) - IPuttable.__init__(self, AgreementWorkRole) IPatchable.__init__(self, AgreementWorkRole) + IPuttable.__init__(self, AgreementWorkRole) IPaginateable.__init__(self, AgreementWorkRole) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementWorkRole]: """ Performs a GET request against the /finance/agreements/{id}/workroles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementWorkRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementWorkRole, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkRole: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id}/workroles/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementWorkRole: The parsed response data. """ - return self._parse_one( - AgreementWorkRole, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkRole: """ - Performs a DELETE request against the /finance/agreements/{id}/workroles/{id} endpoint. + Performs a GET request against the /finance/agreements/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementWorkRole: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementWorkRole, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkRole: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkRole: """ - Performs a PUT request against the /finance/agreements/{id}/workroles/{id} endpoint. + Performs a PATCH request against the /finance/agreements/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: AgreementWorkRole: The parsed response data. """ - return self._parse_one( - AgreementWorkRole, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AgreementWorkRole, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkRole: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkRole: """ - Performs a PATCH request against the /finance/agreements/{id}/workroles/{id} endpoint. + Performs a PUT request against the /finance/agreements/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: AgreementWorkRole: The parsed response data. """ - return self._parse_one( - AgreementWorkRole, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementWorkRole, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsCountEndpoint.py index 0c2a73952..ca6f7f32f 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorktypeexclusionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdWorktypeexclusionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/workTypeExclusions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/workTypeExclusions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsEndpoint.py index b2f9fcc24..f122867dc 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypeexclusionsCountEndpoint import ( FinanceAgreementsIdWorktypeexclusionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypeexclusionsIdEndpoint import ( FinanceAgreementsIdWorktypeexclusionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementWorkTypeExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorktypeexclusionsEndpoint( @@ -24,42 +22,31 @@ class FinanceAgreementsIdWorktypeexclusionsEndpoint( IPostable[AgreementWorkTypeExclusion, ConnectWiseManageRequestParams], IPaginateable[AgreementWorkTypeExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workTypeExclusions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workTypeExclusions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementWorkTypeExclusion]) IPostable.__init__(self, AgreementWorkTypeExclusion) IPaginateable.__init__(self, AgreementWorkTypeExclusion) self.count = self._register_child_endpoint( - FinanceAgreementsIdWorktypeexclusionsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAgreementsIdWorktypeexclusionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementsIdWorktypeexclusionsIdEndpoint: + def id(self, _id: int) -> FinanceAgreementsIdWorktypeexclusionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdWorktypeexclusionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdWorktypeexclusionsIdEndpoint: The initialized FinanceAgreementsIdWorktypeexclusionsIdEndpoint object. """ - child = FinanceAgreementsIdWorktypeexclusionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdWorktypeexclusionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementWorkTypeExclusion]: """ Performs a GET request against the /finance/agreements/{id}/workTypeExclusions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementWorkTypeExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementWorkTypeExclusion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementWorkTypeExclusion]: """ Performs a GET request against the /finance/agreements/{id}/workTypeExclusions endpoint. @@ -100,14 +80,11 @@ def get( list[AgreementWorkTypeExclusion]: The parsed response data. """ return self._parse_many( - AgreementWorkTypeExclusion, - super()._make_request("GET", data=data, params=params).json(), + AgreementWorkTypeExclusion, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementWorkTypeExclusion: """ Performs a POST request against the /finance/agreements/{id}/workTypeExclusions endpoint. @@ -119,6 +96,5 @@ def post( AgreementWorkTypeExclusion: The parsed response data. """ return self._parse_one( - AgreementWorkTypeExclusion, - super()._make_request("POST", data=data, params=params).json(), + AgreementWorkTypeExclusion, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsIdEndpoint.py index 223dcce36..dcd322c53 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypeexclusionsIdEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorktypeexclusionsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a DELETE request against the /finance/agreements/{id}/workTypeExclusions/{id} endpoint. diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesCountEndpoint.py index 8d3bd6ae1..4d96c5a7c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorktypesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsIdWorktypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/{id}/worktypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/{id}/worktypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesEndpoint.py index 6a7a8bb9a..5ab727fb9 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypesCountEndpoint import ( FinanceAgreementsIdWorktypesCountEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypesIdEndpoint import ( - FinanceAgreementsIdWorktypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsIdWorktypesIdEndpoint import FinanceAgreementsIdWorktypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementWorkType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorktypesEndpoint( @@ -24,10 +20,8 @@ class FinanceAgreementsIdWorktypesEndpoint( IPostable[AgreementWorkType, ConnectWiseManageRequestParams], IPaginateable[AgreementWorkType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "worktypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "worktypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementWorkType]) IPostable.__init__(self, AgreementWorkType) IPaginateable.__init__(self, AgreementWorkType) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementsIdWorktypesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementsIdWorktypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsIdWorktypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsIdWorktypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsIdWorktypesIdEndpoint: The initialized FinanceAgreementsIdWorktypesIdEndpoint object. """ - child = FinanceAgreementsIdWorktypesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementsIdWorktypesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementWorkType]: """ Performs a GET request against the /finance/agreements/{id}/worktypes endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementWorkType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementWorkType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementWorkType]: """ Performs a GET request against the /finance/agreements/{id}/worktypes endpoint. @@ -95,16 +77,9 @@ def get( Returns: list[AgreementWorkType]: The parsed response data. """ - return self._parse_many( - AgreementWorkType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AgreementWorkType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkType: """ Performs a POST request against the /finance/agreements/{id}/worktypes endpoint. @@ -114,7 +89,4 @@ def post( Returns: AgreementWorkType: The parsed response data. """ - return self._parse_one( - AgreementWorkType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AgreementWorkType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesIdEndpoint.py index 99b9af523..72f2b85f1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsIdWorktypesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementWorkType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsIdWorktypesIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementWorkType, ConnectWiseManageRequestParams], - IPuttable[AgreementWorkType, ConnectWiseManageRequestParams], IPatchable[AgreementWorkType, ConnectWiseManageRequestParams], + IPuttable[AgreementWorkType, ConnectWiseManageRequestParams], IPaginateable[AgreementWorkType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementWorkType) - IPuttable.__init__(self, AgreementWorkType) IPatchable.__init__(self, AgreementWorkType) + IPuttable.__init__(self, AgreementWorkType) IPaginateable.__init__(self, AgreementWorkType) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementWorkType]: """ Performs a GET request against the /finance/agreements/{id}/worktypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementWorkType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementWorkType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/{id}/worktypes/{id} endpoint. + Performs a DELETE request against the /finance/agreements/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementWorkType: The parsed response data. """ - return self._parse_one( - AgreementWorkType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkType: """ - Performs a DELETE request against the /finance/agreements/{id}/worktypes/{id} endpoint. + Performs a GET request against the /finance/agreements/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementWorkType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementWorkType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkType: """ - Performs a PUT request against the /finance/agreements/{id}/worktypes/{id} endpoint. + Performs a PATCH request against the /finance/agreements/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: AgreementWorkType: The parsed response data. """ - return self._parse_one( - AgreementWorkType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AgreementWorkType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementWorkType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementWorkType: """ - Performs a PATCH request against the /finance/agreements/{id}/worktypes/{id} endpoint. + Performs a PUT request against the /finance/agreements/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: AgreementWorkType: The parsed response data. """ - return self._parse_one( - AgreementWorkType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementWorkType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesCountEndpoint.py index ad8fd5f17..89cc8fbbb 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesEndpoint.py index 8d33cf31c..730e774cc 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAgreementsTypesCountEndpoint import ( - FinanceAgreementsTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdEndpoint import ( - FinanceAgreementsTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsTypesInfoEndpoint import ( - FinanceAgreementsTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsTypesCountEndpoint import FinanceAgreementsTypesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdEndpoint import FinanceAgreementsTypesIdEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsTypesInfoEndpoint import FinanceAgreementsTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesEndpoint( @@ -27,39 +19,30 @@ class FinanceAgreementsTypesEndpoint( IPostable[AgreementType, ConnectWiseManageRequestParams], IPaginateable[AgreementType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementType]) IPostable.__init__(self, AgreementType) IPaginateable.__init__(self, AgreementType) - self.count = self._register_child_endpoint( - FinanceAgreementsTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceAgreementsTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceAgreementsTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceAgreementsTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceAgreementsTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementsTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementsTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementsTypesIdEndpoint: The initialized FinanceAgreementsTypesIdEndpoint object. """ child = FinanceAgreementsTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementType]: """ Performs a GET request against the /finance/agreements/types endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementType]: """ Performs a GET request against the /finance/agreements/types endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[AgreementType]: The parsed response data. """ - return self._parse_many( - AgreementType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(AgreementType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementType: """ Performs a POST request against the /finance/agreements/types endpoint. @@ -117,7 +87,4 @@ def post( Returns: AgreementType: The parsed response data. """ - return self._parse_one( - AgreementType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AgreementType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdCopyEndpoint.py index 5b438d0a4..b4c97a0d5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdCopyEndpoint.py @@ -13,9 +13,7 @@ class FinanceAgreementsTypesIdCopyEndpoint( ConnectWiseEndpoint, IPostable[AgreementType, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, AgreementType) def post( diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdEndpoint.py index bea1aec55..13239ec75 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdEndpoint.py @@ -1,59 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdCopyEndpoint import ( - FinanceAgreementsTypesIdCopyEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdInfoEndpoint import ( - FinanceAgreementsTypesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdUsagesEndpoint import ( - FinanceAgreementsTypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdInfoEndpoint import FinanceAgreementsTypesIdInfoEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdUsagesEndpoint import FinanceAgreementsTypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementType, ConnectWiseManageRequestParams], - IPuttable[AgreementType, ConnectWiseManageRequestParams], IPatchable[AgreementType, ConnectWiseManageRequestParams], + IPuttable[AgreementType, ConnectWiseManageRequestParams], IPaginateable[AgreementType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementType) - IPuttable.__init__(self, AgreementType) IPatchable.__init__(self, AgreementType) + IPuttable.__init__(self, AgreementType) IPaginateable.__init__(self, AgreementType) - self.copy = self._register_child_endpoint( - FinanceAgreementsTypesIdCopyEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(FinanceAgreementsTypesIdInfoEndpoint(client, parent_endpoint=self)) self.usages = self._register_child_endpoint( FinanceAgreementsTypesIdUsagesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - FinanceAgreementsTypesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementType]: """ Performs a GET request against the /finance/agreements/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -71,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreements/types/{id} endpoint. + Performs a DELETE request against the /finance/agreements/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementType: The parsed response data. """ - return self._parse_one( - AgreementType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementType: """ - Performs a DELETE request against the /finance/agreements/types/{id} endpoint. + Performs a GET request against the /finance/agreements/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AgreementType: """ - Performs a PUT request against the /finance/agreements/types/{id} endpoint. + Performs a PATCH request against the /finance/agreements/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +85,11 @@ def put( Returns: AgreementType: The parsed response data. """ - return self._parse_one( - AgreementType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(AgreementType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementType: """ - Performs a PATCH request against the /finance/agreements/types/{id} endpoint. + Performs a PUT request against the /finance/agreements/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,7 +97,4 @@ def patch( Returns: AgreementType: The parsed response data. """ - return self._parse_one( - AgreementType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdInfoEndpoint.py index f0ea83554..a40578a3c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AgreementTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsTypesIdInfoEndpoint( IGettable[AgreementTypeInfo, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementTypeInfo) IPaginateable.__init__(self, AgreementTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeInfo]: """ Performs a GET request against the /finance/agreements/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AgreementTypeInfo: """ Performs a GET request against the /finance/agreements/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: AgreementTypeInfo: The parsed response data. """ - return self._parse_one( - AgreementTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesEndpoint.py index 9f371a8bc..402d896f2 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsTypesIdUsagesListEndpoint import ( FinanceAgreementsTypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class FinanceAgreementsTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/agreements/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/agreements/types/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesListEndpoint.py index aedeb06f2..b394a2770 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/agreements/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/agreements/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoCountEndpoint.py index df246242d..92c3af756 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementsTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreements/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreements/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoEndpoint.py index 846ff3c03..13ded292a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementsTypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementsTypesInfoCountEndpoint import ( FinanceAgreementsTypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AgreementTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementsTypesInfoEndpoint( @@ -19,10 +18,8 @@ class FinanceAgreementsTypesInfoEndpoint( IGettable[list[AgreementTypeInfo], ConnectWiseManageRequestParams], IPaginateable[AgreementTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementTypeInfo]) IPaginateable.__init__(self, AgreementTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeInfo]: """ Performs a GET request against the /finance/agreements/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementTypeInfo]: """ Performs a GET request against the /finance/agreements/types/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[AgreementTypeInfo]: The parsed response data. """ - return self._parse_many( - AgreementTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AgreementTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesEndpoint.py index b6db2718b..90348bfc5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdEndpoint import ( - FinanceAgreementtypesIdEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdEndpoint import FinanceAgreementtypesIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "agreementTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "agreementTypes", parent_endpoint=parent_endpoint) - def id(self, id: int) -> FinanceAgreementtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementtypesIdEndpoint: The initialized FinanceAgreementtypesIdEndpoint object. """ child = FinanceAgreementtypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsCountEndpoint.py index 8b9c1fde7..174867aa7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdBoarddefaultsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdBoarddefaultsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreementTypes/{id}/boardDefaults/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreementTypes/{id}/boardDefaults/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsEndpoint.py index fff936e14..69a9d7410 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdBoarddefaultsCountEndpoint import ( FinanceAgreementtypesIdBoarddefaultsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdBoarddefaultsIdEndpoint import ( FinanceAgreementtypesIdBoarddefaultsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementTypeBoardDefault from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdBoarddefaultsEndpoint( @@ -24,42 +22,31 @@ class FinanceAgreementtypesIdBoarddefaultsEndpoint( IPostable[AgreementTypeBoardDefault, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeBoardDefault, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "boardDefaults", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "boardDefaults", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementTypeBoardDefault]) IPostable.__init__(self, AgreementTypeBoardDefault) IPaginateable.__init__(self, AgreementTypeBoardDefault) self.count = self._register_child_endpoint( - FinanceAgreementtypesIdBoarddefaultsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAgreementtypesIdBoarddefaultsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementtypesIdBoarddefaultsIdEndpoint: + def id(self, _id: int) -> FinanceAgreementtypesIdBoarddefaultsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementtypesIdBoarddefaultsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementtypesIdBoarddefaultsIdEndpoint: The initialized FinanceAgreementtypesIdBoarddefaultsIdEndpoint object. """ - child = FinanceAgreementtypesIdBoarddefaultsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementtypesIdBoarddefaultsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeBoardDefault]: """ Performs a GET request against the /finance/agreementTypes/{id}/boardDefaults endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeBoardDefault, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeBoardDefault, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementTypeBoardDefault]: """ Performs a GET request against the /finance/agreementTypes/{id}/boardDefaults endpoint. @@ -100,14 +80,11 @@ def get( list[AgreementTypeBoardDefault]: The parsed response data. """ return self._parse_many( - AgreementTypeBoardDefault, - super()._make_request("GET", data=data, params=params).json(), + AgreementTypeBoardDefault, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeBoardDefault: """ Performs a POST request against the /finance/agreementTypes/{id}/boardDefaults endpoint. @@ -119,6 +96,5 @@ def post( AgreementTypeBoardDefault: The parsed response data. """ return self._parse_one( - AgreementTypeBoardDefault, - super()._make_request("POST", data=data, params=params).json(), + AgreementTypeBoardDefault, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsIdEndpoint.py index 584323c4c..42e550dc7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdBoarddefaultsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementTypeBoardDefault from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdBoarddefaultsIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementTypeBoardDefault, ConnectWiseManageRequestParams], - IPuttable[AgreementTypeBoardDefault, ConnectWiseManageRequestParams], IPatchable[AgreementTypeBoardDefault, ConnectWiseManageRequestParams], + IPuttable[AgreementTypeBoardDefault, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeBoardDefault, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementTypeBoardDefault) - IPuttable.__init__(self, AgreementTypeBoardDefault) IPatchable.__init__(self, AgreementTypeBoardDefault) + IPuttable.__init__(self, AgreementTypeBoardDefault) IPaginateable.__init__(self, AgreementTypeBoardDefault) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeBoardDefault]: """ Performs a GET request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeBoardDefault, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeBoardDefault, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementTypeBoardDefault: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. + Performs a DELETE request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementTypeBoardDefault: The parsed response data. """ - return self._parse_one( - AgreementTypeBoardDefault, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> AgreementTypeBoardDefault: """ - Performs a DELETE request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. + Performs a GET request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementTypeBoardDefault: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementTypeBoardDefault, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeBoardDefault: """ - Performs a PUT request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. + Performs a PATCH request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +83,14 @@ def put( AgreementTypeBoardDefault: The parsed response data. """ return self._parse_one( - AgreementTypeBoardDefault, - super()._make_request("PUT", data=data, params=params).json(), + AgreementTypeBoardDefault, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeBoardDefault: """ - Performs a PATCH request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. + Performs a PUT request against the /finance/agreementTypes/{id}/boardDefaults/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +98,4 @@ def patch( Returns: AgreementTypeBoardDefault: The parsed response data. """ - return self._parse_one( - AgreementTypeBoardDefault, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeBoardDefault, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdEndpoint.py index 8067ce009..55891dd52 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdBoarddefaultsEndpoint import ( FinanceAgreementtypesIdBoarddefaultsEndpoint, @@ -15,29 +17,26 @@ FinanceAgreementtypesIdWorktypesEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class FinanceAgreementtypesIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.workroles = self._register_child_endpoint( - FinanceAgreementtypesIdWorkrolesEndpoint(client, parent_endpoint=self) - ) self.board_defaults = self._register_child_endpoint( FinanceAgreementtypesIdBoarddefaultsEndpoint(client, parent_endpoint=self) ) self.work_role_exclusions = self._register_child_endpoint( - FinanceAgreementtypesIdWorkroleexclusionsEndpoint( - client, parent_endpoint=self - ) + FinanceAgreementtypesIdWorkroleexclusionsEndpoint(client, parent_endpoint=self) + ) + self.work_type_exclusions = self._register_child_endpoint( + FinanceAgreementtypesIdWorktypeexclusionsEndpoint(client, parent_endpoint=self) + ) + self.workroles = self._register_child_endpoint( + FinanceAgreementtypesIdWorkrolesEndpoint(client, parent_endpoint=self) ) self.worktypes = self._register_child_endpoint( FinanceAgreementtypesIdWorktypesEndpoint(client, parent_endpoint=self) ) - self.work_type_exclusions = self._register_child_endpoint( - FinanceAgreementtypesIdWorktypeexclusionsEndpoint( - client, parent_endpoint=self - ) - ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint.py index fbfb59367..37fb157a7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreementTypes/{id}/workRoleExclusions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreementTypes/{id}/workRoleExclusions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsEndpoint.py index 2a6c78a00..22e1d8449 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint import ( FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint import ( FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementTypeWorkRoleExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkroleexclusionsEndpoint( @@ -24,42 +22,31 @@ class FinanceAgreementtypesIdWorkroleexclusionsEndpoint( IPostable[AgreementTypeWorkRoleExclusion, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkRoleExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workRoleExclusions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workRoleExclusions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementTypeWorkRoleExclusion]) IPostable.__init__(self, AgreementTypeWorkRoleExclusion) IPaginateable.__init__(self, AgreementTypeWorkRoleExclusion) self.count = self._register_child_endpoint( - FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAgreementtypesIdWorkroleexclusionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint: + def id(self, _id: int) -> FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint: The initialized FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint object. """ - child = FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkRoleExclusion]: """ Performs a GET request against the /finance/agreementTypes/{id}/workRoleExclusions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkRoleExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkRoleExclusion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementTypeWorkRoleExclusion]: """ Performs a GET request against the /finance/agreementTypes/{id}/workRoleExclusions endpoint. @@ -100,14 +80,11 @@ def get( list[AgreementTypeWorkRoleExclusion]: The parsed response data. """ return self._parse_many( - AgreementTypeWorkRoleExclusion, - super()._make_request("GET", data=data, params=params).json(), + AgreementTypeWorkRoleExclusion, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkRoleExclusion: """ Performs a POST request against the /finance/agreementTypes/{id}/workRoleExclusions endpoint. @@ -119,6 +96,5 @@ def post( AgreementTypeWorkRoleExclusion: The parsed response data. """ return self._parse_one( - AgreementTypeWorkRoleExclusion, - super()._make_request("POST", data=data, params=params).json(), + AgreementTypeWorkRoleExclusion, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint.py index e74037a84..a130ae28c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AgreementTypeWorkRoleExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorkroleexclusionsIdEndpoint( IGettable[AgreementTypeWorkRoleExclusion, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkRoleExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementTypeWorkRoleExclusion) IPaginateable.__init__(self, AgreementTypeWorkRoleExclusion) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkRoleExclusion]: """ Performs a GET request against the /finance/agreementTypes/{id}/workRoleExclusions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,31 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkRoleExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkRoleExclusion, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementTypeWorkRoleExclusion: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreementTypes/{id}/workRoleExclusions/{id} endpoint. + Performs a DELETE request against the /finance/agreementTypes/{id}/workRoleExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementTypeWorkRoleExclusion: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkRoleExclusion, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> AgreementTypeWorkRoleExclusion: """ - Performs a DELETE request against the /finance/agreementTypes/{id}/workRoleExclusions/{id} endpoint. + Performs a GET request against the /finance/agreementTypes/{id}/workRoleExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementTypeWorkRoleExclusion: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + AgreementTypeWorkRoleExclusion, super()._make_request("GET", data=data, params=params).json() + ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesCountEndpoint.py index 56e8dcba5..74413a94d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkrolesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorkrolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesEndpoint.py index 00209225e..bc691c83c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorkrolesCountEndpoint import ( FinanceAgreementtypesIdWorkrolesCountEndpoint, @@ -8,17 +10,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorkrolesInfoEndpoint import ( FinanceAgreementtypesIdWorkrolesInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementTypeWorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkrolesEndpoint( @@ -27,10 +25,8 @@ class FinanceAgreementtypesIdWorkrolesEndpoint( IPostable[AgreementTypeWorkRole, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workroles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workroles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementTypeWorkRole]) IPostable.__init__(self, AgreementTypeWorkRole) IPaginateable.__init__(self, AgreementTypeWorkRole) @@ -42,26 +38,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementtypesIdWorkrolesInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementtypesIdWorkrolesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementtypesIdWorkrolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementtypesIdWorkrolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementtypesIdWorkrolesIdEndpoint: The initialized FinanceAgreementtypesIdWorkrolesIdEndpoint object. """ - child = FinanceAgreementtypesIdWorkrolesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementtypesIdWorkrolesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkRole]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles endpoint and returns an initialized PaginatedResponse object. @@ -79,18 +70,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkRole, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementTypeWorkRole]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles endpoint. @@ -101,15 +85,10 @@ def get( Returns: list[AgreementTypeWorkRole]: The parsed response data. """ - return self._parse_many( - AgreementTypeWorkRole, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AgreementTypeWorkRole, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkRole: """ Performs a POST request against the /finance/agreementTypes/{id}/workroles endpoint. @@ -120,7 +99,4 @@ def post( Returns: AgreementTypeWorkRole: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkRole, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeWorkRole, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesIdEndpoint.py index a54bb5130..06ca39a4b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementTypeWorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkrolesIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementTypeWorkRole, ConnectWiseManageRequestParams], - IPuttable[AgreementTypeWorkRole, ConnectWiseManageRequestParams], IPatchable[AgreementTypeWorkRole, ConnectWiseManageRequestParams], + IPuttable[AgreementTypeWorkRole, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementTypeWorkRole) - IPuttable.__init__(self, AgreementTypeWorkRole) IPatchable.__init__(self, AgreementTypeWorkRole) + IPuttable.__init__(self, AgreementTypeWorkRole) IPaginateable.__init__(self, AgreementTypeWorkRole) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkRole]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkRole, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementTypeWorkRole: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. + Performs a DELETE request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementTypeWorkRole: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkRole, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> AgreementTypeWorkRole: """ - Performs a DELETE request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. + Performs a GET request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementTypeWorkRole: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementTypeWorkRole, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkRole: """ - Performs a PUT request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. + Performs a PATCH request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: AgreementTypeWorkRole: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkRole, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeWorkRole, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkRole: """ - Performs a PATCH request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. + Performs a PUT request against the /finance/agreementTypes/{id}/workroles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: AgreementTypeWorkRole: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkRole, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeWorkRole, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoCountEndpoint.py index 9a5475f06..90ef0f65b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkrolesInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorkrolesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoEndpoint.py index dc68bc868..a7e897fa3 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorkrolesInfoCountEndpoint import ( FinanceAgreementtypesIdWorkrolesInfoCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorkrolesInfoIdEndpoint import ( FinanceAgreementtypesIdWorkrolesInfoIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AgreementTypeWorkRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkrolesInfoEndpoint( @@ -22,41 +21,30 @@ class FinanceAgreementtypesIdWorkrolesInfoEndpoint( IGettable[list[AgreementTypeWorkRoleInfo], ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementTypeWorkRoleInfo]) IPaginateable.__init__(self, AgreementTypeWorkRoleInfo) self.count = self._register_child_endpoint( - FinanceAgreementtypesIdWorkrolesInfoCountEndpoint( - client, parent_endpoint=self - ) + FinanceAgreementtypesIdWorkrolesInfoCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementtypesIdWorkrolesInfoIdEndpoint: + def id(self, _id: int) -> FinanceAgreementtypesIdWorkrolesInfoIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementtypesIdWorkrolesInfoIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementtypesIdWorkrolesInfoIdEndpoint: The initialized FinanceAgreementtypesIdWorkrolesInfoIdEndpoint object. """ - child = FinanceAgreementtypesIdWorkrolesInfoIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementtypesIdWorkrolesInfoIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkRoleInfo]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/info endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkRoleInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementTypeWorkRoleInfo]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/info endpoint. @@ -97,6 +78,5 @@ def get( list[AgreementTypeWorkRoleInfo]: The parsed response data. """ return self._parse_many( - AgreementTypeWorkRoleInfo, - super()._make_request("GET", data=data, params=params).json(), + AgreementTypeWorkRoleInfo, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoIdEndpoint.py index b53c10023..61b4adfc9 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorkrolesInfoIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AgreementTypeWorkRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorkrolesInfoIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorkrolesInfoIdEndpoint( IGettable[AgreementTypeWorkRoleInfo, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementTypeWorkRoleInfo) IPaginateable.__init__(self, AgreementTypeWorkRoleInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkRoleInfo]: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/info/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkRoleInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkRoleInfo: """ Performs a GET request against the /finance/agreementTypes/{id}/workroles/info/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: AgreementTypeWorkRoleInfo: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkRoleInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeWorkRoleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint.py index 6aefff54b..5912f9d82 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreementTypes/{id}/workTypeExclusions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreementTypes/{id}/workTypeExclusions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsEndpoint.py index 5bc02261e..9fe0a341c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint import ( FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint import ( FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementTypeWorkTypeExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorktypeexclusionsEndpoint( @@ -24,42 +22,31 @@ class FinanceAgreementtypesIdWorktypeexclusionsEndpoint( IPostable[AgreementTypeWorkTypeExclusion, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkTypeExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workTypeExclusions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workTypeExclusions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementTypeWorkTypeExclusion]) IPostable.__init__(self, AgreementTypeWorkTypeExclusion) IPaginateable.__init__(self, AgreementTypeWorkTypeExclusion) self.count = self._register_child_endpoint( - FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint( - client, parent_endpoint=self - ) + FinanceAgreementtypesIdWorktypeexclusionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint: + def id(self, _id: int) -> FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint: The initialized FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint object. """ - child = FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkTypeExclusion]: """ Performs a GET request against the /finance/agreementTypes/{id}/workTypeExclusions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkTypeExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkTypeExclusion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementTypeWorkTypeExclusion]: """ Performs a GET request against the /finance/agreementTypes/{id}/workTypeExclusions endpoint. @@ -100,14 +80,11 @@ def get( list[AgreementTypeWorkTypeExclusion]: The parsed response data. """ return self._parse_many( - AgreementTypeWorkTypeExclusion, - super()._make_request("GET", data=data, params=params).json(), + AgreementTypeWorkTypeExclusion, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkTypeExclusion: """ Performs a POST request against the /finance/agreementTypes/{id}/workTypeExclusions endpoint. @@ -119,6 +96,5 @@ def post( AgreementTypeWorkTypeExclusion: The parsed response data. """ return self._parse_one( - AgreementTypeWorkTypeExclusion, - super()._make_request("POST", data=data, params=params).json(), + AgreementTypeWorkTypeExclusion, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint.py index da9ca09d3..bafb1c0a0 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AgreementTypeWorkTypeExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorktypeexclusionsIdEndpoint( IGettable[AgreementTypeWorkTypeExclusion, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkTypeExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementTypeWorkTypeExclusion) IPaginateable.__init__(self, AgreementTypeWorkTypeExclusion) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkTypeExclusion]: """ Performs a GET request against the /finance/agreementTypes/{id}/workTypeExclusions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,31 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkTypeExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkTypeExclusion, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementTypeWorkTypeExclusion: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreementTypes/{id}/workTypeExclusions/{id} endpoint. + Performs a DELETE request against the /finance/agreementTypes/{id}/workTypeExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementTypeWorkTypeExclusion: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkTypeExclusion, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> AgreementTypeWorkTypeExclusion: """ - Performs a DELETE request against the /finance/agreementTypes/{id}/workTypeExclusions/{id} endpoint. + Performs a GET request against the /finance/agreementTypes/{id}/workTypeExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementTypeWorkTypeExclusion: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + AgreementTypeWorkTypeExclusion, super()._make_request("GET", data=data, params=params).json() + ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesCountEndpoint.py index 03c7f81a8..4d7e5b97a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorktypesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceAgreementtypesIdWorktypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/agreementTypes/{id}/worktypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/agreementTypes/{id}/worktypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesEndpoint.py index af0e95285..44e05a5a5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorktypesCountEndpoint import ( FinanceAgreementtypesIdWorktypesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceAgreementtypesIdWorktypesIdEndpoint import ( FinanceAgreementtypesIdWorktypesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AgreementTypeWorkType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorktypesEndpoint( @@ -24,10 +22,8 @@ class FinanceAgreementtypesIdWorktypesEndpoint( IPostable[AgreementTypeWorkType, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "worktypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "worktypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementTypeWorkType]) IPostable.__init__(self, AgreementTypeWorkType) IPaginateable.__init__(self, AgreementTypeWorkType) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceAgreementtypesIdWorktypesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceAgreementtypesIdWorktypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceAgreementtypesIdWorktypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceAgreementtypesIdWorktypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceAgreementtypesIdWorktypesIdEndpoint: The initialized FinanceAgreementtypesIdWorktypesIdEndpoint object. """ - child = FinanceAgreementtypesIdWorktypesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceAgreementtypesIdWorktypesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkType]: """ Performs a GET request against the /finance/agreementTypes/{id}/worktypes endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementTypeWorkType]: """ Performs a GET request against the /finance/agreementTypes/{id}/worktypes endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[AgreementTypeWorkType]: The parsed response data. """ - return self._parse_many( - AgreementTypeWorkType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AgreementTypeWorkType, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkType: """ Performs a POST request against the /finance/agreementTypes/{id}/worktypes endpoint. @@ -114,7 +93,4 @@ def post( Returns: AgreementTypeWorkType: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeWorkType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesIdEndpoint.py index 066f95366..fc8f2404c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceAgreementtypesIdWorktypesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementTypeWorkType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceAgreementtypesIdWorktypesIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementTypeWorkType, ConnectWiseManageRequestParams], - IPuttable[AgreementTypeWorkType, ConnectWiseManageRequestParams], IPatchable[AgreementTypeWorkType, ConnectWiseManageRequestParams], + IPuttable[AgreementTypeWorkType, ConnectWiseManageRequestParams], IPaginateable[AgreementTypeWorkType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementTypeWorkType) - IPuttable.__init__(self, AgreementTypeWorkType) IPatchable.__init__(self, AgreementTypeWorkType) + IPuttable.__init__(self, AgreementTypeWorkType) IPaginateable.__init__(self, AgreementTypeWorkType) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementTypeWorkType]: """ Performs a GET request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementTypeWorkType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementTypeWorkType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AgreementTypeWorkType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. + Performs a DELETE request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AgreementTypeWorkType: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> AgreementTypeWorkType: """ - Performs a DELETE request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. + Performs a GET request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AgreementTypeWorkType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AgreementTypeWorkType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkType: """ - Performs a PUT request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. + Performs a PATCH request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: AgreementTypeWorkType: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeWorkType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementTypeWorkType: """ - Performs a PATCH request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. + Performs a PUT request against the /finance/agreementTypes/{id}/worktypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: AgreementTypeWorkType: The parsed response data. """ - return self._parse_one( - AgreementTypeWorkType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementTypeWorkType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsCountEndpoint.py index 6f5a987f9..442a6b217 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBatchsetupsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBatchsetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/batchSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/batchSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsEndpoint.py index 1d5eda90c..e38db8268 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBatchsetupsCountEndpoint import ( - FinanceBatchsetupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBatchsetupsIdEndpoint import ( - FinanceBatchsetupsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceBatchsetupsCountEndpoint import FinanceBatchsetupsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceBatchsetupsIdEndpoint import FinanceBatchsetupsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AgreementBatchSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBatchsetupsEndpoint( @@ -22,35 +17,28 @@ class FinanceBatchsetupsEndpoint( IGettable[list[AgreementBatchSetup], ConnectWiseManageRequestParams], IPaginateable[AgreementBatchSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "batchSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "batchSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AgreementBatchSetup]) IPaginateable.__init__(self, AgreementBatchSetup) - self.count = self._register_child_endpoint( - FinanceBatchsetupsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceBatchsetupsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceBatchsetupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceBatchsetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceBatchsetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceBatchsetupsIdEndpoint: The initialized FinanceBatchsetupsIdEndpoint object. """ child = FinanceBatchsetupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementBatchSetup]: """ Performs a GET request against the /finance/batchSetups endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementBatchSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementBatchSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AgreementBatchSetup]: """ Performs a GET request against the /finance/batchSetups endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[AgreementBatchSetup]: The parsed response data. """ - return self._parse_many( - AgreementBatchSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AgreementBatchSetup, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsIdEndpoint.py index c7e41ed54..3b7a9cd30 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBatchsetupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AgreementBatchSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBatchsetupsIdEndpoint( ConnectWiseEndpoint, IGettable[AgreementBatchSetup, ConnectWiseManageRequestParams], - IPuttable[AgreementBatchSetup, ConnectWiseManageRequestParams], IPatchable[AgreementBatchSetup, ConnectWiseManageRequestParams], + IPuttable[AgreementBatchSetup, ConnectWiseManageRequestParams], IPaginateable[AgreementBatchSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AgreementBatchSetup) - IPuttable.__init__(self, AgreementBatchSetup) IPatchable.__init__(self, AgreementBatchSetup) + IPuttable.__init__(self, AgreementBatchSetup) IPaginateable.__init__(self, AgreementBatchSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AgreementBatchSetup]: """ Performs a GET request against the /finance/batchSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AgreementBatchSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AgreementBatchSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementBatchSetup: """ Performs a GET request against the /finance/batchSetups/{id} endpoint. @@ -74,18 +58,13 @@ def get( Returns: AgreementBatchSetup: The parsed response data. """ - return self._parse_one( - AgreementBatchSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(AgreementBatchSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> AgreementBatchSetup: """ - Performs a PUT request against the /finance/batchSetups/{id} endpoint. + Performs a PATCH request against the /finance/batchSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +72,13 @@ def put( Returns: AgreementBatchSetup: The parsed response data. """ - return self._parse_one( - AgreementBatchSetup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AgreementBatchSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> AgreementBatchSetup: """ - Performs a PATCH request against the /finance/batchSetups/{id} endpoint. + Performs a PUT request against the /finance/batchSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +86,4 @@ def patch( Returns: AgreementBatchSetup: The parsed response data. """ - return self._parse_one( - AgreementBatchSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AgreementBatchSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesCountEndpoint.py index 58aad1daf..0a52f965c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingcyclesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingCycles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingCycles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesEndpoint.py index a60f4731d..b5d1ab693 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingcyclesCountEndpoint import ( - FinanceBillingcyclesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingcyclesIdEndpoint import ( - FinanceBillingcyclesIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingcyclesInfoEndpoint import ( - FinanceBillingcyclesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceBillingcyclesCountEndpoint import FinanceBillingcyclesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingcyclesIdEndpoint import FinanceBillingcyclesIdEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingcyclesInfoEndpoint import FinanceBillingcyclesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BillingCycle from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesEndpoint( @@ -27,39 +19,30 @@ class FinanceBillingcyclesEndpoint( IPostable[BillingCycle, ConnectWiseManageRequestParams], IPaginateable[BillingCycle, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingCycles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "billingCycles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingCycle]) IPostable.__init__(self, BillingCycle) IPaginateable.__init__(self, BillingCycle) - self.count = self._register_child_endpoint( - FinanceBillingcyclesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceBillingcyclesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceBillingcyclesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceBillingcyclesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceBillingcyclesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceBillingcyclesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceBillingcyclesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceBillingcyclesIdEndpoint: The initialized FinanceBillingcyclesIdEndpoint object. """ child = FinanceBillingcyclesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingCycle]: """ Performs a GET request against the /finance/billingCycles endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingCycle, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingCycle, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BillingCycle]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BillingCycle]: """ Performs a GET request against the /finance/billingCycles endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[BillingCycle]: The parsed response data. """ - return self._parse_many( - BillingCycle, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BillingCycle, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingCycle: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingCycle: """ Performs a POST request against the /finance/billingCycles endpoint. @@ -117,6 +85,4 @@ def post( Returns: BillingCycle: The parsed response data. """ - return self._parse_one( - BillingCycle, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BillingCycle, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdEndpoint.py index ece408220..0730f68ae 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingcyclesIdInfoEndpoint import ( - FinanceBillingcyclesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingcyclesIdUsagesEndpoint import ( - FinanceBillingcyclesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceBillingcyclesIdInfoEndpoint import FinanceBillingcyclesIdInfoEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingcyclesIdUsagesEndpoint import FinanceBillingcyclesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BillingCycle from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesIdEndpoint( ConnectWiseEndpoint, IGettable[BillingCycle, ConnectWiseManageRequestParams], - IPuttable[BillingCycle, ConnectWiseManageRequestParams], IPatchable[BillingCycle, ConnectWiseManageRequestParams], + IPuttable[BillingCycle, ConnectWiseManageRequestParams], IPaginateable[BillingCycle, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingCycle) - IPuttable.__init__(self, BillingCycle) IPatchable.__init__(self, BillingCycle) + IPuttable.__init__(self, BillingCycle) IPaginateable.__init__(self, BillingCycle) - self.usages = self._register_child_endpoint( - FinanceBillingcyclesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceBillingcyclesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(FinanceBillingcyclesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(FinanceBillingcyclesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingCycle]: """ Performs a GET request against the /finance/billingCycles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingCycle, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingCycle, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingCycle: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/billingCycles/{id} endpoint. + Performs a DELETE request against the /finance/billingCycles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BillingCycle: The parsed response data. """ - return self._parse_one( - BillingCycle, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingCycle: """ - Performs a DELETE request against the /finance/billingCycles/{id} endpoint. + Performs a GET request against the /finance/billingCycles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BillingCycle: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BillingCycle, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingCycle: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BillingCycle: """ - Performs a PUT request against the /finance/billingCycles/{id} endpoint. + Performs a PATCH request against the /finance/billingCycles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +83,11 @@ def put( Returns: BillingCycle: The parsed response data. """ - return self._parse_one( - BillingCycle, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BillingCycle, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingCycle: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingCycle: """ - Performs a PATCH request against the /finance/billingCycles/{id} endpoint. + Performs a PUT request against the /finance/billingCycles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,7 +95,4 @@ def patch( Returns: BillingCycle: The parsed response data. """ - return self._parse_one( - BillingCycle, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BillingCycle, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdInfoEndpoint.py index db5d28e06..744264d18 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingCycleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingcyclesIdInfoEndpoint( IGettable[BillingCycleInfo, ConnectWiseManageRequestParams], IPaginateable[BillingCycleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingCycleInfo) IPaginateable.__init__(self, BillingCycleInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingCycleInfo]: """ Performs a GET request against the /finance/billingCycles/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingCycleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingCycleInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingCycleInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingCycleInfo: """ Performs a GET request against the /finance/billingCycles/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: BillingCycleInfo: The parsed response data. """ - return self._parse_one( - BillingCycleInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(BillingCycleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesEndpoint.py index 93ec36fb0..e719a248d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceBillingcyclesIdUsagesListEndpoint import ( FinanceBillingcyclesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class FinanceBillingcyclesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/billingCycles/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/billingCycles/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesListEndpoint.py index 31eb17e96..3ffc9e865 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingcyclesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/billingCycles/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/billingCycles/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoCountEndpoint.py index 5b39eda41..837d22a5d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingcyclesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingCycles/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingCycles/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoEndpoint.py index 7039cf1c7..7453257b4 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingcyclesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingcyclesInfoCountEndpoint import ( - FinanceBillingcyclesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceBillingcyclesInfoCountEndpoint import FinanceBillingcyclesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingCycleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingcyclesInfoEndpoint( @@ -19,22 +16,15 @@ class FinanceBillingcyclesInfoEndpoint( IGettable[list[BillingCycleInfo], ConnectWiseManageRequestParams], IPaginateable[BillingCycleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingCycleInfo]) IPaginateable.__init__(self, BillingCycleInfo) - self.count = self._register_child_endpoint( - FinanceBillingcyclesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceBillingcyclesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingCycleInfo]: """ Performs a GET request against the /finance/billingCycles/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingCycleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingCycleInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BillingCycleInfo]: """ Performs a GET request against the /finance/billingCycles/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[BillingCycleInfo]: The parsed response data. """ - return self._parse_many( - BillingCycleInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BillingCycleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsCountEndpoint.py index d79cb7c0d..df9b71cd8 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingsetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsEndpoint.py index fd7dd08c6..720f797fe 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingsetupsCountEndpoint import ( - FinanceBillingsetupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdEndpoint import ( - FinanceBillingsetupsIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingsetupsInfoEndpoint import ( - FinanceBillingsetupsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceBillingsetupsCountEndpoint import FinanceBillingsetupsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdEndpoint import FinanceBillingsetupsIdEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingsetupsInfoEndpoint import FinanceBillingsetupsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BillingSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsEndpoint( @@ -27,39 +19,30 @@ class FinanceBillingsetupsEndpoint( IPostable[BillingSetup, ConnectWiseManageRequestParams], IPaginateable[BillingSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "billingSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingSetup]) IPostable.__init__(self, BillingSetup) IPaginateable.__init__(self, BillingSetup) - self.count = self._register_child_endpoint( - FinanceBillingsetupsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceBillingsetupsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceBillingsetupsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceBillingsetupsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceBillingsetupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceBillingsetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceBillingsetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceBillingsetupsIdEndpoint: The initialized FinanceBillingsetupsIdEndpoint object. """ child = FinanceBillingsetupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingSetup]: """ Performs a GET request against the /finance/billingSetups endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BillingSetup]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BillingSetup]: """ Performs a GET request against the /finance/billingSetups endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[BillingSetup]: The parsed response data. """ - return self._parse_many( - BillingSetup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BillingSetup, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingSetup: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingSetup: """ Performs a POST request against the /finance/billingSetups endpoint. @@ -117,6 +85,4 @@ def post( Returns: BillingSetup: The parsed response data. """ - return self._parse_one( - BillingSetup, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BillingSetup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdEndpoint.py index 4701171e5..fad95f361 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdEndpoint.py @@ -1,53 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdInfoEndpoint import ( - FinanceBillingsetupsIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdRoutingsEndpoint import ( - FinanceBillingsetupsIdRoutingsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdInfoEndpoint import FinanceBillingsetupsIdInfoEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdRoutingsEndpoint import FinanceBillingsetupsIdRoutingsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BillingSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsIdEndpoint( ConnectWiseEndpoint, IGettable[BillingSetup, ConnectWiseManageRequestParams], - IPuttable[BillingSetup, ConnectWiseManageRequestParams], IPatchable[BillingSetup, ConnectWiseManageRequestParams], + IPuttable[BillingSetup, ConnectWiseManageRequestParams], IPaginateable[BillingSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingSetup) - IPuttable.__init__(self, BillingSetup) IPatchable.__init__(self, BillingSetup) + IPuttable.__init__(self, BillingSetup) IPaginateable.__init__(self, BillingSetup) + self.info = self._register_child_endpoint(FinanceBillingsetupsIdInfoEndpoint(client, parent_endpoint=self)) self.routings = self._register_child_endpoint( FinanceBillingsetupsIdRoutingsEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - FinanceBillingsetupsIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingSetup]: """ Performs a GET request against the /finance/billingSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingSetup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/billingSetups/{id} endpoint. + Performs a DELETE request against the /finance/billingSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BillingSetup: The parsed response data. """ - return self._parse_one( - BillingSetup, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingSetup: """ - Performs a DELETE request against the /finance/billingSetups/{id} endpoint. + Performs a GET request against the /finance/billingSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BillingSetup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BillingSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingSetup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BillingSetup: """ - Performs a PUT request against the /finance/billingSetups/{id} endpoint. + Performs a PATCH request against the /finance/billingSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +85,11 @@ def put( Returns: BillingSetup: The parsed response data. """ - return self._parse_one( - BillingSetup, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BillingSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingSetup: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingSetup: """ - Performs a PATCH request against the /finance/billingSetups/{id} endpoint. + Performs a PUT request against the /finance/billingSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,7 +97,4 @@ def patch( Returns: BillingSetup: The parsed response data. """ - return self._parse_one( - BillingSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BillingSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdInfoEndpoint.py index 1be989ace..f0de4f4f7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingSetupInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingsetupsIdInfoEndpoint( IGettable[BillingSetupInfo, ConnectWiseManageRequestParams], IPaginateable[BillingSetupInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingSetupInfo) IPaginateable.__init__(self, BillingSetupInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingSetupInfo]: """ Performs a GET request against the /finance/billingSetups/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingSetupInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingSetupInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingSetupInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingSetupInfo: """ Performs a GET request against the /finance/billingSetups/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: BillingSetupInfo: The parsed response data. """ - return self._parse_one( - BillingSetupInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(BillingSetupInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsCountEndpoint.py index 3054c8058..291ca2b7c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsIdRoutingsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingsetupsIdRoutingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingSetups/{id}/routings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingSetups/{id}/routings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsEndpoint.py index 87d398823..49c6cc16e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdRoutingsCountEndpoint import ( FinanceBillingsetupsIdRoutingsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceBillingsetupsIdRoutingsIdEndpoint import ( FinanceBillingsetupsIdRoutingsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BillingSetupRouting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsIdRoutingsEndpoint( @@ -24,10 +22,8 @@ class FinanceBillingsetupsIdRoutingsEndpoint( IPostable[BillingSetupRouting, ConnectWiseManageRequestParams], IPaginateable[BillingSetupRouting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "routings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "routings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingSetupRouting]) IPostable.__init__(self, BillingSetupRouting) IPaginateable.__init__(self, BillingSetupRouting) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceBillingsetupsIdRoutingsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceBillingsetupsIdRoutingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceBillingsetupsIdRoutingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceBillingsetupsIdRoutingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceBillingsetupsIdRoutingsIdEndpoint: The initialized FinanceBillingsetupsIdRoutingsIdEndpoint object. """ - child = FinanceBillingsetupsIdRoutingsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceBillingsetupsIdRoutingsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingSetupRouting]: """ Performs a GET request against the /finance/billingSetups/{id}/routings endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingSetupRouting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingSetupRouting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BillingSetupRouting]: """ Performs a GET request against the /finance/billingSetups/{id}/routings endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[BillingSetupRouting]: The parsed response data. """ - return self._parse_many( - BillingSetupRouting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BillingSetupRouting, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BillingSetupRouting: """ Performs a POST request against the /finance/billingSetups/{id}/routings endpoint. @@ -114,7 +93,4 @@ def post( Returns: BillingSetupRouting: The parsed response data. """ - return self._parse_one( - BillingSetupRouting, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BillingSetupRouting, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsIdEndpoint.py index a50773b9f..fba3976ba 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsIdRoutingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BillingSetupRouting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsIdRoutingsIdEndpoint( ConnectWiseEndpoint, IGettable[BillingSetupRouting, ConnectWiseManageRequestParams], - IPuttable[BillingSetupRouting, ConnectWiseManageRequestParams], IPatchable[BillingSetupRouting, ConnectWiseManageRequestParams], + IPuttable[BillingSetupRouting, ConnectWiseManageRequestParams], IPaginateable[BillingSetupRouting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingSetupRouting) - IPuttable.__init__(self, BillingSetupRouting) IPatchable.__init__(self, BillingSetupRouting) + IPuttable.__init__(self, BillingSetupRouting) IPaginateable.__init__(self, BillingSetupRouting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingSetupRouting]: """ Performs a GET request against the /finance/billingSetups/{id}/routings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingSetupRouting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingSetupRouting, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingSetupRouting: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/billingSetups/{id}/routings/{id} endpoint. + Performs a DELETE request against the /finance/billingSetups/{id}/routings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BillingSetupRouting: The parsed response data. """ - return self._parse_one( - BillingSetupRouting, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> BillingSetupRouting: """ - Performs a DELETE request against the /finance/billingSetups/{id}/routings/{id} endpoint. + Performs a GET request against the /finance/billingSetups/{id}/routings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BillingSetupRouting: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BillingSetupRouting, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> BillingSetupRouting: """ - Performs a PUT request against the /finance/billingSetups/{id}/routings/{id} endpoint. + Performs a PATCH request against the /finance/billingSetups/{id}/routings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: BillingSetupRouting: The parsed response data. """ - return self._parse_one( - BillingSetupRouting, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(BillingSetupRouting, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BillingSetupRouting: """ - Performs a PATCH request against the /finance/billingSetups/{id}/routings/{id} endpoint. + Performs a PUT request against the /finance/billingSetups/{id}/routings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: BillingSetupRouting: The parsed response data. """ - return self._parse_one( - BillingSetupRouting, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BillingSetupRouting, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsInfoEndpoint.py index d5552e4a7..ddae948f9 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingsetupsInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingSetupInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingsetupsInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingsetupsInfoEndpoint( IGettable[list[BillingSetupInfo], ConnectWiseManageRequestParams], IPaginateable[BillingSetupInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingSetupInfo]) IPaginateable.__init__(self, BillingSetupInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingSetupInfo]: """ Performs a GET request against the /finance/billingSetups/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingSetupInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingSetupInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BillingSetupInfo]: """ Performs a GET request against the /finance/billingSetups/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[BillingSetupInfo]: The parsed response data. """ - return self._parse_many( - BillingSetupInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BillingSetupInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesCountEndpoint.py index 99f85fb06..28f878b83 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingstatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingStatuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingStatuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesEndpoint.py index 9595b1539..2af970e40 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingstatusesCountEndpoint import ( - FinanceBillingstatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingstatusesIdEndpoint import ( - FinanceBillingstatusesIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingstatusesInfoEndpoint import ( - FinanceBillingstatusesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceBillingstatusesCountEndpoint import FinanceBillingstatusesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingstatusesIdEndpoint import FinanceBillingstatusesIdEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingstatusesInfoEndpoint import FinanceBillingstatusesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BillingStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesEndpoint( @@ -27,39 +19,30 @@ class FinanceBillingstatusesEndpoint( IPostable[BillingStatus, ConnectWiseManageRequestParams], IPaginateable[BillingStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingStatuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "billingStatuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingStatus]) IPostable.__init__(self, BillingStatus) IPaginateable.__init__(self, BillingStatus) - self.count = self._register_child_endpoint( - FinanceBillingstatusesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceBillingstatusesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceBillingstatusesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceBillingstatusesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceBillingstatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceBillingstatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceBillingstatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceBillingstatusesIdEndpoint: The initialized FinanceBillingstatusesIdEndpoint object. """ child = FinanceBillingstatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingStatus]: """ Performs a GET request against the /finance/billingStatuses endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BillingStatus]: """ Performs a GET request against the /finance/billingStatuses endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[BillingStatus]: The parsed response data. """ - return self._parse_many( - BillingStatus, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BillingStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingStatus: """ Performs a POST request against the /finance/billingStatuses endpoint. @@ -117,7 +87,4 @@ def post( Returns: BillingStatus: The parsed response data. """ - return self._parse_one( - BillingStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BillingStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdEndpoint.py index 66d540db2..6ae25d322 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdEndpoint.py @@ -1,53 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingstatusesIdInfoEndpoint import ( - FinanceBillingstatusesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingstatusesIdUsagesEndpoint import ( - FinanceBillingstatusesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceBillingstatusesIdInfoEndpoint import FinanceBillingstatusesIdInfoEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingstatusesIdUsagesEndpoint import FinanceBillingstatusesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BillingStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesIdEndpoint( ConnectWiseEndpoint, IGettable[BillingStatus, ConnectWiseManageRequestParams], - IPuttable[BillingStatus, ConnectWiseManageRequestParams], IPatchable[BillingStatus, ConnectWiseManageRequestParams], + IPuttable[BillingStatus, ConnectWiseManageRequestParams], IPaginateable[BillingStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingStatus) - IPuttable.__init__(self, BillingStatus) IPatchable.__init__(self, BillingStatus) + IPuttable.__init__(self, BillingStatus) IPaginateable.__init__(self, BillingStatus) + self.info = self._register_child_endpoint(FinanceBillingstatusesIdInfoEndpoint(client, parent_endpoint=self)) self.usages = self._register_child_endpoint( FinanceBillingstatusesIdUsagesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - FinanceBillingstatusesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingStatus]: """ Performs a GET request against the /finance/billingStatuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/billingStatuses/{id} endpoint. + Performs a DELETE request against the /finance/billingStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BillingStatus: The parsed response data. """ - return self._parse_one( - BillingStatus, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingStatus: """ - Performs a DELETE request against the /finance/billingStatuses/{id} endpoint. + Performs a GET request against the /finance/billingStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BillingStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BillingStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BillingStatus: """ - Performs a PUT request against the /finance/billingStatuses/{id} endpoint. + Performs a PATCH request against the /finance/billingStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +85,11 @@ def put( Returns: BillingStatus: The parsed response data. """ - return self._parse_one( - BillingStatus, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BillingStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingStatus: """ - Performs a PATCH request against the /finance/billingStatuses/{id} endpoint. + Performs a PUT request against the /finance/billingStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,7 +97,4 @@ def patch( Returns: BillingStatus: The parsed response data. """ - return self._parse_one( - BillingStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BillingStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdInfoEndpoint.py index 78bc75595..bf2d82186 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingstatusesIdInfoEndpoint( IGettable[BillingStatusInfo, ConnectWiseManageRequestParams], IPaginateable[BillingStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingStatusInfo) IPaginateable.__init__(self, BillingStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingStatusInfo]: """ Performs a GET request against the /finance/billingStatuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingStatusInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingStatusInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingStatusInfo: """ Performs a GET request against the /finance/billingStatuses/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: BillingStatusInfo: The parsed response data. """ - return self._parse_one( - BillingStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(BillingStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesEndpoint.py index 438e6ebaa..e60618e62 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceBillingstatusesIdUsagesListEndpoint import ( FinanceBillingstatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class FinanceBillingstatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/billingStatuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/billingStatuses/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesListEndpoint.py index abd716ae0..3df950c56 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingstatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/billingStatuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/billingStatuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoCountEndpoint.py index dd1b9cf57..303439d08 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingstatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingStatuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingStatuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoEndpoint.py index 955f2499c..3d0f6fe34 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingstatusesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceBillingstatusesInfoCountEndpoint import ( FinanceBillingstatusesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingstatusesInfoEndpoint( @@ -19,10 +18,8 @@ class FinanceBillingstatusesInfoEndpoint( IGettable[list[BillingStatusInfo], ConnectWiseManageRequestParams], IPaginateable[BillingStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingStatusInfo]) IPaginateable.__init__(self, BillingStatusInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingStatusInfo]: """ Performs a GET request against the /finance/billingStatuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BillingStatusInfo]: """ Performs a GET request against the /finance/billingStatuses/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[BillingStatusInfo]: The parsed response data. """ - return self._parse_many( - BillingStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BillingStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsCountEndpoint.py index 3aff1dc20..2e8e8fe54 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingtermsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingTerms/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingTerms/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsEndpoint.py index d5e02acc2..dcd8155db 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingtermsCountEndpoint import ( - FinanceBillingtermsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingtermsIdEndpoint import ( - FinanceBillingtermsIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingtermsInfoEndpoint import ( - FinanceBillingtermsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceBillingtermsCountEndpoint import FinanceBillingtermsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingtermsIdEndpoint import FinanceBillingtermsIdEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingtermsInfoEndpoint import FinanceBillingtermsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BillingTerm from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsEndpoint( @@ -27,39 +19,30 @@ class FinanceBillingtermsEndpoint( IPostable[BillingTerm, ConnectWiseManageRequestParams], IPaginateable[BillingTerm, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingTerms", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "billingTerms", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingTerm]) IPostable.__init__(self, BillingTerm) IPaginateable.__init__(self, BillingTerm) - self.count = self._register_child_endpoint( - FinanceBillingtermsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceBillingtermsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceBillingtermsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceBillingtermsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceBillingtermsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceBillingtermsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceBillingtermsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceBillingtermsIdEndpoint: The initialized FinanceBillingtermsIdEndpoint object. """ child = FinanceBillingtermsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingTerm]: """ Performs a GET request against the /finance/billingTerms endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingTerm, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingTerm, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BillingTerm]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BillingTerm]: """ Performs a GET request against the /finance/billingTerms endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[BillingTerm]: The parsed response data. """ - return self._parse_many( - BillingTerm, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BillingTerm, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingTerm: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingTerm: """ Performs a POST request against the /finance/billingTerms endpoint. @@ -117,6 +85,4 @@ def post( Returns: BillingTerm: The parsed response data. """ - return self._parse_one( - BillingTerm, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BillingTerm, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdEndpoint.py index a053d7b8c..290db39c8 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingtermsIdInfoEndpoint import ( - FinanceBillingtermsIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingtermsIdUsagesEndpoint import ( - FinanceBillingtermsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceBillingtermsIdInfoEndpoint import FinanceBillingtermsIdInfoEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingtermsIdUsagesEndpoint import FinanceBillingtermsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BillingTerm from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsIdEndpoint( ConnectWiseEndpoint, IGettable[BillingTerm, ConnectWiseManageRequestParams], - IPuttable[BillingTerm, ConnectWiseManageRequestParams], IPatchable[BillingTerm, ConnectWiseManageRequestParams], + IPuttable[BillingTerm, ConnectWiseManageRequestParams], IPaginateable[BillingTerm, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingTerm) - IPuttable.__init__(self, BillingTerm) IPatchable.__init__(self, BillingTerm) + IPuttable.__init__(self, BillingTerm) IPaginateable.__init__(self, BillingTerm) - self.usages = self._register_child_endpoint( - FinanceBillingtermsIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceBillingtermsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(FinanceBillingtermsIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(FinanceBillingtermsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingTerm]: """ Performs a GET request against the /finance/billingTerms/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingTerm, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingTerm, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingTerm: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/billingTerms/{id} endpoint. + Performs a DELETE request against the /finance/billingTerms/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BillingTerm: The parsed response data. """ - return self._parse_one( - BillingTerm, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingTerm: """ - Performs a DELETE request against the /finance/billingTerms/{id} endpoint. + Performs a GET request against the /finance/billingTerms/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BillingTerm: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BillingTerm, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingTerm: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BillingTerm: """ - Performs a PUT request against the /finance/billingTerms/{id} endpoint. + Performs a PATCH request against the /finance/billingTerms/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +83,11 @@ def put( Returns: BillingTerm: The parsed response data. """ - return self._parse_one( - BillingTerm, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BillingTerm, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingTerm: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingTerm: """ - Performs a PATCH request against the /finance/billingTerms/{id} endpoint. + Performs a PUT request against the /finance/billingTerms/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +95,4 @@ def patch( Returns: BillingTerm: The parsed response data. """ - return self._parse_one( - BillingTerm, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(BillingTerm, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdInfoEndpoint.py index 46eff399a..fc22a2888 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingTermInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingtermsIdInfoEndpoint( IGettable[BillingTermInfo, ConnectWiseManageRequestParams], IPaginateable[BillingTermInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, BillingTermInfo) IPaginateable.__init__(self, BillingTermInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingTermInfo]: """ Performs a GET request against the /finance/billingTerms/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingTermInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingTermInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BillingTermInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BillingTermInfo: """ Performs a GET request against the /finance/billingTerms/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: BillingTermInfo: The parsed response data. """ - return self._parse_one( - BillingTermInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(BillingTermInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesEndpoint.py index f976b63b8..2943e3f3e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceBillingtermsIdUsagesListEndpoint import ( FinanceBillingtermsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsIdUsagesEndpoint( @@ -19,22 +18,15 @@ class FinanceBillingtermsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - FinanceBillingtermsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(FinanceBillingtermsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/billingTerms/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +43,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/billingTerms/{id}/usages endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesListEndpoint.py index 0bfc6ab4b..9b471e5a5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingtermsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/billingTerms/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/billingTerms/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoCountEndpoint.py index 521da23e3..ea7b59656 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceBillingtermsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/billingTerms/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/billingTerms/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoEndpoint.py index c0a947f46..9a2aeed53 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceBillingtermsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceBillingtermsInfoCountEndpoint import ( - FinanceBillingtermsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceBillingtermsInfoCountEndpoint import FinanceBillingtermsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BillingTermInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceBillingtermsInfoEndpoint( @@ -19,22 +16,15 @@ class FinanceBillingtermsInfoEndpoint( IGettable[list[BillingTermInfo], ConnectWiseManageRequestParams], IPaginateable[BillingTermInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BillingTermInfo]) IPaginateable.__init__(self, BillingTermInfo) - self.count = self._register_child_endpoint( - FinanceBillingtermsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceBillingtermsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BillingTermInfo]: """ Performs a GET request against the /finance/billingTerms/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BillingTermInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BillingTermInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BillingTermInfo]: """ Performs a GET request against the /finance/billingTerms/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[BillingTermInfo]: The parsed response data. """ - return self._parse_many( - BillingTermInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BillingTermInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesEndpoint.py index 0c169b7de..7e387f119 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceClosedinvoicesIdEndpoint import ( - FinanceClosedinvoicesIdEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceClosedinvoicesIdEndpoint import FinanceClosedinvoicesIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceClosedinvoicesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "closedInvoices", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "closedInvoices", parent_endpoint=parent_endpoint) - def id(self, id: int) -> FinanceClosedinvoicesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceClosedinvoicesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceClosedinvoicesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceClosedinvoicesIdEndpoint: The initialized FinanceClosedinvoicesIdEndpoint object. """ child = FinanceClosedinvoicesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesIdEndpoint.py index 0f9f3073b..9d28482e4 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceClosedinvoicesIdEndpoint.py @@ -1,35 +1,27 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IPatchable, IPuttable from pyconnectwise.models.manage import ClosedInvoice -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceClosedinvoicesIdEndpoint( ConnectWiseEndpoint, - IPuttable[ClosedInvoice, ConnectWiseManageRequestParams], IPatchable[ClosedInvoice, ConnectWiseManageRequestParams], + IPuttable[ClosedInvoice, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - IPuttable.__init__(self, ClosedInvoice) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPatchable.__init__(self, ClosedInvoice) + IPuttable.__init__(self, ClosedInvoice) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ClosedInvoice: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ClosedInvoice: """ - Performs a PUT request against the /finance/closedInvoices/{id} endpoint. + Performs a PATCH request against the /finance/closedInvoices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -37,17 +29,11 @@ def put( Returns: ClosedInvoice: The parsed response data. """ - return self._parse_one( - ClosedInvoice, super()._make_request("PUT", data=data, params=params).json() - ) - - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ClosedInvoice: + return self._parse_one(ClosedInvoice, super()._make_request("PATCH", data=data, params=params).json()) + + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ClosedInvoice: """ - Performs a PATCH request against the /finance/closedInvoices/{id} endpoint. + Performs a PUT request against the /finance/closedInvoices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -55,7 +41,4 @@ def patch( Returns: ClosedInvoice: The parsed response data. """ - return self._parse_one( - ClosedInvoice, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ClosedInvoice, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceCountEndpoint.py index 883ea121d..2f4e815a2 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCompanyfinanceCountEndpoint( @@ -16,18 +15,13 @@ class FinanceCompanyfinanceCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/companyFinance/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/companyFinance/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceEndpoint.py index 1b5b547c1..b9e915ea9 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceCompanyfinanceCountEndpoint import ( - FinanceCompanyfinanceCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceCompanyfinanceIdEndpoint import ( - FinanceCompanyfinanceIdEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceCompanyfinanceCountEndpoint import FinanceCompanyfinanceCountEndpoint +from pyconnectwise.endpoints.manage.FinanceCompanyfinanceIdEndpoint import FinanceCompanyfinanceIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCompanyfinanceEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "companyFinance", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "companyFinance", parent_endpoint=parent_endpoint) - self.count = self._register_child_endpoint( - FinanceCompanyfinanceCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceCompanyfinanceCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceCompanyfinanceIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceCompanyfinanceIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceCompanyfinanceIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceCompanyfinanceIdEndpoint: The initialized FinanceCompanyfinanceIdEndpoint object. """ child = FinanceCompanyfinanceIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceIdEndpoint.py index b20c871fa..1c79c3d5d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCompanyfinanceIdEndpoint.py @@ -1,16 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable from pyconnectwise.models.manage import CompanyFinance from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCompanyfinanceIdEndpoint( @@ -19,19 +16,14 @@ class FinanceCompanyfinanceIdEndpoint( IPatchable[CompanyFinance, ConnectWiseManageRequestParams], IPaginateable[CompanyFinance, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CompanyFinance) IPatchable.__init__(self, CompanyFinance) IPaginateable.__init__(self, CompanyFinance) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CompanyFinance]: """ Performs a GET request against the /finance/companyFinance/{id} endpoint and returns an initialized PaginatedResponse object. @@ -49,19 +41,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CompanyFinance, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CompanyFinance, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyFinance: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CompanyFinance: """ Performs a GET request against the /finance/companyFinance/{id} endpoint. @@ -71,16 +54,9 @@ def get( Returns: CompanyFinance: The parsed response data. """ - return self._parse_one( - CompanyFinance, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CompanyFinance, super()._make_request("GET", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CompanyFinance: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CompanyFinance: """ Performs a PATCH request against the /finance/companyFinance/{id} endpoint. @@ -90,7 +66,4 @@ def patch( Returns: CompanyFinance: The parsed response data. """ - return self._parse_one( - CompanyFinance, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CompanyFinance, super()._make_request("PATCH", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesCountEndpoint.py index 36a5f1437..03978764c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceCurrenciesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/currencies/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/currencies/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesEndpoint.py index f568f08f1..463975f85 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceCurrenciesCountEndpoint import ( - FinanceCurrenciesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceCurrenciesIdEndpoint import ( - FinanceCurrenciesIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceCurrenciesInfoEndpoint import ( - FinanceCurrenciesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceCurrenciesCountEndpoint import FinanceCurrenciesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceCurrenciesIdEndpoint import FinanceCurrenciesIdEndpoint +from pyconnectwise.endpoints.manage.FinanceCurrenciesInfoEndpoint import FinanceCurrenciesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import FinanceCurrency from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesEndpoint( @@ -27,39 +19,30 @@ class FinanceCurrenciesEndpoint( IPostable[FinanceCurrency, ConnectWiseManageRequestParams], IPaginateable[FinanceCurrency, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "currencies", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "currencies", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[FinanceCurrency]) IPostable.__init__(self, FinanceCurrency) IPaginateable.__init__(self, FinanceCurrency) - self.count = self._register_child_endpoint( - FinanceCurrenciesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceCurrenciesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceCurrenciesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceCurrenciesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceCurrenciesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceCurrenciesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceCurrenciesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceCurrenciesIdEndpoint: The initialized FinanceCurrenciesIdEndpoint object. """ child = FinanceCurrenciesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[FinanceCurrency]: """ Performs a GET request against the /finance/currencies endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - FinanceCurrency, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), FinanceCurrency, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[FinanceCurrency]: """ Performs a GET request against the /finance/currencies endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[FinanceCurrency]: The parsed response data. """ - return self._parse_many( - FinanceCurrency, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(FinanceCurrency, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FinanceCurrency: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FinanceCurrency: """ Performs a POST request against the /finance/currencies endpoint. @@ -118,7 +87,4 @@ def post( Returns: FinanceCurrency: The parsed response data. """ - return self._parse_one( - FinanceCurrency, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(FinanceCurrency, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdEndpoint.py index 91033b485..ea9fc2710 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceCurrenciesIdInfoEndpoint import ( - FinanceCurrenciesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceCurrenciesIdUsagesEndpoint import ( - FinanceCurrenciesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceCurrenciesIdInfoEndpoint import FinanceCurrenciesIdInfoEndpoint +from pyconnectwise.endpoints.manage.FinanceCurrenciesIdUsagesEndpoint import FinanceCurrenciesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import FinanceCurrency from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesIdEndpoint( ConnectWiseEndpoint, IGettable[FinanceCurrency, ConnectWiseManageRequestParams], - IPuttable[FinanceCurrency, ConnectWiseManageRequestParams], IPatchable[FinanceCurrency, ConnectWiseManageRequestParams], + IPuttable[FinanceCurrency, ConnectWiseManageRequestParams], IPaginateable[FinanceCurrency, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, FinanceCurrency) - IPuttable.__init__(self, FinanceCurrency) IPatchable.__init__(self, FinanceCurrency) + IPuttable.__init__(self, FinanceCurrency) IPaginateable.__init__(self, FinanceCurrency) - self.usages = self._register_child_endpoint( - FinanceCurrenciesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceCurrenciesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(FinanceCurrenciesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(FinanceCurrenciesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[FinanceCurrency]: """ Performs a GET request against the /finance/currencies/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,40 +48,22 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - FinanceCurrency, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), FinanceCurrency, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FinanceCurrency: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/currencies/{id} endpoint. + Performs a DELETE request against the /finance/currencies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - FinanceCurrency: The parsed response data. """ - return self._parse_one( - FinanceCurrency, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FinanceCurrency: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FinanceCurrency: """ - Performs a PUT request against the /finance/currencies/{id} endpoint. + Performs a GET request against the /finance/currencies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,16 +71,9 @@ def put( Returns: FinanceCurrency: The parsed response data. """ - return self._parse_one( - FinanceCurrency, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(FinanceCurrency, super()._make_request("GET", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> FinanceCurrency: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> FinanceCurrency: """ Performs a PATCH request against the /finance/currencies/{id} endpoint. @@ -125,21 +83,16 @@ def patch( Returns: FinanceCurrency: The parsed response data. """ - return self._parse_one( - FinanceCurrency, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(FinanceCurrency, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FinanceCurrency: """ - Performs a DELETE request against the /finance/currencies/{id} endpoint. + Performs a PUT request against the /finance/currencies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + FinanceCurrency: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(FinanceCurrency, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdInfoEndpoint.py index 4b36a4c9a..fc81cdc8e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CurrencyInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceCurrenciesIdInfoEndpoint( IGettable[CurrencyInfo, ConnectWiseManageRequestParams], IPaginateable[CurrencyInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CurrencyInfo) IPaginateable.__init__(self, CurrencyInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CurrencyInfo]: """ Performs a GET request against the /finance/currencies/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CurrencyInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CurrencyInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CurrencyInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CurrencyInfo: """ Performs a GET request against the /finance/currencies/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: CurrencyInfo: The parsed response data. """ - return self._parse_one( - CurrencyInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CurrencyInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesEndpoint.py index c8d9efdb2..8aa8d9bb7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceCurrenciesIdUsagesListEndpoint import ( - FinanceCurrenciesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceCurrenciesIdUsagesListEndpoint import FinanceCurrenciesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class FinanceCurrenciesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - FinanceCurrenciesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(FinanceCurrenciesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/currencies/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/currencies/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesListEndpoint.py index c904e30d5..8ef5e660a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceCurrenciesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/currencies/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/currencies/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoCountEndpoint.py index ae7783fba..96665bf92 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceCurrenciesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/currencies/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/currencies/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoEndpoint.py index cd213d2b0..e52fcad1c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceCurrenciesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceCurrenciesInfoCountEndpoint import ( - FinanceCurrenciesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceCurrenciesInfoCountEndpoint import FinanceCurrenciesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CurrencyInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceCurrenciesInfoEndpoint( @@ -19,22 +16,15 @@ class FinanceCurrenciesInfoEndpoint( IGettable[list[CurrencyInfo], ConnectWiseManageRequestParams], IPaginateable[CurrencyInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CurrencyInfo]) IPaginateable.__init__(self, CurrencyInfo) - self.count = self._register_child_endpoint( - FinanceCurrenciesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceCurrenciesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CurrencyInfo]: """ Performs a GET request against the /finance/currencies/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CurrencyInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CurrencyInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CurrencyInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CurrencyInfo]: """ Performs a GET request against the /finance/currencies/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[CurrencyInfo]: The parsed response data. """ - return self._parse_many( - CurrencyInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CurrencyInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsCountEndpoint.py index b25541e11..6ca6b6495 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceDeliverymethodsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceDeliverymethodsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/deliveryMethods/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/deliveryMethods/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsEndpoint.py index f523f5495..7ade1f62f 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceDeliverymethodsCountEndpoint import ( - FinanceDeliverymethodsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceDeliverymethodsIdEndpoint import ( - FinanceDeliverymethodsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceDeliverymethodsCountEndpoint import FinanceDeliverymethodsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceDeliverymethodsIdEndpoint import FinanceDeliverymethodsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import DeliveryMethod from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceDeliverymethodsEndpoint( @@ -24,36 +18,29 @@ class FinanceDeliverymethodsEndpoint( IPostable[DeliveryMethod, ConnectWiseManageRequestParams], IPaginateable[DeliveryMethod, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "deliveryMethods", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "deliveryMethods", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DeliveryMethod]) IPostable.__init__(self, DeliveryMethod) IPaginateable.__init__(self, DeliveryMethod) - self.count = self._register_child_endpoint( - FinanceDeliverymethodsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceDeliverymethodsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceDeliverymethodsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceDeliverymethodsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceDeliverymethodsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceDeliverymethodsIdEndpoint: The initialized FinanceDeliverymethodsIdEndpoint object. """ child = FinanceDeliverymethodsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DeliveryMethod]: """ Performs a GET request against the /finance/deliveryMethods endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DeliveryMethod, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DeliveryMethod, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[DeliveryMethod]: """ Performs a GET request against the /finance/deliveryMethods endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[DeliveryMethod]: The parsed response data. """ - return self._parse_many( - DeliveryMethod, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(DeliveryMethod, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DeliveryMethod: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DeliveryMethod: """ Performs a POST request against the /finance/deliveryMethods endpoint. @@ -112,7 +85,4 @@ def post( Returns: DeliveryMethod: The parsed response data. """ - return self._parse_one( - DeliveryMethod, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(DeliveryMethod, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsIdEndpoint.py index 8506b49ca..9828efd43 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceDeliverymethodsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import DeliveryMethod from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceDeliverymethodsIdEndpoint( ConnectWiseEndpoint, IGettable[DeliveryMethod, ConnectWiseManageRequestParams], - IPuttable[DeliveryMethod, ConnectWiseManageRequestParams], IPatchable[DeliveryMethod, ConnectWiseManageRequestParams], + IPuttable[DeliveryMethod, ConnectWiseManageRequestParams], IPaginateable[DeliveryMethod, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, DeliveryMethod) - IPuttable.__init__(self, DeliveryMethod) IPatchable.__init__(self, DeliveryMethod) + IPuttable.__init__(self, DeliveryMethod) IPaginateable.__init__(self, DeliveryMethod) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DeliveryMethod]: """ Performs a GET request against the /finance/deliveryMethods/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DeliveryMethod, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DeliveryMethod, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DeliveryMethod: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/deliveryMethods/{id} endpoint. + Performs a DELETE request against the /finance/deliveryMethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - DeliveryMethod: The parsed response data. """ - return self._parse_one( - DeliveryMethod, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DeliveryMethod: """ - Performs a DELETE request against the /finance/deliveryMethods/{id} endpoint. + Performs a GET request against the /finance/deliveryMethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + DeliveryMethod: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(DeliveryMethod, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DeliveryMethod: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> DeliveryMethod: """ - Performs a PUT request against the /finance/deliveryMethods/{id} endpoint. + Performs a PATCH request against the /finance/deliveryMethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: DeliveryMethod: The parsed response data. """ - return self._parse_one( - DeliveryMethod, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(DeliveryMethod, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> DeliveryMethod: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DeliveryMethod: """ - Performs a PATCH request against the /finance/deliveryMethods/{id} endpoint. + Performs a PUT request against the /finance/deliveryMethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: DeliveryMethod: The parsed response data. """ - return self._parse_one( - DeliveryMethod, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(DeliveryMethod, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceEndpoint.py index c13045228..94aad90d0 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceEndpoint.py @@ -1,155 +1,82 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceAccountingEndpoint import ( - FinanceAccountingEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAccountingpackagesEndpoint import ( - FinanceAccountingpackagesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAccountingpackagesetupEndpoint import ( - FinanceAccountingpackagesetupEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementrecapEndpoint import ( - FinanceAgreementrecapEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementsEndpoint import ( - FinanceAgreementsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceAgreementtypesEndpoint import ( - FinanceAgreementtypesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBatchsetupsEndpoint import ( - FinanceBatchsetupsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingcyclesEndpoint import ( - FinanceBillingcyclesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingsetupsEndpoint import ( - FinanceBillingsetupsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingstatusesEndpoint import ( - FinanceBillingstatusesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceBillingtermsEndpoint import ( - FinanceBillingtermsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceClosedinvoicesEndpoint import ( - FinanceClosedinvoicesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceCompanyfinanceEndpoint import ( - FinanceCompanyfinanceEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceCurrenciesEndpoint import ( - FinanceCurrenciesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceDeliverymethodsEndpoint import ( - FinanceDeliverymethodsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceGlaccountsEndpoint import ( - FinanceGlaccountsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceGlcaptionsEndpoint import ( - FinanceGlcaptionsEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceAccountingEndpoint import FinanceAccountingEndpoint +from pyconnectwise.endpoints.manage.FinanceAccountingpackagesEndpoint import FinanceAccountingpackagesEndpoint +from pyconnectwise.endpoints.manage.FinanceAccountingpackagesetupEndpoint import FinanceAccountingpackagesetupEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementsEndpoint import FinanceAgreementsEndpoint +from pyconnectwise.endpoints.manage.FinanceAgreementtypesEndpoint import FinanceAgreementtypesEndpoint +from pyconnectwise.endpoints.manage.FinanceBatchsetupsEndpoint import FinanceBatchsetupsEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingcyclesEndpoint import FinanceBillingcyclesEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingsetupsEndpoint import FinanceBillingsetupsEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingstatusesEndpoint import FinanceBillingstatusesEndpoint +from pyconnectwise.endpoints.manage.FinanceBillingtermsEndpoint import FinanceBillingtermsEndpoint +from pyconnectwise.endpoints.manage.FinanceClosedinvoicesEndpoint import FinanceClosedinvoicesEndpoint +from pyconnectwise.endpoints.manage.FinanceCompanyfinanceEndpoint import FinanceCompanyfinanceEndpoint +from pyconnectwise.endpoints.manage.FinanceCurrenciesEndpoint import FinanceCurrenciesEndpoint +from pyconnectwise.endpoints.manage.FinanceDeliverymethodsEndpoint import FinanceDeliverymethodsEndpoint +from pyconnectwise.endpoints.manage.FinanceGlaccountsEndpoint import FinanceGlaccountsEndpoint +from pyconnectwise.endpoints.manage.FinanceGlcaptionsEndpoint import FinanceGlcaptionsEndpoint from pyconnectwise.endpoints.manage.FinanceGlpathsEndpoint import FinanceGlpathsEndpoint from pyconnectwise.endpoints.manage.FinanceInfoEndpoint import FinanceInfoEndpoint -from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesEndpoint import ( - FinanceInvoiceemailtemplatesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInvoicesEndpoint import ( - FinanceInvoicesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesEndpoint import ( - FinanceInvoicetemplatesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesetupsEndpoint import ( - FinanceInvoicetemplatesetupsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceTaxcodesEndpoint import ( - FinanceTaxcodesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceTaxintegrationsEndpoint import ( - FinanceTaxintegrationsEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesEndpoint import FinanceInvoiceemailtemplatesEndpoint +from pyconnectwise.endpoints.manage.FinanceInvoicesEndpoint import FinanceInvoicesEndpoint +from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesEndpoint import FinanceInvoicetemplatesEndpoint +from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesetupsEndpoint import FinanceInvoicetemplatesetupsEndpoint +from pyconnectwise.endpoints.manage.FinanceTaxcodesEndpoint import FinanceTaxcodesEndpoint +from pyconnectwise.endpoints.manage.FinanceTaxintegrationsEndpoint import FinanceTaxintegrationsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "finance", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "finance", parent_endpoint=parent_endpoint) - self.gl_accounts = self._register_child_endpoint( - FinanceGlaccountsEndpoint(client, parent_endpoint=self) - ) - self.agreementrecap = self._register_child_endpoint( - FinanceAgreementrecapEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceInfoEndpoint(client, parent_endpoint=self) - ) - self.billing_setups = self._register_child_endpoint( - FinanceBillingsetupsEndpoint(client, parent_endpoint=self) - ) - self.agreements = self._register_child_endpoint( - FinanceAgreementsEndpoint(client, parent_endpoint=self) - ) - self.currencies = self._register_child_endpoint( - FinanceCurrenciesEndpoint(client, parent_endpoint=self) - ) - self.invoice_templates = self._register_child_endpoint( - FinanceInvoicetemplatesEndpoint(client, parent_endpoint=self) - ) - self.gl_captions = self._register_child_endpoint( - FinanceGlcaptionsEndpoint(client, parent_endpoint=self) - ) - self.billing_cycles = self._register_child_endpoint( - FinanceBillingcyclesEndpoint(client, parent_endpoint=self) - ) - self.billing_statuses = self._register_child_endpoint( - FinanceBillingstatusesEndpoint(client, parent_endpoint=self) + self.accounting = self._register_child_endpoint(FinanceAccountingEndpoint(client, parent_endpoint=self)) + self.accounting_package_setup = self._register_child_endpoint( + FinanceAccountingpackagesetupEndpoint(client, parent_endpoint=self) ) - self.tax_integrations = self._register_child_endpoint( - FinanceTaxintegrationsEndpoint(client, parent_endpoint=self) + self.accounting_packages = self._register_child_endpoint( + FinanceAccountingpackagesEndpoint(client, parent_endpoint=self) ) self.agreement_types = self._register_child_endpoint( FinanceAgreementtypesEndpoint(client, parent_endpoint=self) ) - self.invoice_email_templates = self._register_child_endpoint( - FinanceInvoiceemailtemplatesEndpoint(client, parent_endpoint=self) - ) - self.tax_codes = self._register_child_endpoint( - FinanceTaxcodesEndpoint(client, parent_endpoint=self) - ) - self.billing_terms = self._register_child_endpoint( - FinanceBillingtermsEndpoint(client, parent_endpoint=self) + self.agreements = self._register_child_endpoint(FinanceAgreementsEndpoint(client, parent_endpoint=self)) + self.batch_setups = self._register_child_endpoint(FinanceBatchsetupsEndpoint(client, parent_endpoint=self)) + self.billing_cycles = self._register_child_endpoint(FinanceBillingcyclesEndpoint(client, parent_endpoint=self)) + self.billing_setups = self._register_child_endpoint(FinanceBillingsetupsEndpoint(client, parent_endpoint=self)) + self.billing_statuses = self._register_child_endpoint( + FinanceBillingstatusesEndpoint(client, parent_endpoint=self) ) - self.glpaths = self._register_child_endpoint( - FinanceGlpathsEndpoint(client, parent_endpoint=self) + self.billing_terms = self._register_child_endpoint(FinanceBillingtermsEndpoint(client, parent_endpoint=self)) + self.closed_invoices = self._register_child_endpoint( + FinanceClosedinvoicesEndpoint(client, parent_endpoint=self) ) - self.invoices = self._register_child_endpoint( - FinanceInvoicesEndpoint(client, parent_endpoint=self) + self.company_finance = self._register_child_endpoint( + FinanceCompanyfinanceEndpoint(client, parent_endpoint=self) ) + self.currencies = self._register_child_endpoint(FinanceCurrenciesEndpoint(client, parent_endpoint=self)) self.delivery_methods = self._register_child_endpoint( FinanceDeliverymethodsEndpoint(client, parent_endpoint=self) ) - self.closed_invoices = self._register_child_endpoint( - FinanceClosedinvoicesEndpoint(client, parent_endpoint=self) - ) - self.accounting_packages = self._register_child_endpoint( - FinanceAccountingpackagesEndpoint(client, parent_endpoint=self) - ) - self.accounting_package_setup = self._register_child_endpoint( - FinanceAccountingpackagesetupEndpoint(client, parent_endpoint=self) + self.gl_accounts = self._register_child_endpoint(FinanceGlaccountsEndpoint(client, parent_endpoint=self)) + self.gl_captions = self._register_child_endpoint(FinanceGlcaptionsEndpoint(client, parent_endpoint=self)) + self.glpaths = self._register_child_endpoint(FinanceGlpathsEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceInfoEndpoint(client, parent_endpoint=self)) + self.invoice_email_templates = self._register_child_endpoint( + FinanceInvoiceemailtemplatesEndpoint(client, parent_endpoint=self) ) self.invoice_template_setups = self._register_child_endpoint( FinanceInvoicetemplatesetupsEndpoint(client, parent_endpoint=self) ) - self.accounting = self._register_child_endpoint( - FinanceAccountingEndpoint(client, parent_endpoint=self) - ) - self.batch_setups = self._register_child_endpoint( - FinanceBatchsetupsEndpoint(client, parent_endpoint=self) + self.invoice_templates = self._register_child_endpoint( + FinanceInvoicetemplatesEndpoint(client, parent_endpoint=self) ) - self.company_finance = self._register_child_endpoint( - FinanceCompanyfinanceEndpoint(client, parent_endpoint=self) + self.invoices = self._register_child_endpoint(FinanceInvoicesEndpoint(client, parent_endpoint=self)) + self.tax_codes = self._register_child_endpoint(FinanceTaxcodesEndpoint(client, parent_endpoint=self)) + self.tax_integrations = self._register_child_endpoint( + FinanceTaxintegrationsEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsCountEndpoint.py index 5282d12c0..47d076d27 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlaccountsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceGlaccountsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/glAccounts/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/glAccounts/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsEndpoint.py index df4fcf66f..9c39aeb62 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceGlaccountsCountEndpoint import ( - FinanceGlaccountsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceGlaccountsIdEndpoint import ( - FinanceGlaccountsIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceGlaccountsMappedtypesEndpoint import ( - FinanceGlaccountsMappedtypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceGlaccountsCountEndpoint import FinanceGlaccountsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceGlaccountsIdEndpoint import FinanceGlaccountsIdEndpoint +from pyconnectwise.endpoints.manage.FinanceGlaccountsMappedtypesEndpoint import FinanceGlaccountsMappedtypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import GLAccount from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlaccountsEndpoint( @@ -27,39 +19,32 @@ class FinanceGlaccountsEndpoint( IPostable[GLAccount, ConnectWiseManageRequestParams], IPaginateable[GLAccount, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "glAccounts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "glAccounts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[GLAccount]) IPostable.__init__(self, GLAccount) IPaginateable.__init__(self, GLAccount) - self.count = self._register_child_endpoint( - FinanceGlaccountsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceGlaccountsCountEndpoint(client, parent_endpoint=self)) self.mapped_types = self._register_child_endpoint( FinanceGlaccountsMappedtypesEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceGlaccountsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceGlaccountsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceGlaccountsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceGlaccountsIdEndpoint: The initialized FinanceGlaccountsIdEndpoint object. """ child = FinanceGlaccountsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GLAccount]: """ Performs a GET request against the /finance/glAccounts endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +61,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GLAccount, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GLAccount, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[GLAccount]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[GLAccount]: """ Performs a GET request against the /finance/glAccounts endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[GLAccount]: The parsed response data. """ - return self._parse_many( - GLAccount, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(GLAccount, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLAccount: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLAccount: """ Performs a POST request against the /finance/glAccounts endpoint. @@ -117,6 +85,4 @@ def post( Returns: GLAccount: The parsed response data. """ - return self._parse_one( - GLAccount, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(GLAccount, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsIdEndpoint.py index b999a4bf4..c4fe16302 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import GLAccount from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlaccountsIdEndpoint( ConnectWiseEndpoint, IGettable[GLAccount, ConnectWiseManageRequestParams], - IPuttable[GLAccount, ConnectWiseManageRequestParams], IPatchable[GLAccount, ConnectWiseManageRequestParams], + IPuttable[GLAccount, ConnectWiseManageRequestParams], IPaginateable[GLAccount, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, GLAccount) - IPuttable.__init__(self, GLAccount) IPatchable.__init__(self, GLAccount) + IPuttable.__init__(self, GLAccount) IPaginateable.__init__(self, GLAccount) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GLAccount]: """ Performs a GET request against the /finance/glAccounts/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,40 +42,21 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GLAccount, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GLAccount, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLAccount: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/glAccounts/{id} endpoint. + Performs a DELETE request against the /finance/glAccounts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - GLAccount: The parsed response data. """ - return self._parse_one( - GLAccount, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLAccount: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLAccount: """ - Performs a PUT request against the /finance/glAccounts/{id} endpoint. + Performs a GET request against the /finance/glAccounts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,15 +64,9 @@ def put( Returns: GLAccount: The parsed response data. """ - return self._parse_one( - GLAccount, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(GLAccount, super()._make_request("GET", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLAccount: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> GLAccount: """ Performs a PATCH request against the /finance/glAccounts/{id} endpoint. @@ -110,20 +76,16 @@ def patch( Returns: GLAccount: The parsed response data. """ - return self._parse_one( - GLAccount, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(GLAccount, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLAccount: """ - Performs a DELETE request against the /finance/glAccounts/{id} endpoint. + Performs a PUT request against the /finance/glAccounts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + GLAccount: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(GLAccount, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesCountEndpoint.py index 3dd9ca7d1..309186110 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlaccountsMappedtypesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceGlaccountsMappedtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/glAccounts/mappedTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/glAccounts/mappedTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesEndpoint.py index 6e97e9200..70e658dbb 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlaccountsMappedtypesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceGlaccountsMappedtypesCountEndpoint import ( FinanceGlaccountsMappedtypesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MappedType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlaccountsMappedtypesEndpoint( @@ -19,10 +18,8 @@ class FinanceGlaccountsMappedtypesEndpoint( IGettable[list[MappedType], ConnectWiseManageRequestParams], IPaginateable[MappedType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "mappedTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "mappedTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MappedType]) IPaginateable.__init__(self, MappedType) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MappedType]: """ Performs a GET request against the /finance/glAccounts/mappedTypes endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MappedType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MappedType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[MappedType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[MappedType]: """ Performs a GET request against the /finance/glAccounts/mappedTypes endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[MappedType]: The parsed response data. """ - return self._parse_many( - MappedType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(MappedType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsCountEndpoint.py index cd119b486..779aa8d2a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlcaptionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceGlcaptionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/glCaptions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/glCaptions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsEndpoint.py index 2bfa29c6e..e483fec78 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceGlcaptionsCountEndpoint import ( - FinanceGlcaptionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceGlcaptionsIdEndpoint import ( - FinanceGlcaptionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceGlcaptionsCountEndpoint import FinanceGlcaptionsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceGlcaptionsIdEndpoint import FinanceGlcaptionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import GLCaption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlcaptionsEndpoint( @@ -22,35 +17,28 @@ class FinanceGlcaptionsEndpoint( IGettable[list[GLCaption], ConnectWiseManageRequestParams], IPaginateable[GLCaption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "glCaptions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "glCaptions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[GLCaption]) IPaginateable.__init__(self, GLCaption) - self.count = self._register_child_endpoint( - FinanceGlcaptionsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceGlcaptionsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceGlcaptionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceGlcaptionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceGlcaptionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceGlcaptionsIdEndpoint: The initialized FinanceGlcaptionsIdEndpoint object. """ child = FinanceGlcaptionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GLCaption]: """ Performs a GET request against the /finance/glCaptions endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GLCaption, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GLCaption, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[GLCaption]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[GLCaption]: """ Performs a GET request against the /finance/glCaptions endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[GLCaption]: The parsed response data. """ - return self._parse_many( - GLCaption, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(GLCaption, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsIdEndpoint.py index f819b51d1..352e6681e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlcaptionsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import GLCaption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlcaptionsIdEndpoint( ConnectWiseEndpoint, IGettable[GLCaption, ConnectWiseManageRequestParams], - IPuttable[GLCaption, ConnectWiseManageRequestParams], IPatchable[GLCaption, ConnectWiseManageRequestParams], + IPuttable[GLCaption, ConnectWiseManageRequestParams], IPaginateable[GLCaption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, GLCaption) - IPuttable.__init__(self, GLCaption) IPatchable.__init__(self, GLCaption) + IPuttable.__init__(self, GLCaption) IPaginateable.__init__(self, GLCaption) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GLCaption]: """ Performs a GET request against the /finance/glCaptions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +42,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GLCaption, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GLCaption, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLCaption: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLCaption: """ Performs a GET request against the /finance/glCaptions/{id} endpoint. @@ -74,17 +54,11 @@ def get( Returns: GLCaption: The parsed response data. """ - return self._parse_one( - GLCaption, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(GLCaption, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLCaption: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> GLCaption: """ - Performs a PUT request against the /finance/glCaptions/{id} endpoint. + Performs a PATCH request against the /finance/glCaptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +66,11 @@ def put( Returns: GLCaption: The parsed response data. """ - return self._parse_one( - GLCaption, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(GLCaption, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLCaption: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLCaption: """ - Performs a PATCH request against the /finance/glCaptions/{id} endpoint. + Performs a PUT request against the /finance/glCaptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +78,4 @@ def patch( Returns: GLCaption: The parsed response data. """ - return self._parse_one( - GLCaption, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(GLCaption, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlpathsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlpathsCountEndpoint.py index 7d1b03982..9ae39fcaa 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlpathsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlpathsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlpathsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceGlpathsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/glpaths/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/glpaths/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlpathsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlpathsEndpoint.py index 6077e6f25..db03517e1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlpathsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlpathsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceGlpathsCountEndpoint import ( - FinanceGlpathsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceGlpathsIdEndpoint import ( - FinanceGlpathsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceGlpathsCountEndpoint import FinanceGlpathsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceGlpathsIdEndpoint import FinanceGlpathsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import GLPath from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlpathsEndpoint( @@ -24,36 +18,29 @@ class FinanceGlpathsEndpoint( IPostable[GLPath, ConnectWiseManageRequestParams], IPaginateable[GLPath, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "glpaths", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "glpaths", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[GLPath]) IPostable.__init__(self, GLPath) IPaginateable.__init__(self, GLPath) - self.count = self._register_child_endpoint( - FinanceGlpathsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceGlpathsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceGlpathsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceGlpathsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceGlpathsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceGlpathsIdEndpoint: The initialized FinanceGlpathsIdEndpoint object. """ child = FinanceGlpathsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GLPath]: """ Performs a GET request against the /finance/glpaths endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GLPath, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GLPath, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[GLPath]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[GLPath]: """ Performs a GET request against the /finance/glpaths endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[GLPath]: The parsed response data. """ - return self._parse_many( - GLPath, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(GLPath, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLPath: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLPath: """ Performs a POST request against the /finance/glpaths endpoint. @@ -111,6 +81,4 @@ def post( Returns: GLPath: The parsed response data. """ - return self._parse_one( - GLPath, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(GLPath, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceGlpathsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceGlpathsIdEndpoint.py index 3e1aaaf10..dbec0a7e7 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceGlpathsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceGlpathsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import GLPath from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceGlpathsIdEndpoint( ConnectWiseEndpoint, IGettable[GLPath, ConnectWiseManageRequestParams], - IPuttable[GLPath, ConnectWiseManageRequestParams], IPatchable[GLPath, ConnectWiseManageRequestParams], + IPuttable[GLPath, ConnectWiseManageRequestParams], IPaginateable[GLPath, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, GLPath) - IPuttable.__init__(self, GLPath) IPatchable.__init__(self, GLPath) + IPuttable.__init__(self, GLPath) IPaginateable.__init__(self, GLPath) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GLPath]: """ Performs a GET request against the /finance/glpaths/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GLPath, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GLPath, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLPath: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/glpaths/{id} endpoint. + Performs a DELETE request against the /finance/glpaths/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - GLPath: The parsed response data. """ - return self._parse_one( - GLPath, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLPath: """ - Performs a DELETE request against the /finance/glpaths/{id} endpoint. + Performs a GET request against the /finance/glpaths/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + GLPath: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(GLPath, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLPath: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> GLPath: """ - Performs a PUT request against the /finance/glpaths/{id} endpoint. + Performs a PATCH request against the /finance/glpaths/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: GLPath: The parsed response data. """ - return self._parse_one( - GLPath, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(GLPath, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> GLPath: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GLPath: """ - Performs a PATCH request against the /finance/glpaths/{id} endpoint. + Performs a PUT request against the /finance/glpaths/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: GLPath: The parsed response data. """ - return self._parse_one( - GLPath, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(GLPath, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesCountEndpoint.py index cadad3731..d981a962c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoCurrencycodesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceInfoCurrencycodesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/info/currencyCodes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/info/currencyCodes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesEndpoint.py index 6308a1b10..ed8ec3918 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceInfoCurrencycodesCountEndpoint import ( - FinanceInfoCurrencycodesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInfoCurrencycodesIdEndpoint import ( - FinanceInfoCurrencycodesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceInfoCurrencycodesCountEndpoint import FinanceInfoCurrencycodesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceInfoCurrencycodesIdEndpoint import FinanceInfoCurrencycodesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CurrencyCode from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoCurrencycodesEndpoint( @@ -22,35 +17,28 @@ class FinanceInfoCurrencycodesEndpoint( IGettable[list[CurrencyCode], ConnectWiseManageRequestParams], IPaginateable[CurrencyCode, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "currencyCodes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "currencyCodes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CurrencyCode]) IPaginateable.__init__(self, CurrencyCode) - self.count = self._register_child_endpoint( - FinanceInfoCurrencycodesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceInfoCurrencycodesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceInfoCurrencycodesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInfoCurrencycodesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInfoCurrencycodesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInfoCurrencycodesIdEndpoint: The initialized FinanceInfoCurrencycodesIdEndpoint object. """ child = FinanceInfoCurrencycodesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CurrencyCode]: """ Performs a GET request against the /finance/info/currencyCodes endpoint and returns an initialized PaginatedResponse object. @@ -68,19 +56,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CurrencyCode, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CurrencyCode, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CurrencyCode]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CurrencyCode]: """ Performs a GET request against the /finance/info/currencyCodes endpoint. @@ -90,6 +69,4 @@ def get( Returns: list[CurrencyCode]: The parsed response data. """ - return self._parse_many( - CurrencyCode, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CurrencyCode, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesIdEndpoint.py index 49b4ddfc2..81e430497 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoCurrencycodesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CurrencyCode from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoCurrencycodesIdEndpoint( @@ -16,18 +15,13 @@ class FinanceInfoCurrencycodesIdEndpoint( IGettable[CurrencyCode, ConnectWiseManageRequestParams], IPaginateable[CurrencyCode, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CurrencyCode) IPaginateable.__init__(self, CurrencyCode) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CurrencyCode]: """ Performs a GET request against the /finance/info/currencyCodes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CurrencyCode, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CurrencyCode, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CurrencyCode: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CurrencyCode: """ Performs a GET request against the /finance/info/currencyCodes/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: CurrencyCode: The parsed response data. """ - return self._parse_one( - CurrencyCode, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CurrencyCode, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoEndpoint.py index 6eb2a43df..3e85451aa 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoEndpoint.py @@ -1,27 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceInfoCurrencycodesEndpoint import ( - FinanceInfoCurrencycodesEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInfoInvoiceEndpoint import ( - FinanceInfoInvoiceEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInfoTaxintegrationsEndpoint import ( - FinanceInfoTaxintegrationsEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceInfoCurrencycodesEndpoint import FinanceInfoCurrencycodesEndpoint +from pyconnectwise.endpoints.manage.FinanceInfoInvoiceEndpoint import FinanceInfoInvoiceEndpoint +from pyconnectwise.endpoints.manage.FinanceInfoTaxintegrationsEndpoint import FinanceInfoTaxintegrationsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) - self.tax_integrations = self._register_child_endpoint( - FinanceInfoTaxintegrationsEndpoint(client, parent_endpoint=self) - ) self.currency_codes = self._register_child_endpoint( FinanceInfoCurrencycodesEndpoint(client, parent_endpoint=self) ) - self.invoice = self._register_child_endpoint( - FinanceInfoInvoiceEndpoint(client, parent_endpoint=self) + self.invoice = self._register_child_endpoint(FinanceInfoInvoiceEndpoint(client, parent_endpoint=self)) + self.tax_integrations = self._register_child_endpoint( + FinanceInfoTaxintegrationsEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceEndpoint.py index a736a6e45..2ad0abab4 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceInfoInvoiceIdEndpoint import ( - FinanceInfoInvoiceIdEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceInfoInvoiceIdEndpoint import FinanceInfoInvoiceIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoInvoiceEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoice", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "invoice", parent_endpoint=parent_endpoint) - def id(self, id: int) -> FinanceInfoInvoiceIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInfoInvoiceIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInfoInvoiceIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInfoInvoiceIdEndpoint: The initialized FinanceInfoInvoiceIdEndpoint object. """ child = FinanceInfoInvoiceIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceIdEndpoint.py index 210b31d3a..70fff452f 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoInvoiceIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InvoiceInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoInvoiceIdEndpoint( @@ -16,18 +15,13 @@ class FinanceInfoInvoiceIdEndpoint( IGettable[InvoiceInfo, ConnectWiseManageRequestParams], IPaginateable[InvoiceInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, InvoiceInfo) IPaginateable.__init__(self, InvoiceInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceInfo]: """ Performs a GET request against the /finance/info/invoice/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoiceInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InvoiceInfo: """ Performs a GET request against the /finance/info/invoice/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: InvoiceInfo: The parsed response data. """ - return self._parse_one( - InvoiceInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(InvoiceInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsCountEndpoint.py index 1c3446cd2..a90f5fd2c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoTaxintegrationsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceInfoTaxintegrationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/info/taxIntegrations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/info/taxIntegrations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsEndpoint.py index bee4a41a7..cd1ffc722 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInfoTaxintegrationsCountEndpoint import ( FinanceInfoTaxintegrationsCountEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceInfoTaxintegrationsIdEndpoint import ( - FinanceInfoTaxintegrationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceInfoTaxintegrationsIdEndpoint import FinanceInfoTaxintegrationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TaxIntegrationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoTaxintegrationsEndpoint( @@ -22,10 +19,8 @@ class FinanceInfoTaxintegrationsEndpoint( IGettable[list[TaxIntegrationInfo], ConnectWiseManageRequestParams], IPaginateable[TaxIntegrationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxIntegrations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxIntegrations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxIntegrationInfo]) IPaginateable.__init__(self, TaxIntegrationInfo) @@ -33,24 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceInfoTaxintegrationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceInfoTaxintegrationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInfoTaxintegrationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInfoTaxintegrationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInfoTaxintegrationsIdEndpoint: The initialized FinanceInfoTaxintegrationsIdEndpoint object. """ child = FinanceInfoTaxintegrationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxIntegrationInfo]: """ Performs a GET request against the /finance/info/taxIntegrations endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxIntegrationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxIntegrationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TaxIntegrationInfo]: """ Performs a GET request against the /finance/info/taxIntegrations endpoint. @@ -90,7 +75,4 @@ def get( Returns: list[TaxIntegrationInfo]: The parsed response data. """ - return self._parse_many( - TaxIntegrationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TaxIntegrationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsIdEndpoint.py index 249c8ef8b..00f9ae06c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInfoTaxintegrationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TaxIntegrationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInfoTaxintegrationsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceInfoTaxintegrationsIdEndpoint( IGettable[TaxIntegrationInfo, ConnectWiseManageRequestParams], IPaginateable[TaxIntegrationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxIntegrationInfo) IPaginateable.__init__(self, TaxIntegrationInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxIntegrationInfo]: """ Performs a GET request against the /finance/info/taxIntegrations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxIntegrationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxIntegrationInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxIntegrationInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxIntegrationInfo: """ Performs a GET request against the /finance/info/taxIntegrations/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: TaxIntegrationInfo: The parsed response data. """ - return self._parse_one( - TaxIntegrationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(TaxIntegrationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesCountEndpoint.py index 6f262f51c..9ec1e75bd 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoiceemailtemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/invoiceEmailTemplates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/invoiceEmailTemplates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesEndpoint.py index 8a0aeb40b..d7d2207d5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesEndpoint.py @@ -1,24 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesCountEndpoint import ( FinanceInvoiceemailtemplatesCountEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesIdEndpoint import ( - FinanceInvoiceemailtemplatesIdEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesIdEndpoint import FinanceInvoiceemailtemplatesIdEndpoint from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesInfoEndpoint import ( FinanceInvoiceemailtemplatesInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import InvoiceEmailTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesEndpoint( @@ -27,10 +23,8 @@ class FinanceInvoiceemailtemplatesEndpoint( IPostable[InvoiceEmailTemplate, ConnectWiseManageRequestParams], IPaginateable[InvoiceEmailTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoiceEmailTemplates", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "invoiceEmailTemplates", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InvoiceEmailTemplate]) IPostable.__init__(self, InvoiceEmailTemplate) IPaginateable.__init__(self, InvoiceEmailTemplate) @@ -42,26 +36,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceInvoiceemailtemplatesInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceInvoiceemailtemplatesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInvoiceemailtemplatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInvoiceemailtemplatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInvoiceemailtemplatesIdEndpoint: The initialized FinanceInvoiceemailtemplatesIdEndpoint object. """ - child = FinanceInvoiceemailtemplatesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceInvoiceemailtemplatesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceEmailTemplate]: """ Performs a GET request against the /finance/invoiceEmailTemplates endpoint and returns an initialized PaginatedResponse object. @@ -79,18 +68,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceEmailTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceEmailTemplate, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[InvoiceEmailTemplate]: """ Performs a GET request against the /finance/invoiceEmailTemplates endpoint. @@ -101,15 +83,10 @@ def get( Returns: list[InvoiceEmailTemplate]: The parsed response data. """ - return self._parse_many( - InvoiceEmailTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(InvoiceEmailTemplate, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> InvoiceEmailTemplate: """ Performs a POST request against the /finance/invoiceEmailTemplates endpoint. @@ -120,7 +97,4 @@ def post( Returns: InvoiceEmailTemplate: The parsed response data. """ - return self._parse_one( - InvoiceEmailTemplate, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(InvoiceEmailTemplate, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdEndpoint.py index e00e562af..30c2afa03 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesIdInfoEndpoint import ( FinanceInvoiceemailtemplatesIdInfoEndpoint, @@ -5,49 +7,38 @@ from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesIdUsagesEndpoint import ( FinanceInvoiceemailtemplatesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import InvoiceEmailTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesIdEndpoint( ConnectWiseEndpoint, IGettable[InvoiceEmailTemplate, ConnectWiseManageRequestParams], - IPuttable[InvoiceEmailTemplate, ConnectWiseManageRequestParams], IPatchable[InvoiceEmailTemplate, ConnectWiseManageRequestParams], + IPuttable[InvoiceEmailTemplate, ConnectWiseManageRequestParams], IPaginateable[InvoiceEmailTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, InvoiceEmailTemplate) - IPuttable.__init__(self, InvoiceEmailTemplate) IPatchable.__init__(self, InvoiceEmailTemplate) + IPuttable.__init__(self, InvoiceEmailTemplate) IPaginateable.__init__(self, InvoiceEmailTemplate) - self.usages = self._register_child_endpoint( - FinanceInvoiceemailtemplatesIdUsagesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( FinanceInvoiceemailtemplatesIdInfoEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint( + FinanceInvoiceemailtemplatesIdUsagesEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceEmailTemplate]: """ Performs a GET request against the /finance/invoiceEmailTemplates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +56,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceEmailTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceEmailTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoiceEmailTemplate: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/invoiceEmailTemplates/{id} endpoint. + Performs a DELETE request against the /finance/invoiceEmailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - InvoiceEmailTemplate: The parsed response data. """ - return self._parse_one( - InvoiceEmailTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> InvoiceEmailTemplate: """ - Performs a DELETE request against the /finance/invoiceEmailTemplates/{id} endpoint. + Performs a GET request against the /finance/invoiceEmailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + InvoiceEmailTemplate: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(InvoiceEmailTemplate, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> InvoiceEmailTemplate: """ - Performs a PUT request against the /finance/invoiceEmailTemplates/{id} endpoint. + Performs a PATCH request against the /finance/invoiceEmailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +95,13 @@ def put( Returns: InvoiceEmailTemplate: The parsed response data. """ - return self._parse_one( - InvoiceEmailTemplate, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(InvoiceEmailTemplate, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> InvoiceEmailTemplate: """ - Performs a PATCH request against the /finance/invoiceEmailTemplates/{id} endpoint. + Performs a PUT request against the /finance/invoiceEmailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +109,4 @@ def patch( Returns: InvoiceEmailTemplate: The parsed response data. """ - return self._parse_one( - InvoiceEmailTemplate, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(InvoiceEmailTemplate, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdInfoEndpoint.py index 9d05a7793..0a89fd8eb 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InvoiceEmailTemplateInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoiceemailtemplatesIdInfoEndpoint( IGettable[InvoiceEmailTemplateInfo, ConnectWiseManageRequestParams], IPaginateable[InvoiceEmailTemplateInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, InvoiceEmailTemplateInfo) IPaginateable.__init__(self, InvoiceEmailTemplateInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceEmailTemplateInfo]: """ Performs a GET request against the /finance/invoiceEmailTemplates/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceEmailTemplateInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceEmailTemplateInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> InvoiceEmailTemplateInfo: """ Performs a GET request against the /finance/invoiceEmailTemplates/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: InvoiceEmailTemplateInfo: The parsed response data. """ - return self._parse_one( - InvoiceEmailTemplateInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(InvoiceEmailTemplateInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesEndpoint.py index fc1dad49d..747a6c388 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesIdUsagesListEndpoint import ( FinanceInvoiceemailtemplatesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesIdUsagesEndpoint( @@ -19,24 +18,17 @@ class FinanceInvoiceemailtemplatesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - FinanceInvoiceemailtemplatesIdUsagesListEndpoint( - client, parent_endpoint=self - ) + FinanceInvoiceemailtemplatesIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/invoiceEmailTemplates/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/invoiceEmailTemplates/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesListEndpoint.py index cce74710c..d78611258 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoiceemailtemplatesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/invoiceEmailTemplates/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/invoiceEmailTemplates/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoCountEndpoint.py index 29f8bcceb..27d8ed444 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoiceemailtemplatesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/invoiceEmailTemplates/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/invoiceEmailTemplates/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoEndpoint.py index 0c5ac6d60..6cd73171a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoiceemailtemplatesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInvoiceemailtemplatesInfoCountEndpoint import ( FinanceInvoiceemailtemplatesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InvoiceEmailTemplateInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoiceemailtemplatesInfoEndpoint( @@ -19,10 +18,8 @@ class FinanceInvoiceemailtemplatesInfoEndpoint( IGettable[list[InvoiceEmailTemplateInfo], ConnectWiseManageRequestParams], IPaginateable[InvoiceEmailTemplateInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InvoiceEmailTemplateInfo]) IPaginateable.__init__(self, InvoiceEmailTemplateInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceEmailTemplateInfo]: """ Performs a GET request against the /finance/invoiceEmailTemplates/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceEmailTemplateInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceEmailTemplateInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[InvoiceEmailTemplateInfo]: """ Performs a GET request against the /finance/invoiceEmailTemplates/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[InvoiceEmailTemplateInfo]: The parsed response data. """ - return self._parse_many( - InvoiceEmailTemplateInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(InvoiceEmailTemplateInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicesCountEndpoint.py index c5fa9e999..cca1e69fe 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoicesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/invoices/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/invoices/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicesEndpoint.py index 8f3041504..b730ae374 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceInvoicesCountEndpoint import ( - FinanceInvoicesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInvoicesIdEndpoint import ( - FinanceInvoicesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceInvoicesCountEndpoint import FinanceInvoicesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceInvoicesIdEndpoint import FinanceInvoicesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Invoice from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicesEndpoint( @@ -24,36 +18,29 @@ class FinanceInvoicesEndpoint( IPostable[Invoice, ConnectWiseManageRequestParams], IPaginateable[Invoice, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoices", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "invoices", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Invoice]) IPostable.__init__(self, Invoice) IPaginateable.__init__(self, Invoice) - self.count = self._register_child_endpoint( - FinanceInvoicesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceInvoicesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceInvoicesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInvoicesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInvoicesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInvoicesIdEndpoint: The initialized FinanceInvoicesIdEndpoint object. """ child = FinanceInvoicesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Invoice]: """ Performs a GET request against the /finance/invoices endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Invoice, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Invoice, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Invoice]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Invoice]: """ Performs a GET request against the /finance/invoices endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Invoice]: The parsed response data. """ - return self._parse_many( - Invoice, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Invoice, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Invoice: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Invoice: """ Performs a POST request against the /finance/invoices endpoint. @@ -111,6 +81,4 @@ def post( Returns: Invoice: The parsed response data. """ - return self._parse_one( - Invoice, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Invoice, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdEndpoint.py index ef29adc2f..cf28aa4c1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceInvoicesIdPaymentsEndpoint import ( - FinanceInvoicesIdPaymentsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInvoicesIdPdfEndpoint import ( - FinanceInvoicesIdPdfEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.FinanceInvoicesIdPaymentsEndpoint import FinanceInvoicesIdPaymentsEndpoint +from pyconnectwise.endpoints.manage.FinanceInvoicesIdPdfEndpoint import FinanceInvoicesIdPdfEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Invoice from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicesIdEndpoint( ConnectWiseEndpoint, IGettable[Invoice, ConnectWiseManageRequestParams], - IPuttable[Invoice, ConnectWiseManageRequestParams], IPatchable[Invoice, ConnectWiseManageRequestParams], + IPuttable[Invoice, ConnectWiseManageRequestParams], IPaginateable[Invoice, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Invoice) - IPuttable.__init__(self, Invoice) IPatchable.__init__(self, Invoice) + IPuttable.__init__(self, Invoice) IPaginateable.__init__(self, Invoice) - self.payments = self._register_child_endpoint( - FinanceInvoicesIdPaymentsEndpoint(client, parent_endpoint=self) - ) - self.pdf = self._register_child_endpoint( - FinanceInvoicesIdPdfEndpoint(client, parent_endpoint=self) - ) + self.payments = self._register_child_endpoint(FinanceInvoicesIdPaymentsEndpoint(client, parent_endpoint=self)) + self.pdf = self._register_child_endpoint(FinanceInvoicesIdPdfEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Invoice]: """ Performs a GET request against the /finance/invoices/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +47,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Invoice, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Invoice, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Invoice: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/invoices/{id} endpoint. + Performs a DELETE request against the /finance/invoices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Invoice: The parsed response data. """ - return self._parse_one( - Invoice, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Invoice: """ - Performs a DELETE request against the /finance/invoices/{id} endpoint. + Performs a GET request against the /finance/invoices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Invoice: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Invoice, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Invoice: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Invoice: """ - Performs a PUT request against the /finance/invoices/{id} endpoint. + Performs a PATCH request against the /finance/invoices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +81,11 @@ def put( Returns: Invoice: The parsed response data. """ - return self._parse_one( - Invoice, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Invoice, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Invoice: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Invoice: """ - Performs a PATCH request against the /finance/invoices/{id} endpoint. + Performs a PUT request against the /finance/invoices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +93,4 @@ def patch( Returns: Invoice: The parsed response data. """ - return self._parse_one( - Invoice, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Invoice, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsEndpoint.py index 013175e63..a9eb59ed2 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsEndpoint.py @@ -1,53 +1,44 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceInvoicesIdPaymentsIdEndpoint import ( - FinanceInvoicesIdPaymentsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) -from pyconnectwise.models.manage import InvoicePayment +from pyconnectwise.endpoints.manage.FinanceInvoicesIdPaymentsIdEndpoint import FinanceInvoicesIdPaymentsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable +from pyconnectwise.models.manage import Payment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicesIdPaymentsEndpoint( ConnectWiseEndpoint, - IGettable[list[InvoicePayment], ConnectWiseManageRequestParams], - IPostable[InvoicePayment, ConnectWiseManageRequestParams], - IPaginateable[InvoicePayment, ConnectWiseManageRequestParams], + IGettable[list[Payment], ConnectWiseManageRequestParams], + IPostable[Payment, ConnectWiseManageRequestParams], + IPaginateable[Payment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "payments", parent_endpoint=parent_endpoint - ) - IGettable.__init__(self, list[InvoicePayment]) - IPostable.__init__(self, InvoicePayment) - IPaginateable.__init__(self, InvoicePayment) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "payments", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[Payment]) + IPostable.__init__(self, Payment) + IPaginateable.__init__(self, Payment) - def id(self, id: int) -> FinanceInvoicesIdPaymentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInvoicesIdPaymentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInvoicesIdPaymentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInvoicesIdPaymentsIdEndpoint: The initialized FinanceInvoicesIdPaymentsIdEndpoint object. """ child = FinanceInvoicesIdPaymentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaginatedResponse[InvoicePayment]: + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[Payment]: """ Performs a GET request against the /finance/invoices/{id}/payments endpoint and returns an initialized PaginatedResponse object. @@ -56,27 +47,16 @@ def paginated( page_size (int): The number of results to return per page. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - PaginatedResponse[InvoicePayment]: The initialized PaginatedResponse object. + PaginatedResponse[Payment]: The initialized PaginatedResponse object. """ if params: params["page"] = page params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - InvoicePayment, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Payment, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[InvoicePayment]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Payment]: """ Performs a GET request against the /finance/invoices/{id}/payments endpoint. @@ -84,18 +64,11 @@ def get( data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - list[InvoicePayment]: The parsed response data. + list[Payment]: The parsed response data. """ - return self._parse_many( - InvoicePayment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(Payment, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoicePayment: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Payment: """ Performs a POST request against the /finance/invoices/{id}/payments endpoint. @@ -103,9 +76,6 @@ def post( data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - InvoicePayment: The parsed response data. + Payment: The parsed response data. """ - return self._parse_one( - InvoicePayment, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(Payment, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsIdEndpoint.py index f44fa27e3..c0089438a 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPaymentsIdEndpoint.py @@ -1,41 +1,32 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) -from pyconnectwise.models.manage import InvoicePayment +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable +from pyconnectwise.models.manage import Payment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicesIdPaymentsIdEndpoint( ConnectWiseEndpoint, - IGettable[InvoicePayment, ConnectWiseManageRequestParams], - IPatchable[InvoicePayment, ConnectWiseManageRequestParams], - IPuttable[InvoicePayment, ConnectWiseManageRequestParams], - IPaginateable[InvoicePayment, ConnectWiseManageRequestParams], + IGettable[Payment, ConnectWiseManageRequestParams], + IPatchable[Payment, ConnectWiseManageRequestParams], + IPuttable[Payment, ConnectWiseManageRequestParams], + IPaginateable[Payment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - IGettable.__init__(self, InvoicePayment) - IPatchable.__init__(self, InvoicePayment) - IPuttable.__init__(self, InvoicePayment) - IPaginateable.__init__(self, InvoicePayment) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IGettable.__init__(self, Payment) + IPatchable.__init__(self, Payment) + IPuttable.__init__(self, Payment) + IPaginateable.__init__(self, Payment) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaginatedResponse[InvoicePayment]: + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[Payment]: """ Performs a GET request against the /finance/invoices/{id}/payments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,89 +35,57 @@ def paginated( page_size (int): The number of results to return per page. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - PaginatedResponse[InvoicePayment]: The initialized PaginatedResponse object. + PaginatedResponse[Payment]: The initialized PaginatedResponse object. """ if params: params["page"] = page params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - InvoicePayment, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Payment, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoicePayment: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/invoices/{id}/payments/{id} endpoint. + Performs a DELETE request against the /finance/invoices/{id}/payments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - InvoicePayment: The parsed response data. """ - return self._parse_one( - InvoicePayment, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoicePayment: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Payment: """ - Performs a PATCH request against the /finance/invoices/{id}/payments/{id} endpoint. + Performs a GET request against the /finance/invoices/{id}/payments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - InvoicePayment: The parsed response data. + Payment: The parsed response data. """ - return self._parse_one( - InvoicePayment, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(Payment, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoicePayment: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Payment: """ - Performs a PUT request against the /finance/invoices/{id}/payments/{id} endpoint. + Performs a PATCH request against the /finance/invoices/{id}/payments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - InvoicePayment: The parsed response data. + Payment: The parsed response data. """ - return self._parse_one( - InvoicePayment, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(Payment, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Payment: """ - Performs a DELETE request against the /finance/invoices/{id}/payments/{id} endpoint. + Performs a PUT request against the /finance/invoices/{id}/payments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Payment: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Payment, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPdfEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPdfEndpoint.py index ac21a314b..2c6716f2c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPdfEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicesIdPdfEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicesIdPdfEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "pdf", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "pdf", parent_endpoint=parent_endpoint) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a GET request against the /finance/invoices/{id}/pdf endpoint. diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesCountEndpoint.py index 4fbaaeba2..e5d4c1f5c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoicetemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/invoiceTemplates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/invoiceTemplates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesEndpoint.py index c3705f9e6..0d7d00e6e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesCountEndpoint import ( - FinanceInvoicetemplatesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesIdEndpoint import ( - FinanceInvoicetemplatesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesCountEndpoint import FinanceInvoicetemplatesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesIdEndpoint import FinanceInvoicetemplatesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import InvoiceTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesEndpoint( @@ -24,36 +18,29 @@ class FinanceInvoicetemplatesEndpoint( IPostable[InvoiceTemplate, ConnectWiseManageRequestParams], IPaginateable[InvoiceTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoiceTemplates", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "invoiceTemplates", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InvoiceTemplate]) IPostable.__init__(self, InvoiceTemplate) IPaginateable.__init__(self, InvoiceTemplate) - self.count = self._register_child_endpoint( - FinanceInvoicetemplatesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceInvoicetemplatesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceInvoicetemplatesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInvoicetemplatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInvoicetemplatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInvoicetemplatesIdEndpoint: The initialized FinanceInvoicetemplatesIdEndpoint object. """ child = FinanceInvoicetemplatesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceTemplate]: """ Performs a GET request against the /finance/invoiceTemplates endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceTemplate, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[InvoiceTemplate]: """ Performs a GET request against the /finance/invoiceTemplates endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[InvoiceTemplate]: The parsed response data. """ - return self._parse_many( - InvoiceTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(InvoiceTemplate, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoiceTemplate: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InvoiceTemplate: """ Performs a POST request against the /finance/invoiceTemplates endpoint. @@ -112,7 +85,4 @@ def post( Returns: InvoiceTemplate: The parsed response data. """ - return self._parse_one( - InvoiceTemplate, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(InvoiceTemplate, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdEndpoint.py index 168066eb3..7acadddf1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdEndpoint.py @@ -1,20 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesIdUsagesEndpoint import ( FinanceInvoicetemplatesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import InvoiceTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesIdEndpoint( @@ -24,10 +20,8 @@ class FinanceInvoicetemplatesIdEndpoint( IPuttable[InvoiceTemplate, ConnectWiseManageRequestParams], IPaginateable[InvoiceTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, InvoiceTemplate) IPatchable.__init__(self, InvoiceTemplate) IPuttable.__init__(self, InvoiceTemplate) @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceTemplate]: """ Performs a GET request against the /finance/invoiceTemplates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,40 +50,22 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoiceTemplate: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/invoiceTemplates/{id} endpoint. + Performs a DELETE request against the /finance/invoiceTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - InvoiceTemplate: The parsed response data. """ - return self._parse_one( - InvoiceTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoiceTemplate: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InvoiceTemplate: """ - Performs a PATCH request against the /finance/invoiceTemplates/{id} endpoint. + Performs a GET request against the /finance/invoiceTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -100,18 +73,11 @@ def patch( Returns: InvoiceTemplate: The parsed response data. """ - return self._parse_one( - InvoiceTemplate, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(InvoiceTemplate, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InvoiceTemplate: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> InvoiceTemplate: """ - Performs a PUT request against the /finance/invoiceTemplates/{id} endpoint. + Performs a PATCH request against the /finance/invoiceTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,21 +85,16 @@ def put( Returns: InvoiceTemplate: The parsed response data. """ - return self._parse_one( - InvoiceTemplate, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(InvoiceTemplate, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InvoiceTemplate: """ - Performs a DELETE request against the /finance/invoiceTemplates/{id} endpoint. + Performs a PUT request against the /finance/invoiceTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + InvoiceTemplate: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(InvoiceTemplate, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesEndpoint.py index 41327c404..65f17c7c4 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesIdUsagesListEndpoint import ( FinanceInvoicetemplatesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class FinanceInvoicetemplatesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/invoiceTemplates/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/invoiceTemplates/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesListEndpoint.py index dde3a5c2c..74300cb0b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoicetemplatesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/invoiceTemplates/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/invoiceTemplates/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsCountEndpoint.py index d8ea4231a..64dd2b4cd 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesetupsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoicetemplatesetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/invoiceTemplateSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/invoiceTemplateSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsEndpoint.py index 590b5859c..3450204ea 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesetupsCountEndpoint import ( FinanceInvoicetemplatesetupsCountEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesetupsIdEndpoint import ( - FinanceInvoicetemplatesetupsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceInvoicetemplatesetupsIdEndpoint import FinanceInvoicetemplatesetupsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InvoiceTemplateSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesetupsEndpoint( @@ -22,10 +19,8 @@ class FinanceInvoicetemplatesetupsEndpoint( IGettable[list[InvoiceTemplateSetup], ConnectWiseManageRequestParams], IPaginateable[InvoiceTemplateSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "invoiceTemplateSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "invoiceTemplateSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InvoiceTemplateSetup]) IPaginateable.__init__(self, InvoiceTemplateSetup) @@ -33,26 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceInvoicetemplatesetupsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceInvoicetemplatesetupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceInvoicetemplatesetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceInvoicetemplatesetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceInvoicetemplatesetupsIdEndpoint: The initialized FinanceInvoicetemplatesetupsIdEndpoint object. """ - child = FinanceInvoicetemplatesetupsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceInvoicetemplatesetupsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceTemplateSetup]: """ Performs a GET request against the /finance/invoiceTemplateSetups endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceTemplateSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceTemplateSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[InvoiceTemplateSetup]: """ Performs a GET request against the /finance/invoiceTemplateSetups endpoint. @@ -92,7 +75,4 @@ def get( Returns: list[InvoiceTemplateSetup]: The parsed response data. """ - return self._parse_many( - InvoiceTemplateSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(InvoiceTemplateSetup, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsIdEndpoint.py index 01f1a9de5..17bf0b5c8 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceInvoicetemplatesetupsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InvoiceTemplateSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceInvoicetemplatesetupsIdEndpoint( @@ -16,18 +15,13 @@ class FinanceInvoicetemplatesetupsIdEndpoint( IGettable[InvoiceTemplateSetup, ConnectWiseManageRequestParams], IPaginateable[InvoiceTemplateSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, InvoiceTemplateSetup) IPaginateable.__init__(self, InvoiceTemplateSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InvoiceTemplateSetup]: """ Performs a GET request against the /finance/invoiceTemplateSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InvoiceTemplateSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InvoiceTemplateSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> InvoiceTemplateSetup: """ Performs a GET request against the /finance/invoiceTemplateSetups/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: InvoiceTemplateSetup: The parsed response data. """ - return self._parse_one( - InvoiceTemplateSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(InvoiceTemplateSetup, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesCountEndpoint.py index e0105fb1c..9d0d9f42d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesEndpoint.py index 265c7aa21..2669bfce8 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceTaxcodesCountEndpoint import ( - FinanceTaxcodesCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceTaxcodesIdEndpoint import ( - FinanceTaxcodesIdEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceTaxcodesInfoEndpoint import ( - FinanceTaxcodesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.FinanceTaxcodesCountEndpoint import FinanceTaxcodesCountEndpoint +from pyconnectwise.endpoints.manage.FinanceTaxcodesIdEndpoint import FinanceTaxcodesIdEndpoint +from pyconnectwise.endpoints.manage.FinanceTaxcodesInfoEndpoint import FinanceTaxcodesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TaxCode from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesEndpoint( @@ -27,39 +19,30 @@ class FinanceTaxcodesEndpoint( IPostable[TaxCode, ConnectWiseManageRequestParams], IPaginateable[TaxCode, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxCodes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxCodes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxCode]) IPostable.__init__(self, TaxCode) IPaginateable.__init__(self, TaxCode) - self.count = self._register_child_endpoint( - FinanceTaxcodesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceTaxcodesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceTaxcodesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(FinanceTaxcodesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceTaxcodesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceTaxcodesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdEndpoint: The initialized FinanceTaxcodesIdEndpoint object. """ child = FinanceTaxcodesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCode]: """ Performs a GET request against the /finance/taxCodes endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCode, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TaxCode, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TaxCode]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TaxCode]: """ Performs a GET request against the /finance/taxCodes endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[TaxCode]: The parsed response data. """ - return self._parse_many( - TaxCode, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TaxCode, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCode: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCode: """ Performs a POST request against the /finance/taxCodes endpoint. @@ -117,6 +83,4 @@ def post( Returns: TaxCode: The parsed response data. """ - return self._parse_one( - TaxCode, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TaxCode, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdCopyEndpoint.py index b17ea52eb..0c35fd29c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdCopyEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import TaxCode -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class FinanceTaxcodesIdCopyEndpoint( - ConnectWiseEndpoint, IPostable[TaxCode, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) +class FinanceTaxcodesIdCopyEndpoint(ConnectWiseEndpoint, IPostable[TaxCode, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, TaxCode) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCode: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCode: """ Performs a POST request against the /finance/taxCodes/{id}/copy endpoint. @@ -32,6 +24,4 @@ def post( Returns: TaxCode: The parsed response data. """ - return self._parse_one( - TaxCode, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TaxCode, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdEndpoint.py index 076ba8402..02812a551 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdEndpoint.py @@ -1,74 +1,48 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceTaxcodesIdCopyEndpoint import ( - FinanceTaxcodesIdCopyEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceTaxcodesIdCopyEndpoint import FinanceTaxcodesIdCopyEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdExpensetypeexemptionsEndpoint import ( FinanceTaxcodesIdExpensetypeexemptionsEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceTaxcodesIdInfoEndpoint import ( - FinanceTaxcodesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceTaxcodesIdInfoEndpoint import FinanceTaxcodesIdInfoEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdProducttypeexemptionsEndpoint import ( FinanceTaxcodesIdProducttypeexemptionsEndpoint, ) -from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodelevelsEndpoint import ( - FinanceTaxcodesIdTaxcodelevelsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodexrefsEndpoint import ( - FinanceTaxcodesIdTaxcodexrefsEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceTaxcodesIdUsagesEndpoint import ( - FinanceTaxcodesIdUsagesEndpoint, -) +from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodelevelsEndpoint import FinanceTaxcodesIdTaxcodelevelsEndpoint +from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodexrefsEndpoint import FinanceTaxcodesIdTaxcodexrefsEndpoint +from pyconnectwise.endpoints.manage.FinanceTaxcodesIdUsagesEndpoint import FinanceTaxcodesIdUsagesEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdWorkroleexemptionsEndpoint import ( FinanceTaxcodesIdWorkroleexemptionsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxCode from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdEndpoint( ConnectWiseEndpoint, IGettable[TaxCode, ConnectWiseManageRequestParams], - IPuttable[TaxCode, ConnectWiseManageRequestParams], IPatchable[TaxCode, ConnectWiseManageRequestParams], + IPuttable[TaxCode, ConnectWiseManageRequestParams], IPaginateable[TaxCode, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxCode) - IPuttable.__init__(self, TaxCode) IPatchable.__init__(self, TaxCode) + IPuttable.__init__(self, TaxCode) IPaginateable.__init__(self, TaxCode) - self.copy = self._register_child_endpoint( - FinanceTaxcodesIdCopyEndpoint(client, parent_endpoint=self) - ) - self.work_role_exemptions = self._register_child_endpoint( - FinanceTaxcodesIdWorkroleexemptionsEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - FinanceTaxcodesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(FinanceTaxcodesIdCopyEndpoint(client, parent_endpoint=self)) self.expense_type_exemptions = self._register_child_endpoint( FinanceTaxcodesIdExpensetypeexemptionsEndpoint(client, parent_endpoint=self) ) - self.usages = self._register_child_endpoint( - FinanceTaxcodesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(FinanceTaxcodesIdInfoEndpoint(client, parent_endpoint=self)) self.product_type_exemptions = self._register_child_endpoint( FinanceTaxcodesIdProducttypeexemptionsEndpoint(client, parent_endpoint=self) ) @@ -78,12 +52,13 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 self.tax_code_x_refs = self._register_child_endpoint( FinanceTaxcodesIdTaxcodexrefsEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint(FinanceTaxcodesIdUsagesEndpoint(client, parent_endpoint=self)) + self.work_role_exemptions = self._register_child_endpoint( + FinanceTaxcodesIdWorkroleexemptionsEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCode]: """ Performs a GET request against the /finance/taxCodes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -100,54 +75,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCode, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TaxCode, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCode: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TaxCode: The parsed response data. """ - return self._parse_one( - TaxCode, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCode: """ - Performs a DELETE request against the /finance/taxCodes/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TaxCode: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TaxCode, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCode: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TaxCode: """ - Performs a PUT request against the /finance/taxCodes/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -155,17 +109,11 @@ def put( Returns: TaxCode: The parsed response data. """ - return self._parse_one( - TaxCode, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TaxCode, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCode: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCode: """ - Performs a PATCH request against the /finance/taxCodes/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -173,6 +121,4 @@ def patch( Returns: TaxCode: The parsed response data. """ - return self._parse_one( - TaxCode, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TaxCode, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint.py index 071ae9194..704d68915 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsEndpoint.py index d191cb1d5..4aff026aa 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint import ( FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint import ( FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ExpenseTypeExemption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdExpensetypeexemptionsEndpoint( @@ -24,42 +22,31 @@ class FinanceTaxcodesIdExpensetypeexemptionsEndpoint( IPostable[ExpenseTypeExemption, ConnectWiseManageRequestParams], IPaginateable[ExpenseTypeExemption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "expenseTypeExemptions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "expenseTypeExemptions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ExpenseTypeExemption]) IPostable.__init__(self, ExpenseTypeExemption) IPaginateable.__init__(self, ExpenseTypeExemption) self.count = self._register_child_endpoint( - FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdExpensetypeexemptionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint: + def id(self, _id: int) -> FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint: The initialized FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint object. """ - child = FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseTypeExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseTypeExemption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseTypeExemption, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ExpenseTypeExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions endpoint. @@ -99,15 +79,10 @@ def get( Returns: list[ExpenseTypeExemption]: The parsed response data. """ - return self._parse_many( - ExpenseTypeExemption, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ExpenseTypeExemption, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ExpenseTypeExemption: """ Performs a POST request against the /finance/taxCodes/{id}/expenseTypeExemptions endpoint. @@ -118,7 +93,4 @@ def post( Returns: ExpenseTypeExemption: The parsed response data. """ - return self._parse_one( - ExpenseTypeExemption, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ExpenseTypeExemption, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint.py index c800eefa1..28553a764 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint import ( FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ExpenseTypeExemption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdExpensetypeexemptionsIdEndpoint( ConnectWiseEndpoint, IGettable[ExpenseTypeExemption, ConnectWiseManageRequestParams], - IPuttable[ExpenseTypeExemption, ConnectWiseManageRequestParams], IPatchable[ExpenseTypeExemption, ConnectWiseManageRequestParams], + IPuttable[ExpenseTypeExemption, ConnectWiseManageRequestParams], IPaginateable[ExpenseTypeExemption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ExpenseTypeExemption) - IPuttable.__init__(self, ExpenseTypeExemption) IPatchable.__init__(self, ExpenseTypeExemption) + IPuttable.__init__(self, ExpenseTypeExemption) IPaginateable.__init__(self, ExpenseTypeExemption) self.taxable_expense_type_levels = self._register_child_endpoint( - FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ExpenseTypeExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ExpenseTypeExemption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ExpenseTypeExemption, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ExpenseTypeExemption: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ExpenseTypeExemption: The parsed response data. """ - return self._parse_one( - ExpenseTypeExemption, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ExpenseTypeExemption: """ - Performs a DELETE request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ExpenseTypeExemption: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ExpenseTypeExemption, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ExpenseTypeExemption: """ - Performs a PUT request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -116,18 +89,13 @@ def put( Returns: ExpenseTypeExemption: The parsed response data. """ - return self._parse_one( - ExpenseTypeExemption, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ExpenseTypeExemption, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ExpenseTypeExemption: """ - Performs a PATCH request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,7 +103,4 @@ def patch( Returns: ExpenseTypeExemption: The parsed response data. """ - return self._parse_one( - ExpenseTypeExemption, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ExpenseTypeExemption, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint.py index f1aedcc9f..e644fe330 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpo IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint.py index f16db0d08..e8a0ca9f1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint import ( FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint import ( FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TaxableExpenseTypeLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint( @@ -24,44 +22,33 @@ class FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsEndpoint( IPostable[TaxableExpenseTypeLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableExpenseTypeLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxableExpenseTypeLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxableExpenseTypeLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxableExpenseTypeLevel]) IPostable.__init__(self, TaxableExpenseTypeLevel) IPaginateable.__init__(self, TaxableExpenseTypeLevel) self.count = self._register_child_endpoint( - FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint: + def id(self, _id: int) -> FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint: The initialized FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint object. """ - child = ( - FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint( - self.client, parent_endpoint=self - ) + child = FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint( + self.client, parent_endpoint=self ) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableExpenseTypeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels endpoint and returns an initialized PaginatedResponse object. @@ -79,18 +66,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableExpenseTypeLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableExpenseTypeLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TaxableExpenseTypeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels endpoint. @@ -101,15 +81,10 @@ def get( Returns: list[TaxableExpenseTypeLevel]: The parsed response data. """ - return self._parse_many( - TaxableExpenseTypeLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TaxableExpenseTypeLevel, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TaxableExpenseTypeLevel: """ Performs a POST request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels endpoint. @@ -120,7 +95,4 @@ def post( Returns: TaxableExpenseTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableExpenseTypeLevel, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TaxableExpenseTypeLevel, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint.py index c6ce73423..dba118529 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxableExpenseTypeLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdExpensetypeexemptionsIdTaxableexpensetypelevelsIdEndpoint( ConnectWiseEndpoint, IGettable[TaxableExpenseTypeLevel, ConnectWiseManageRequestParams], - IPuttable[TaxableExpenseTypeLevel, ConnectWiseManageRequestParams], IPatchable[TaxableExpenseTypeLevel, ConnectWiseManageRequestParams], + IPuttable[TaxableExpenseTypeLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableExpenseTypeLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxableExpenseTypeLevel) - IPuttable.__init__(self, TaxableExpenseTypeLevel) IPatchable.__init__(self, TaxableExpenseTypeLevel) + IPuttable.__init__(self, TaxableExpenseTypeLevel) IPaginateable.__init__(self, TaxableExpenseTypeLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableExpenseTypeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableExpenseTypeLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableExpenseTypeLevel, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxableExpenseTypeLevel: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TaxableExpenseTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableExpenseTypeLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> TaxableExpenseTypeLevel: """ - Performs a DELETE request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TaxableExpenseTypeLevel: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TaxableExpenseTypeLevel, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> TaxableExpenseTypeLevel: """ - Performs a PUT request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: TaxableExpenseTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableExpenseTypeLevel, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TaxableExpenseTypeLevel, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TaxableExpenseTypeLevel: """ - Performs a PATCH request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/expenseTypeExemptions/{id}/taxableExpenseTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: TaxableExpenseTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableExpenseTypeLevel, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TaxableExpenseTypeLevel, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdInfoEndpoint.py index ae816f6a3..1d1b593d1 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TaxCodeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdInfoEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdInfoEndpoint( IGettable[TaxCodeInfo, ConnectWiseManageRequestParams], IPaginateable[TaxCodeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxCodeInfo) IPaginateable.__init__(self, TaxCodeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCodeInfo]: """ Performs a GET request against the /finance/taxCodes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCodeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxCodeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeInfo: """ Performs a GET request against the /finance/taxCodes/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: TaxCodeInfo: The parsed response data. """ - return self._parse_one( - TaxCodeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(TaxCodeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsCountEndpoint.py index 77b03998f..02fdbbc09 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdProducttypeexemptionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdProducttypeexemptionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsEndpoint.py index cf02b144e..f42c8596d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdProducttypeexemptionsCountEndpoint import ( FinanceTaxcodesIdProducttypeexemptionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdProducttypeexemptionsIdEndpoint import ( FinanceTaxcodesIdProducttypeexemptionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProductTypeExemption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdProducttypeexemptionsEndpoint( @@ -24,42 +22,31 @@ class FinanceTaxcodesIdProducttypeexemptionsEndpoint( IPostable[ProductTypeExemption, ConnectWiseManageRequestParams], IPaginateable[ProductTypeExemption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "productTypeExemptions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "productTypeExemptions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductTypeExemption]) IPostable.__init__(self, ProductTypeExemption) IPaginateable.__init__(self, ProductTypeExemption) self.count = self._register_child_endpoint( - FinanceTaxcodesIdProducttypeexemptionsCountEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdProducttypeexemptionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceTaxcodesIdProducttypeexemptionsIdEndpoint: + def id(self, _id: int) -> FinanceTaxcodesIdProducttypeexemptionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdProducttypeexemptionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdProducttypeexemptionsIdEndpoint: The initialized FinanceTaxcodesIdProducttypeexemptionsIdEndpoint object. """ - child = FinanceTaxcodesIdProducttypeexemptionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceTaxcodesIdProducttypeexemptionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductTypeExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductTypeExemption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductTypeExemption, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductTypeExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions endpoint. @@ -99,15 +79,10 @@ def get( Returns: list[ProductTypeExemption]: The parsed response data. """ - return self._parse_many( - ProductTypeExemption, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProductTypeExemption, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProductTypeExemption: """ Performs a POST request against the /finance/taxCodes/{id}/productTypeExemptions endpoint. @@ -118,7 +93,4 @@ def post( Returns: ProductTypeExemption: The parsed response data. """ - return self._parse_one( - ProductTypeExemption, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProductTypeExemption, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdEndpoint.py index 7902d3612..da86ec2e2 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint import ( FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProductTypeExemption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdProducttypeexemptionsIdEndpoint( ConnectWiseEndpoint, IGettable[ProductTypeExemption, ConnectWiseManageRequestParams], - IPuttable[ProductTypeExemption, ConnectWiseManageRequestParams], IPatchable[ProductTypeExemption, ConnectWiseManageRequestParams], + IPuttable[ProductTypeExemption, ConnectWiseManageRequestParams], IPaginateable[ProductTypeExemption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProductTypeExemption) - IPuttable.__init__(self, ProductTypeExemption) IPatchable.__init__(self, ProductTypeExemption) + IPuttable.__init__(self, ProductTypeExemption) IPaginateable.__init__(self, ProductTypeExemption) self.taxable_product_type_levels = self._register_child_endpoint( - FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductTypeExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductTypeExemption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductTypeExemption, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductTypeExemption: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProductTypeExemption: The parsed response data. """ - return self._parse_one( - ProductTypeExemption, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ProductTypeExemption: """ - Performs a DELETE request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProductTypeExemption: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProductTypeExemption, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ProductTypeExemption: """ - Performs a PUT request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -116,18 +89,13 @@ def put( Returns: ProductTypeExemption: The parsed response data. """ - return self._parse_one( - ProductTypeExemption, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ProductTypeExemption, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProductTypeExemption: """ - Performs a PATCH request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/productTypeExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,7 +103,4 @@ def patch( Returns: ProductTypeExemption: The parsed response data. """ - return self._parse_one( - ProductTypeExemption, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProductTypeExemption, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint.py index 98298f30d..a3647607d 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpo IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint.py index 20413cb8f..a745802a6 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint import ( FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint import ( FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TaxableProductTypeLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint( @@ -24,44 +22,33 @@ class FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsEndpoint( IPostable[TaxableProductTypeLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableProductTypeLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxableProductTypeLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxableProductTypeLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxableProductTypeLevel]) IPostable.__init__(self, TaxableProductTypeLevel) IPaginateable.__init__(self, TaxableProductTypeLevel) self.count = self._register_child_endpoint( - FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint: + def id(self, _id: int) -> FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint: The initialized FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint object. """ - child = ( - FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint( - self.client, parent_endpoint=self - ) + child = FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint( + self.client, parent_endpoint=self ) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableProductTypeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels endpoint and returns an initialized PaginatedResponse object. @@ -79,18 +66,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableProductTypeLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableProductTypeLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TaxableProductTypeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels endpoint. @@ -101,15 +81,10 @@ def get( Returns: list[TaxableProductTypeLevel]: The parsed response data. """ - return self._parse_many( - TaxableProductTypeLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TaxableProductTypeLevel, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TaxableProductTypeLevel: """ Performs a POST request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels endpoint. @@ -120,7 +95,4 @@ def post( Returns: TaxableProductTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableProductTypeLevel, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TaxableProductTypeLevel, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint.py index 08f8223e4..f21b85489 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxableProductTypeLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdProducttypeexemptionsIdTaxableproducttypelevelsIdEndpoint( ConnectWiseEndpoint, IGettable[TaxableProductTypeLevel, ConnectWiseManageRequestParams], - IPuttable[TaxableProductTypeLevel, ConnectWiseManageRequestParams], IPatchable[TaxableProductTypeLevel, ConnectWiseManageRequestParams], + IPuttable[TaxableProductTypeLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableProductTypeLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxableProductTypeLevel) - IPuttable.__init__(self, TaxableProductTypeLevel) IPatchable.__init__(self, TaxableProductTypeLevel) + IPuttable.__init__(self, TaxableProductTypeLevel) IPaginateable.__init__(self, TaxableProductTypeLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableProductTypeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableProductTypeLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableProductTypeLevel, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxableProductTypeLevel: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TaxableProductTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableProductTypeLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> TaxableProductTypeLevel: """ - Performs a DELETE request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TaxableProductTypeLevel: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TaxableProductTypeLevel, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> TaxableProductTypeLevel: """ - Performs a PUT request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: TaxableProductTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableProductTypeLevel, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TaxableProductTypeLevel, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TaxableProductTypeLevel: """ - Performs a PATCH request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/productTypeExemptions/{id}/taxableProductTypeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: TaxableProductTypeLevel: The parsed response data. """ - return self._parse_one( - TaxableProductTypeLevel, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TaxableProductTypeLevel, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsCountEndpoint.py index 6f137e1f7..51cc538e5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodelevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdTaxcodelevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsEndpoint.py index 9aa3fe676..ff32ac222 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodelevelsCountEndpoint import ( FinanceTaxcodesIdTaxcodelevelsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodelevelsIdEndpoint import ( FinanceTaxcodesIdTaxcodelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TaxCodeLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodelevelsEndpoint( @@ -24,10 +22,8 @@ class FinanceTaxcodesIdTaxcodelevelsEndpoint( IPostable[TaxCodeLevel, ConnectWiseManageRequestParams], IPaginateable[TaxCodeLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxCodeLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxCodeLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxCodeLevel]) IPostable.__init__(self, TaxCodeLevel) IPaginateable.__init__(self, TaxCodeLevel) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceTaxcodesIdTaxcodelevelsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceTaxcodesIdTaxcodelevelsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceTaxcodesIdTaxcodelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdTaxcodelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdTaxcodelevelsIdEndpoint: The initialized FinanceTaxcodesIdTaxcodelevelsIdEndpoint object. """ - child = FinanceTaxcodesIdTaxcodelevelsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceTaxcodesIdTaxcodelevelsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCodeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeLevels endpoint and returns an initialized PaginatedResponse object. @@ -73,19 +64,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCodeLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxCodeLevel, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TaxCodeLevel]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TaxCodeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeLevels endpoint. @@ -95,15 +77,9 @@ def get( Returns: list[TaxCodeLevel]: The parsed response data. """ - return self._parse_many( - TaxCodeLevel, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TaxCodeLevel, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeLevel: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeLevel: """ Performs a POST request against the /finance/taxCodes/{id}/taxCodeLevels endpoint. @@ -113,6 +89,4 @@ def post( Returns: TaxCodeLevel: The parsed response data. """ - return self._parse_one( - TaxCodeLevel, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TaxCodeLevel, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsIdEndpoint.py index f93226623..7eff8712b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodelevelsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxCodeLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodelevelsIdEndpoint( ConnectWiseEndpoint, IGettable[TaxCodeLevel, ConnectWiseManageRequestParams], - IPuttable[TaxCodeLevel, ConnectWiseManageRequestParams], IPatchable[TaxCodeLevel, ConnectWiseManageRequestParams], + IPuttable[TaxCodeLevel, ConnectWiseManageRequestParams], IPaginateable[TaxCodeLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxCodeLevel) - IPuttable.__init__(self, TaxCodeLevel) IPatchable.__init__(self, TaxCodeLevel) + IPuttable.__init__(self, TaxCodeLevel) IPaginateable.__init__(self, TaxCodeLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCodeLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCodeLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxCodeLevel, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeLevel: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TaxCodeLevel: The parsed response data. """ - return self._parse_one( - TaxCodeLevel, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeLevel: """ - Performs a DELETE request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TaxCodeLevel: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TaxCodeLevel, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeLevel: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeLevel: """ - Performs a PUT request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: TaxCodeLevel: The parsed response data. """ - return self._parse_one( - TaxCodeLevel, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TaxCodeLevel, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeLevel: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeLevel: """ - Performs a PATCH request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/taxCodeLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: TaxCodeLevel: The parsed response data. """ - return self._parse_one( - TaxCodeLevel, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TaxCodeLevel, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsCountEndpoint.py index 2e0a34aa0..aeb3c1c99 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodexrefsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdTaxcodexrefsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsEndpoint.py index d65b7590f..12bd943b0 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodexrefsCountEndpoint import ( FinanceTaxcodesIdTaxcodexrefsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodexrefsIdEndpoint import ( FinanceTaxcodesIdTaxcodexrefsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TaxCodeXRef from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodexrefsEndpoint( @@ -24,10 +22,8 @@ class FinanceTaxcodesIdTaxcodexrefsEndpoint( IPostable[TaxCodeXRef, ConnectWiseManageRequestParams], IPaginateable[TaxCodeXRef, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxCodeXRefs", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxCodeXRefs", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxCodeXRef]) IPostable.__init__(self, TaxCodeXRef) IPaginateable.__init__(self, TaxCodeXRef) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 FinanceTaxcodesIdTaxcodexrefsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> FinanceTaxcodesIdTaxcodexrefsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceTaxcodesIdTaxcodexrefsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdTaxcodexrefsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdTaxcodexrefsIdEndpoint: The initialized FinanceTaxcodesIdTaxcodexrefsIdEndpoint object. """ - child = FinanceTaxcodesIdTaxcodexrefsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceTaxcodesIdTaxcodexrefsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCodeXRef]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs endpoint and returns an initialized PaginatedResponse object. @@ -73,19 +64,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCodeXRef, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxCodeXRef, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TaxCodeXRef]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TaxCodeXRef]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs endpoint. @@ -95,15 +77,9 @@ def get( Returns: list[TaxCodeXRef]: The parsed response data. """ - return self._parse_many( - TaxCodeXRef, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TaxCodeXRef, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeXRef: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeXRef: """ Performs a POST request against the /finance/taxCodes/{id}/taxCodeXRefs endpoint. @@ -113,6 +89,4 @@ def post( Returns: TaxCodeXRef: The parsed response data. """ - return self._parse_one( - TaxCodeXRef, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TaxCodeXRef, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdEndpoint.py index 4d1784c42..74ebe76c0 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint import ( FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxCodeXRef from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodexrefsIdEndpoint( ConnectWiseEndpoint, IGettable[TaxCodeXRef, ConnectWiseManageRequestParams], - IPuttable[TaxCodeXRef, ConnectWiseManageRequestParams], IPatchable[TaxCodeXRef, ConnectWiseManageRequestParams], + IPuttable[TaxCodeXRef, ConnectWiseManageRequestParams], IPaginateable[TaxCodeXRef, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxCodeXRef) - IPuttable.__init__(self, TaxCodeXRef) IPatchable.__init__(self, TaxCodeXRef) + IPuttable.__init__(self, TaxCodeXRef) IPaginateable.__init__(self, TaxCodeXRef) self.taxable_x_ref_levels = self._register_child_endpoint( - FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCodeXRef]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCodeXRef, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxCodeXRef, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeXRef: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TaxCodeXRef: The parsed response data. """ - return self._parse_one( - TaxCodeXRef, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeXRef: """ - Performs a DELETE request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TaxCodeXRef: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TaxCodeXRef, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeXRef: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeXRef: """ - Performs a PUT request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -115,17 +85,11 @@ def put( Returns: TaxCodeXRef: The parsed response data. """ - return self._parse_one( - TaxCodeXRef, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TaxCodeXRef, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxCodeXRef: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxCodeXRef: """ - Performs a PATCH request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/taxCodeXRefs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,6 +97,4 @@ def patch( Returns: TaxCodeXRef: The parsed response data. """ - return self._parse_one( - TaxCodeXRef, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TaxCodeXRef, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint.py index 83cb2c200..26eb50cd5 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint.py index 5497f748e..92d45f21e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint import ( FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint import ( FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TaxableXRefLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint( @@ -24,42 +22,31 @@ class FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsEndpoint( IPostable[TaxableXRefLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableXRefLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxableXRefLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxableXRefLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxableXRefLevel]) IPostable.__init__(self, TaxableXRefLevel) IPaginateable.__init__(self, TaxableXRefLevel) self.count = self._register_child_endpoint( - FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint: + def id(self, _id: int) -> FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint: The initialized FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint object. """ - child = FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableXRefLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableXRefLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableXRefLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TaxableXRefLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels endpoint. @@ -99,16 +79,9 @@ def get( Returns: list[TaxableXRefLevel]: The parsed response data. """ - return self._parse_many( - TaxableXRefLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TaxableXRefLevel, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxableXRefLevel: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxableXRefLevel: """ Performs a POST request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels endpoint. @@ -118,7 +91,4 @@ def post( Returns: TaxableXRefLevel: The parsed response data. """ - return self._parse_one( - TaxableXRefLevel, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TaxableXRefLevel, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint.py index d05ea6f9d..d7aca9357 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxableXRefLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdTaxcodexrefsIdTaxablexreflevelsIdEndpoint( ConnectWiseEndpoint, IGettable[TaxableXRefLevel, ConnectWiseManageRequestParams], - IPuttable[TaxableXRefLevel, ConnectWiseManageRequestParams], IPatchable[TaxableXRefLevel, ConnectWiseManageRequestParams], + IPuttable[TaxableXRefLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableXRefLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxableXRefLevel) - IPuttable.__init__(self, TaxableXRefLevel) IPatchable.__init__(self, TaxableXRefLevel) + IPuttable.__init__(self, TaxableXRefLevel) IPaginateable.__init__(self, TaxableXRefLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableXRefLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableXRefLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableXRefLevel, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxableXRefLevel: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TaxableXRefLevel: The parsed response data. """ - return self._parse_one( - TaxableXRefLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxableXRefLevel: """ - Performs a DELETE request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TaxableXRefLevel: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TaxableXRefLevel, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxableXRefLevel: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TaxableXRefLevel: """ - Performs a PUT request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: TaxableXRefLevel: The parsed response data. """ - return self._parse_one( - TaxableXRefLevel, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TaxableXRefLevel, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxableXRefLevel: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxableXRefLevel: """ - Performs a PATCH request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/taxCodeXRefs/{id}/taxableXRefLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: TaxableXRefLevel: The parsed response data. """ - return self._parse_one( - TaxableXRefLevel, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TaxableXRefLevel, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesEndpoint.py index c5a11ab6e..fa485630c 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceTaxcodesIdUsagesListEndpoint import ( - FinanceTaxcodesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceTaxcodesIdUsagesListEndpoint import FinanceTaxcodesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class FinanceTaxcodesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - FinanceTaxcodesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(FinanceTaxcodesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/taxCodes/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/taxCodes/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesListEndpoint.py index 65454ee6d..a28d4097b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /finance/taxCodes/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /finance/taxCodes/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsCountEndpoint.py index c4d934600..67c1d0d37 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdWorkroleexemptionsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdWorkroleexemptionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsEndpoint.py index 06f16e6f2..dae6c333b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdWorkroleexemptionsCountEndpoint import ( FinanceTaxcodesIdWorkroleexemptionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdWorkroleexemptionsIdEndpoint import ( FinanceTaxcodesIdWorkroleexemptionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WorkRoleExemption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdWorkroleexemptionsEndpoint( @@ -24,42 +22,31 @@ class FinanceTaxcodesIdWorkroleexemptionsEndpoint( IPostable[WorkRoleExemption, ConnectWiseManageRequestParams], IPaginateable[WorkRoleExemption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workRoleExemptions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workRoleExemptions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkRoleExemption]) IPostable.__init__(self, WorkRoleExemption) IPaginateable.__init__(self, WorkRoleExemption) self.count = self._register_child_endpoint( - FinanceTaxcodesIdWorkroleexemptionsCountEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdWorkroleexemptionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceTaxcodesIdWorkroleexemptionsIdEndpoint: + def id(self, _id: int) -> FinanceTaxcodesIdWorkroleexemptionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdWorkroleexemptionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdWorkroleexemptionsIdEndpoint: The initialized FinanceTaxcodesIdWorkroleexemptionsIdEndpoint object. """ - child = FinanceTaxcodesIdWorkroleexemptionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceTaxcodesIdWorkroleexemptionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRoleExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRoleExemption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkRoleExemption, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkRoleExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions endpoint. @@ -99,16 +79,9 @@ def get( Returns: list[WorkRoleExemption]: The parsed response data. """ - return self._parse_many( - WorkRoleExemption, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkRoleExemption, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleExemption: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleExemption: """ Performs a POST request against the /finance/taxCodes/{id}/workRoleExemptions endpoint. @@ -118,7 +91,4 @@ def post( Returns: WorkRoleExemption: The parsed response data. """ - return self._parse_one( - WorkRoleExemption, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(WorkRoleExemption, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdEndpoint.py index e42fb7973..0a9350c7b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint import ( FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WorkRoleExemption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdWorkroleexemptionsIdEndpoint( ConnectWiseEndpoint, IGettable[WorkRoleExemption, ConnectWiseManageRequestParams], - IPuttable[WorkRoleExemption, ConnectWiseManageRequestParams], IPatchable[WorkRoleExemption, ConnectWiseManageRequestParams], + IPuttable[WorkRoleExemption, ConnectWiseManageRequestParams], IPaginateable[WorkRoleExemption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkRoleExemption) - IPuttable.__init__(self, WorkRoleExemption) IPatchable.__init__(self, WorkRoleExemption) + IPuttable.__init__(self, WorkRoleExemption) IPaginateable.__init__(self, WorkRoleExemption) self.taxable_work_role_levels = self._register_child_endpoint( - FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRoleExemption]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRoleExemption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkRoleExemption, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleExemption: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WorkRoleExemption: The parsed response data. """ - return self._parse_one( - WorkRoleExemption, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleExemption: """ - Performs a DELETE request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WorkRoleExemption: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(WorkRoleExemption, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleExemption: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleExemption: """ - Performs a PUT request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -116,18 +85,11 @@ def put( Returns: WorkRoleExemption: The parsed response data. """ - return self._parse_one( - WorkRoleExemption, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(WorkRoleExemption, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleExemption: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleExemption: """ - Performs a PATCH request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/workRoleExemptions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,7 +97,4 @@ def patch( Returns: WorkRoleExemption: The parsed response data. """ - return self._parse_one( - WorkRoleExemption, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(WorkRoleExemption, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint.py index 1226ede1c..b3d5bb686 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint.py index b3866ace8..3fa441261 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint import ( FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint import ( FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TaxableWorkRoleLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint( @@ -24,42 +22,31 @@ class FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsEndpoint( IPostable[TaxableWorkRoleLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableWorkRoleLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxableWorkRoleLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxableWorkRoleLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxableWorkRoleLevel]) IPostable.__init__(self, TaxableWorkRoleLevel) IPaginateable.__init__(self, TaxableWorkRoleLevel) self.count = self._register_child_endpoint( - FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint( - client, parent_endpoint=self - ) + FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint: + def id(self, _id: int) -> FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint: The initialized FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint object. """ - child = FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableWorkRoleLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableWorkRoleLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableWorkRoleLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TaxableWorkRoleLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels endpoint. @@ -99,15 +79,10 @@ def get( Returns: list[TaxableWorkRoleLevel]: The parsed response data. """ - return self._parse_many( - TaxableWorkRoleLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TaxableWorkRoleLevel, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TaxableWorkRoleLevel: """ Performs a POST request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels endpoint. @@ -118,7 +93,4 @@ def post( Returns: TaxableWorkRoleLevel: The parsed response data. """ - return self._parse_one( - TaxableWorkRoleLevel, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TaxableWorkRoleLevel, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint.py index 18e27c59e..3d8bfa933 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxableWorkRoleLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesIdWorkroleexemptionsIdTaxableworkrolelevelsIdEndpoint( ConnectWiseEndpoint, IGettable[TaxableWorkRoleLevel, ConnectWiseManageRequestParams], - IPuttable[TaxableWorkRoleLevel, ConnectWiseManageRequestParams], IPatchable[TaxableWorkRoleLevel, ConnectWiseManageRequestParams], + IPuttable[TaxableWorkRoleLevel, ConnectWiseManageRequestParams], IPaginateable[TaxableWorkRoleLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxableWorkRoleLevel) - IPuttable.__init__(self, TaxableWorkRoleLevel) IPatchable.__init__(self, TaxableWorkRoleLevel) + IPuttable.__init__(self, TaxableWorkRoleLevel) IPaginateable.__init__(self, TaxableWorkRoleLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxableWorkRoleLevel]: """ Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxableWorkRoleLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxableWorkRoleLevel, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxableWorkRoleLevel: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. + Performs a DELETE request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TaxableWorkRoleLevel: The parsed response data. """ - return self._parse_one( - TaxableWorkRoleLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> TaxableWorkRoleLevel: """ - Performs a DELETE request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. + Performs a GET request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TaxableWorkRoleLevel: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TaxableWorkRoleLevel, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> TaxableWorkRoleLevel: """ - Performs a PUT request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. + Performs a PATCH request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: TaxableWorkRoleLevel: The parsed response data. """ - return self._parse_one( - TaxableWorkRoleLevel, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TaxableWorkRoleLevel, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TaxableWorkRoleLevel: """ - Performs a PATCH request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. + Performs a PUT request against the /finance/taxCodes/{id}/workRoleExemptions/{id}/taxableWorkRoleLevels/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: TaxableWorkRoleLevel: The parsed response data. """ - return self._parse_one( - TaxableWorkRoleLevel, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TaxableWorkRoleLevel, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoCountEndpoint.py index da33fcdf8..48e8cb55b 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesInfoCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxcodesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxCodes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxCodes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoEndpoint.py index 6812ef64c..10db7ce47 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxcodesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceTaxcodesInfoCountEndpoint import ( - FinanceTaxcodesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceTaxcodesInfoCountEndpoint import FinanceTaxcodesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TaxCodeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxcodesInfoEndpoint( @@ -19,22 +16,15 @@ class FinanceTaxcodesInfoEndpoint( IGettable[list[TaxCodeInfo], ConnectWiseManageRequestParams], IPaginateable[TaxCodeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxCodeInfo]) IPaginateable.__init__(self, TaxCodeInfo) - self.count = self._register_child_endpoint( - FinanceTaxcodesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceTaxcodesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxCodeInfo]: """ Performs a GET request against the /finance/taxCodes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxCodeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxCodeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TaxCodeInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TaxCodeInfo]: """ Performs a GET request against the /finance/taxCodes/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[TaxCodeInfo]: The parsed response data. """ - return self._parse_many( - TaxCodeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TaxCodeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsCountEndpoint.py index 509c69cfa..ca7916e9e 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxintegrationsCountEndpoint( @@ -16,18 +15,13 @@ class FinanceTaxintegrationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /finance/taxIntegrations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /finance/taxIntegrations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsEndpoint.py index 68d0a1617..eda8dae13 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.FinanceTaxintegrationsCountEndpoint import ( - FinanceTaxintegrationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.FinanceTaxintegrationsIdEndpoint import ( - FinanceTaxintegrationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.FinanceTaxintegrationsCountEndpoint import FinanceTaxintegrationsCountEndpoint +from pyconnectwise.endpoints.manage.FinanceTaxintegrationsIdEndpoint import FinanceTaxintegrationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TaxIntegration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxintegrationsEndpoint( @@ -22,35 +17,28 @@ class FinanceTaxintegrationsEndpoint( IGettable[list[TaxIntegration], ConnectWiseManageRequestParams], IPaginateable[TaxIntegration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "taxIntegrations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "taxIntegrations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TaxIntegration]) IPaginateable.__init__(self, TaxIntegration) - self.count = self._register_child_endpoint( - FinanceTaxintegrationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(FinanceTaxintegrationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> FinanceTaxintegrationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> FinanceTaxintegrationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized FinanceTaxintegrationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: FinanceTaxintegrationsIdEndpoint: The initialized FinanceTaxintegrationsIdEndpoint object. """ child = FinanceTaxintegrationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxIntegration]: """ Performs a GET request against the /finance/taxIntegrations endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxIntegration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxIntegration, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TaxIntegration]: """ Performs a GET request against the /finance/taxIntegrations endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[TaxIntegration]: The parsed response data. """ - return self._parse_many( - TaxIntegration, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TaxIntegration, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsIdEndpoint.py index 125fe6429..2a1c80c06 100644 --- a/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/FinanceTaxintegrationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TaxIntegration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class FinanceTaxintegrationsIdEndpoint( ConnectWiseEndpoint, IGettable[TaxIntegration, ConnectWiseManageRequestParams], - IPuttable[TaxIntegration, ConnectWiseManageRequestParams], IPatchable[TaxIntegration, ConnectWiseManageRequestParams], + IPuttable[TaxIntegration, ConnectWiseManageRequestParams], IPaginateable[TaxIntegration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TaxIntegration) - IPuttable.__init__(self, TaxIntegration) IPatchable.__init__(self, TaxIntegration) + IPuttable.__init__(self, TaxIntegration) IPaginateable.__init__(self, TaxIntegration) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TaxIntegration]: """ Performs a GET request against the /finance/taxIntegrations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TaxIntegration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TaxIntegration, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxIntegration: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxIntegration: """ Performs a GET request against the /finance/taxIntegrations/{id} endpoint. @@ -74,18 +56,11 @@ def get( Returns: TaxIntegration: The parsed response data. """ - return self._parse_one( - TaxIntegration, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(TaxIntegration, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxIntegration: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TaxIntegration: """ - Performs a PUT request against the /finance/taxIntegrations/{id} endpoint. + Performs a PATCH request against the /finance/taxIntegrations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +68,11 @@ def put( Returns: TaxIntegration: The parsed response data. """ - return self._parse_one( - TaxIntegration, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TaxIntegration, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TaxIntegration: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TaxIntegration: """ - Performs a PATCH request against the /finance/taxIntegrations/{id} endpoint. + Performs a PUT request against the /finance/taxIntegrations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +80,4 @@ def patch( Returns: TaxIntegration: The parsed response data. """ - return self._parse_one( - TaxIntegration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TaxIntegration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsCountEndpoint.py index 3beb93098..9799d2141 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsEndpoint.py index 905733c16..15af9e26a 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsEndpoint.py @@ -1,30 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingCampaignsCountEndpoint import ( - MarketingCampaignsCountEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingCampaignsIdEndpoint import ( - MarketingCampaignsIdEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingCampaignsStatusesEndpoint import ( - MarketingCampaignsStatusesEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingCampaignsSubtypesEndpoint import ( - MarketingCampaignsSubtypesEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingCampaignsTypesEndpoint import ( - MarketingCampaignsTypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.MarketingCampaignsCountEndpoint import MarketingCampaignsCountEndpoint +from pyconnectwise.endpoints.manage.MarketingCampaignsIdEndpoint import MarketingCampaignsIdEndpoint +from pyconnectwise.endpoints.manage.MarketingCampaignsStatusesEndpoint import MarketingCampaignsStatusesEndpoint +from pyconnectwise.endpoints.manage.MarketingCampaignsSubtypesEndpoint import MarketingCampaignsSubtypesEndpoint +from pyconnectwise.endpoints.manage.MarketingCampaignsTypesEndpoint import MarketingCampaignsTypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Campaign from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsEndpoint( @@ -33,45 +21,32 @@ class MarketingCampaignsEndpoint( IPostable[Campaign, ConnectWiseManageRequestParams], IPaginateable[Campaign, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "campaigns", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "campaigns", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Campaign]) IPostable.__init__(self, Campaign) IPaginateable.__init__(self, Campaign) - self.count = self._register_child_endpoint( - MarketingCampaignsCountEndpoint(client, parent_endpoint=self) - ) - self.statuses = self._register_child_endpoint( - MarketingCampaignsStatusesEndpoint(client, parent_endpoint=self) - ) - self.sub_types = self._register_child_endpoint( - MarketingCampaignsSubtypesEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - MarketingCampaignsTypesEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(MarketingCampaignsCountEndpoint(client, parent_endpoint=self)) + self.statuses = self._register_child_endpoint(MarketingCampaignsStatusesEndpoint(client, parent_endpoint=self)) + self.sub_types = self._register_child_endpoint(MarketingCampaignsSubtypesEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(MarketingCampaignsTypesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> MarketingCampaignsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsIdEndpoint: The initialized MarketingCampaignsIdEndpoint object. """ child = MarketingCampaignsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Campaign]: """ Performs a GET request against the /marketing/campaigns endpoint and returns an initialized PaginatedResponse object. @@ -88,20 +63,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Campaign, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Campaign, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Campaign]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Campaign]: """ Performs a GET request against the /marketing/campaigns endpoint. @@ -111,15 +75,9 @@ def get( Returns: list[Campaign]: The parsed response data. """ - return self._parse_many( - Campaign, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Campaign, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Campaign: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Campaign: """ Performs a POST request against the /marketing/campaigns endpoint. @@ -129,6 +87,4 @@ def post( Returns: Campaign: The parsed response data. """ - return self._parse_one( - Campaign, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Campaign, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesCountEndpoint.py index e9a26e3fb..b06f00fdc 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdActivitiesCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsIdActivitiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/{id}/activities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/{id}/activities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesEndpoint.py index 22964bfd5..2ef17990d 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdActivitiesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsIdActivitiesCountEndpoint import ( MarketingCampaignsIdActivitiesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ActivityReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdActivitiesEndpoint( @@ -19,10 +18,8 @@ class MarketingCampaignsIdActivitiesEndpoint( IGettable[list[ActivityReference], ConnectWiseManageRequestParams], IPaginateable[ActivityReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "activities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "activities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ActivityReference]) IPaginateable.__init__(self, ActivityReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityReference]: """ Performs a GET request against the /marketing/campaigns/{id}/activities endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ActivityReference]: """ Performs a GET request against the /marketing/campaigns/{id}/activities endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ActivityReference]: The parsed response data. """ - return self._parse_many( - ActivityReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ActivityReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsCountEndpoint.py index 883f690c7..5273eb80f 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdAuditsCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsIdAuditsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/{id}/audits/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/{id}/audits/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsEndpoint.py index 7a4f0eb27..71bf03ad8 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsIdAuditsCountEndpoint import ( MarketingCampaignsIdAuditsCountEndpoint, ) -from pyconnectwise.endpoints.manage.MarketingCampaignsIdAuditsIdEndpoint import ( - MarketingCampaignsIdAuditsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.MarketingCampaignsIdAuditsIdEndpoint import MarketingCampaignsIdAuditsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CampaignAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdAuditsEndpoint( @@ -24,10 +20,8 @@ class MarketingCampaignsIdAuditsEndpoint( IPostable[CampaignAudit, ConnectWiseManageRequestParams], IPaginateable[CampaignAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "audits", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "audits", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CampaignAudit]) IPostable.__init__(self, CampaignAudit) IPaginateable.__init__(self, CampaignAudit) @@ -36,24 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 MarketingCampaignsIdAuditsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingCampaignsIdAuditsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsIdAuditsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsIdAuditsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsIdAuditsIdEndpoint: The initialized MarketingCampaignsIdAuditsIdEndpoint object. """ child = MarketingCampaignsIdAuditsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignAudit]: """ Performs a GET request against the /marketing/campaigns/{id}/audits endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignAudit, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CampaignAudit]: """ Performs a GET request against the /marketing/campaigns/{id}/audits endpoint. @@ -93,15 +77,9 @@ def get( Returns: list[CampaignAudit]: The parsed response data. """ - return self._parse_many( - CampaignAudit, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CampaignAudit, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignAudit: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignAudit: """ Performs a POST request against the /marketing/campaigns/{id}/audits endpoint. @@ -111,7 +89,4 @@ def post( Returns: CampaignAudit: The parsed response data. """ - return self._parse_one( - CampaignAudit, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CampaignAudit, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsIdEndpoint.py index 7bf27b405..f5c2482f3 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdAuditsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CampaignAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdAuditsIdEndpoint( ConnectWiseEndpoint, IGettable[CampaignAudit, ConnectWiseManageRequestParams], - IPuttable[CampaignAudit, ConnectWiseManageRequestParams], IPatchable[CampaignAudit, ConnectWiseManageRequestParams], + IPuttable[CampaignAudit, ConnectWiseManageRequestParams], IPaginateable[CampaignAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CampaignAudit) - IPuttable.__init__(self, CampaignAudit) IPatchable.__init__(self, CampaignAudit) + IPuttable.__init__(self, CampaignAudit) IPaginateable.__init__(self, CampaignAudit) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignAudit]: """ Performs a GET request against the /marketing/campaigns/{id}/audits/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignAudit, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignAudit: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/{id}/audits/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/{id}/audits/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CampaignAudit: The parsed response data. """ - return self._parse_one( - CampaignAudit, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignAudit: """ - Performs a DELETE request against the /marketing/campaigns/{id}/audits/{id} endpoint. + Performs a GET request against the /marketing/campaigns/{id}/audits/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CampaignAudit: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CampaignAudit, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignAudit: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CampaignAudit: """ - Performs a PUT request against the /marketing/campaigns/{id}/audits/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/{id}/audits/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: CampaignAudit: The parsed response data. """ - return self._parse_one( - CampaignAudit, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CampaignAudit, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignAudit: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignAudit: """ - Performs a PATCH request against the /marketing/campaigns/{id}/audits/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/{id}/audits/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: CampaignAudit: The parsed response data. """ - return self._parse_one( - CampaignAudit, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CampaignAudit, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedCountEndpoint.py index faea8b93d..fd3562c1b 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdEmailsopenedCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsIdEmailsopenedCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/{id}/emailsOpened/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/{id}/emailsOpened/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedEndpoint.py index eb461093d..eb139f999 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsIdEmailsopenedCountEndpoint import ( MarketingCampaignsIdEmailsopenedCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.MarketingCampaignsIdEmailsopenedIdEndpoint import ( MarketingCampaignsIdEmailsopenedIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import EmailOpened from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdEmailsopenedEndpoint( @@ -24,10 +22,8 @@ class MarketingCampaignsIdEmailsopenedEndpoint( IPostable[EmailOpened, ConnectWiseManageRequestParams], IPaginateable[EmailOpened, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailsOpened", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailsOpened", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EmailOpened]) IPostable.__init__(self, EmailOpened) IPaginateable.__init__(self, EmailOpened) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 MarketingCampaignsIdEmailsopenedCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingCampaignsIdEmailsopenedIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsIdEmailsopenedIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsIdEmailsopenedIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsIdEmailsopenedIdEndpoint: The initialized MarketingCampaignsIdEmailsopenedIdEndpoint object. """ - child = MarketingCampaignsIdEmailsopenedIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = MarketingCampaignsIdEmailsopenedIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailOpened]: """ Performs a GET request against the /marketing/campaigns/{id}/emailsOpened endpoint and returns an initialized PaginatedResponse object. @@ -73,19 +64,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailOpened, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailOpened, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[EmailOpened]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[EmailOpened]: """ Performs a GET request against the /marketing/campaigns/{id}/emailsOpened endpoint. @@ -95,15 +77,9 @@ def get( Returns: list[EmailOpened]: The parsed response data. """ - return self._parse_many( - EmailOpened, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(EmailOpened, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailOpened: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailOpened: """ Performs a POST request against the /marketing/campaigns/{id}/emailsOpened endpoint. @@ -113,6 +89,4 @@ def post( Returns: EmailOpened: The parsed response data. """ - return self._parse_one( - EmailOpened, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(EmailOpened, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedIdEndpoint.py index 78b787f81..d6cf46bad 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEmailsopenedIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import EmailOpened from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdEmailsopenedIdEndpoint( ConnectWiseEndpoint, IGettable[EmailOpened, ConnectWiseManageRequestParams], - IPuttable[EmailOpened, ConnectWiseManageRequestParams], IPatchable[EmailOpened, ConnectWiseManageRequestParams], + IPuttable[EmailOpened, ConnectWiseManageRequestParams], IPaginateable[EmailOpened, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, EmailOpened) - IPuttable.__init__(self, EmailOpened) IPatchable.__init__(self, EmailOpened) + IPuttable.__init__(self, EmailOpened) IPaginateable.__init__(self, EmailOpened) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailOpened]: """ Performs a GET request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailOpened, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailOpened, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailOpened: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - EmailOpened: The parsed response data. """ - return self._parse_one( - EmailOpened, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailOpened: """ - Performs a DELETE request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. + Performs a GET request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + EmailOpened: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(EmailOpened, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailOpened: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> EmailOpened: """ - Performs a PUT request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: EmailOpened: The parsed response data. """ - return self._parse_one( - EmailOpened, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(EmailOpened, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailOpened: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailOpened: """ - Performs a PATCH request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/{id}/emailsOpened/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: EmailOpened: The parsed response data. """ - return self._parse_one( - EmailOpened, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(EmailOpened, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEndpoint.py index a20da770c..e8f6207cd 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdEndpoint.py @@ -1,10 +1,8 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingCampaignsIdActivitiesEndpoint import ( - MarketingCampaignsIdActivitiesEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingCampaignsIdAuditsEndpoint import ( - MarketingCampaignsIdAuditsEndpoint, -) +from pyconnectwise.endpoints.manage.MarketingCampaignsIdActivitiesEndpoint import MarketingCampaignsIdActivitiesEndpoint +from pyconnectwise.endpoints.manage.MarketingCampaignsIdAuditsEndpoint import MarketingCampaignsIdAuditsEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsIdEmailsopenedEndpoint import ( MarketingCampaignsIdEmailsopenedEndpoint, ) @@ -17,61 +15,48 @@ from pyconnectwise.endpoints.manage.MarketingCampaignsIdOpportunitiesEndpoint import ( MarketingCampaignsIdOpportunitiesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Campaign from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdEndpoint( ConnectWiseEndpoint, IGettable[Campaign, ConnectWiseManageRequestParams], - IPuttable[Campaign, ConnectWiseManageRequestParams], IPatchable[Campaign, ConnectWiseManageRequestParams], + IPuttable[Campaign, ConnectWiseManageRequestParams], IPaginateable[Campaign, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Campaign) - IPuttable.__init__(self, Campaign) IPatchable.__init__(self, Campaign) + IPuttable.__init__(self, Campaign) IPaginateable.__init__(self, Campaign) + self.activities = self._register_child_endpoint( + MarketingCampaignsIdActivitiesEndpoint(client, parent_endpoint=self) + ) + self.audits = self._register_child_endpoint(MarketingCampaignsIdAuditsEndpoint(client, parent_endpoint=self)) self.emails_opened = self._register_child_endpoint( MarketingCampaignsIdEmailsopenedEndpoint(client, parent_endpoint=self) ) - self.audits = self._register_child_endpoint( - MarketingCampaignsIdAuditsEndpoint(client, parent_endpoint=self) - ) - self.opportunities = self._register_child_endpoint( - MarketingCampaignsIdOpportunitiesEndpoint(client, parent_endpoint=self) - ) self.forms_submitted = self._register_child_endpoint( MarketingCampaignsIdFormssubmittedEndpoint(client, parent_endpoint=self) ) self.links_clicked = self._register_child_endpoint( MarketingCampaignsIdLinksclickedEndpoint(client, parent_endpoint=self) ) - self.activities = self._register_child_endpoint( - MarketingCampaignsIdActivitiesEndpoint(client, parent_endpoint=self) + self.opportunities = self._register_child_endpoint( + MarketingCampaignsIdOpportunitiesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Campaign]: """ Performs a GET request against the /marketing/campaigns/{id} endpoint and returns an initialized PaginatedResponse object. @@ -88,54 +73,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Campaign, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Campaign, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Campaign: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Campaign: The parsed response data. """ - return self._parse_one( - Campaign, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Campaign: """ - Performs a DELETE request against the /marketing/campaigns/{id} endpoint. + Performs a GET request against the /marketing/campaigns/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Campaign: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Campaign, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Campaign: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Campaign: """ - Performs a PUT request against the /marketing/campaigns/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,17 +107,11 @@ def put( Returns: Campaign: The parsed response data. """ - return self._parse_one( - Campaign, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Campaign, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Campaign: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Campaign: """ - Performs a PATCH request against the /marketing/campaigns/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -161,6 +119,4 @@ def patch( Returns: Campaign: The parsed response data. """ - return self._parse_one( - Campaign, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Campaign, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedCountEndpoint.py index e037cfdd5..3afa99ec0 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdFormssubmittedCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsIdFormssubmittedCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/{id}/formsSubmitted/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/{id}/formsSubmitted/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedEndpoint.py index 3399b0715..f701a0198 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsIdFormssubmittedCountEndpoint import ( MarketingCampaignsIdFormssubmittedCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.MarketingCampaignsIdFormssubmittedIdEndpoint import ( MarketingCampaignsIdFormssubmittedIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import FormSubmitted from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdFormssubmittedEndpoint( @@ -24,40 +22,31 @@ class MarketingCampaignsIdFormssubmittedEndpoint( IPostable[FormSubmitted, ConnectWiseManageRequestParams], IPaginateable[FormSubmitted, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "formsSubmitted", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "formsSubmitted", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[FormSubmitted]) IPostable.__init__(self, FormSubmitted) IPaginateable.__init__(self, FormSubmitted) self.count = self._register_child_endpoint( - MarketingCampaignsIdFormssubmittedCountEndpoint( - client, parent_endpoint=self - ) + MarketingCampaignsIdFormssubmittedCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingCampaignsIdFormssubmittedIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsIdFormssubmittedIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsIdFormssubmittedIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsIdFormssubmittedIdEndpoint: The initialized MarketingCampaignsIdFormssubmittedIdEndpoint object. """ - child = MarketingCampaignsIdFormssubmittedIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = MarketingCampaignsIdFormssubmittedIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[FormSubmitted]: """ Performs a GET request against the /marketing/campaigns/{id}/formsSubmitted endpoint and returns an initialized PaginatedResponse object. @@ -75,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - FormSubmitted, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), FormSubmitted, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[FormSubmitted]: """ Performs a GET request against the /marketing/campaigns/{id}/formsSubmitted endpoint. @@ -97,15 +79,9 @@ def get( Returns: list[FormSubmitted]: The parsed response data. """ - return self._parse_many( - FormSubmitted, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(FormSubmitted, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FormSubmitted: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FormSubmitted: """ Performs a POST request against the /marketing/campaigns/{id}/formsSubmitted endpoint. @@ -115,7 +91,4 @@ def post( Returns: FormSubmitted: The parsed response data. """ - return self._parse_one( - FormSubmitted, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(FormSubmitted, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedIdEndpoint.py index 508ac933d..1c1a52666 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdFormssubmittedIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import FormSubmitted from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdFormssubmittedIdEndpoint( ConnectWiseEndpoint, IGettable[FormSubmitted, ConnectWiseManageRequestParams], - IPuttable[FormSubmitted, ConnectWiseManageRequestParams], IPatchable[FormSubmitted, ConnectWiseManageRequestParams], + IPuttable[FormSubmitted, ConnectWiseManageRequestParams], IPaginateable[FormSubmitted, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, FormSubmitted) - IPuttable.__init__(self, FormSubmitted) IPatchable.__init__(self, FormSubmitted) + IPuttable.__init__(self, FormSubmitted) IPaginateable.__init__(self, FormSubmitted) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[FormSubmitted]: """ Performs a GET request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - FormSubmitted, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), FormSubmitted, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FormSubmitted: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - FormSubmitted: The parsed response data. """ - return self._parse_one( - FormSubmitted, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FormSubmitted: """ - Performs a DELETE request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. + Performs a GET request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + FormSubmitted: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(FormSubmitted, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FormSubmitted: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> FormSubmitted: """ - Performs a PUT request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: FormSubmitted: The parsed response data. """ - return self._parse_one( - FormSubmitted, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(FormSubmitted, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> FormSubmitted: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FormSubmitted: """ - Performs a PATCH request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/{id}/formsSubmitted/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: FormSubmitted: The parsed response data. """ - return self._parse_one( - FormSubmitted, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(FormSubmitted, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedCountEndpoint.py index c1623bde8..8afbaca94 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdLinksclickedCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsIdLinksclickedCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/{id}/linksClicked/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/{id}/linksClicked/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedEndpoint.py index e1e98e390..0168de08d 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsIdLinksclickedCountEndpoint import ( MarketingCampaignsIdLinksclickedCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.MarketingCampaignsIdLinksclickedIdEndpoint import ( MarketingCampaignsIdLinksclickedIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import LinkClicked from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdLinksclickedEndpoint( @@ -24,10 +22,8 @@ class MarketingCampaignsIdLinksclickedEndpoint( IPostable[LinkClicked, ConnectWiseManageRequestParams], IPaginateable[LinkClicked, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "linksClicked", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "linksClicked", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LinkClicked]) IPostable.__init__(self, LinkClicked) IPaginateable.__init__(self, LinkClicked) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 MarketingCampaignsIdLinksclickedCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingCampaignsIdLinksclickedIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsIdLinksclickedIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsIdLinksclickedIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsIdLinksclickedIdEndpoint: The initialized MarketingCampaignsIdLinksclickedIdEndpoint object. """ - child = MarketingCampaignsIdLinksclickedIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = MarketingCampaignsIdLinksclickedIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LinkClicked]: """ Performs a GET request against the /marketing/campaigns/{id}/linksClicked endpoint and returns an initialized PaginatedResponse object. @@ -73,19 +64,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LinkClicked, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LinkClicked, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[LinkClicked]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[LinkClicked]: """ Performs a GET request against the /marketing/campaigns/{id}/linksClicked endpoint. @@ -95,15 +77,9 @@ def get( Returns: list[LinkClicked]: The parsed response data. """ - return self._parse_many( - LinkClicked, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LinkClicked, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LinkClicked: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LinkClicked: """ Performs a POST request against the /marketing/campaigns/{id}/linksClicked endpoint. @@ -113,6 +89,4 @@ def post( Returns: LinkClicked: The parsed response data. """ - return self._parse_one( - LinkClicked, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(LinkClicked, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedIdEndpoint.py index dc5eca202..6a3cf7a0b 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdLinksclickedIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import LinkClicked from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdLinksclickedIdEndpoint( ConnectWiseEndpoint, IGettable[LinkClicked, ConnectWiseManageRequestParams], - IPuttable[LinkClicked, ConnectWiseManageRequestParams], IPatchable[LinkClicked, ConnectWiseManageRequestParams], + IPuttable[LinkClicked, ConnectWiseManageRequestParams], IPaginateable[LinkClicked, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LinkClicked) - IPuttable.__init__(self, LinkClicked) IPatchable.__init__(self, LinkClicked) + IPuttable.__init__(self, LinkClicked) IPaginateable.__init__(self, LinkClicked) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LinkClicked]: """ Performs a GET request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LinkClicked, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LinkClicked, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LinkClicked: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - LinkClicked: The parsed response data. """ - return self._parse_one( - LinkClicked, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LinkClicked: """ - Performs a DELETE request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. + Performs a GET request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + LinkClicked: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(LinkClicked, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LinkClicked: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> LinkClicked: """ - Performs a PUT request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: LinkClicked: The parsed response data. """ - return self._parse_one( - LinkClicked, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(LinkClicked, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> LinkClicked: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LinkClicked: """ - Performs a PATCH request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/{id}/linksClicked/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: LinkClicked: The parsed response data. """ - return self._parse_one( - LinkClicked, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(LinkClicked, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesCountEndpoint.py index 335eb1802..364000e8f 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdOpportunitiesCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsIdOpportunitiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/{id}/opportunities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/{id}/opportunities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesEndpoint.py index 908c0b53f..0adeffcea 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsIdOpportunitiesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsIdOpportunitiesCountEndpoint import ( MarketingCampaignsIdOpportunitiesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsIdOpportunitiesEndpoint( @@ -19,10 +18,8 @@ class MarketingCampaignsIdOpportunitiesEndpoint( IGettable[list[OpportunityReference], ConnectWiseManageRequestParams], IPaginateable[OpportunityReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "opportunities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "opportunities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityReference]) IPaginateable.__init__(self, OpportunityReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityReference]: """ Performs a GET request against the /marketing/campaigns/{id}/opportunities endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityReference]: """ Performs a GET request against the /marketing/campaigns/{id}/opportunities endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[OpportunityReference]: The parsed response data. """ - return self._parse_many( - OpportunityReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesCountEndpoint.py index c76516f7d..87f7cae7f 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsStatusesCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesEndpoint.py index bcf123c1e..b52072ec1 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsStatusesCountEndpoint import ( MarketingCampaignsStatusesCountEndpoint, ) -from pyconnectwise.endpoints.manage.MarketingCampaignsStatusesIdEndpoint import ( - MarketingCampaignsStatusesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.MarketingCampaignsStatusesIdEndpoint import MarketingCampaignsStatusesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CampaignStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsStatusesEndpoint( @@ -24,10 +20,8 @@ class MarketingCampaignsStatusesEndpoint( IPostable[CampaignStatus, ConnectWiseManageRequestParams], IPaginateable[CampaignStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CampaignStatus]) IPostable.__init__(self, CampaignStatus) IPaginateable.__init__(self, CampaignStatus) @@ -36,24 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 MarketingCampaignsStatusesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingCampaignsStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsStatusesIdEndpoint: The initialized MarketingCampaignsStatusesIdEndpoint object. """ child = MarketingCampaignsStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignStatus]: """ Performs a GET request against the /marketing/campaigns/statuses endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CampaignStatus]: """ Performs a GET request against the /marketing/campaigns/statuses endpoint. @@ -93,16 +77,9 @@ def get( Returns: list[CampaignStatus]: The parsed response data. """ - return self._parse_many( - CampaignStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CampaignStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignStatus: """ Performs a POST request against the /marketing/campaigns/statuses endpoint. @@ -112,7 +89,4 @@ def post( Returns: CampaignStatus: The parsed response data. """ - return self._parse_one( - CampaignStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CampaignStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesIdEndpoint.py index baf4a3b22..30f0dccc1 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsStatusesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CampaignStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[CampaignStatus, ConnectWiseManageRequestParams], - IPuttable[CampaignStatus, ConnectWiseManageRequestParams], IPatchable[CampaignStatus, ConnectWiseManageRequestParams], + IPuttable[CampaignStatus, ConnectWiseManageRequestParams], IPaginateable[CampaignStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CampaignStatus) - IPuttable.__init__(self, CampaignStatus) IPatchable.__init__(self, CampaignStatus) + IPuttable.__init__(self, CampaignStatus) IPaginateable.__init__(self, CampaignStatus) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignStatus]: """ Performs a GET request against the /marketing/campaigns/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/statuses/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CampaignStatus: The parsed response data. """ - return self._parse_one( - CampaignStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignStatus: """ - Performs a DELETE request against the /marketing/campaigns/statuses/{id} endpoint. + Performs a GET request against the /marketing/campaigns/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CampaignStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CampaignStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CampaignStatus: """ - Performs a PUT request against the /marketing/campaigns/statuses/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: CampaignStatus: The parsed response data. """ - return self._parse_one( - CampaignStatus, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CampaignStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignStatus: """ - Performs a PATCH request against the /marketing/campaigns/statuses/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: CampaignStatus: The parsed response data. """ - return self._parse_one( - CampaignStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CampaignStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesCountEndpoint.py index e0c479003..8f14e504b 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsSubtypesCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsSubtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/subTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/subTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesEndpoint.py index 217326467..c5646f477 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesEndpoint.py @@ -1,60 +1,51 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsSubtypesCountEndpoint import ( MarketingCampaignsSubtypesCountEndpoint, ) -from pyconnectwise.endpoints.manage.MarketingCampaignsSubtypesIdEndpoint import ( - MarketingCampaignsSubtypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) -from pyconnectwise.models.manage import CampaignSubTypeCampaignSubType +from pyconnectwise.endpoints.manage.MarketingCampaignsSubtypesIdEndpoint import MarketingCampaignsSubtypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable +from pyconnectwise.models.manage import CampaignCampaignSubType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsSubtypesEndpoint( ConnectWiseEndpoint, - IGettable[list[CampaignSubTypeCampaignSubType], ConnectWiseManageRequestParams], - IPostable[CampaignSubTypeCampaignSubType, ConnectWiseManageRequestParams], - IPaginateable[CampaignSubTypeCampaignSubType, ConnectWiseManageRequestParams], + IGettable[list[CampaignCampaignSubType], ConnectWiseManageRequestParams], + IPostable[CampaignCampaignSubType, ConnectWiseManageRequestParams], + IPaginateable[CampaignCampaignSubType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "subTypes", parent_endpoint=parent_endpoint - ) - IGettable.__init__(self, list[CampaignSubTypeCampaignSubType]) - IPostable.__init__(self, CampaignSubTypeCampaignSubType) - IPaginateable.__init__(self, CampaignSubTypeCampaignSubType) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "subTypes", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[CampaignCampaignSubType]) + IPostable.__init__(self, CampaignCampaignSubType) + IPaginateable.__init__(self, CampaignCampaignSubType) self.count = self._register_child_endpoint( MarketingCampaignsSubtypesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingCampaignsSubtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsSubtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsSubtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsSubtypesIdEndpoint: The initialized MarketingCampaignsSubtypesIdEndpoint object. """ child = MarketingCampaignsSubtypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaginatedResponse[CampaignSubTypeCampaignSubType]: + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[CampaignCampaignSubType]: """ Performs a GET request against the /marketing/campaigns/subTypes endpoint and returns an initialized PaginatedResponse object. @@ -63,7 +54,7 @@ def paginated( page_size (int): The number of results to return per page. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - PaginatedResponse[CampaignSubTypeCampaignSubType]: The initialized PaginatedResponse object. + PaginatedResponse[CampaignCampaignSubType]: The initialized PaginatedResponse object. """ if params: params["page"] = page @@ -71,19 +62,12 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignSubTypeCampaignSubType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignCampaignSubType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CampaignSubTypeCampaignSubType]: + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> list[CampaignCampaignSubType]: """ Performs a GET request against the /marketing/campaigns/subTypes endpoint. @@ -91,18 +75,13 @@ def get( data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - list[CampaignSubTypeCampaignSubType]: The parsed response data. + list[CampaignCampaignSubType]: The parsed response data. """ - return self._parse_many( - CampaignSubTypeCampaignSubType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CampaignCampaignSubType, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignSubTypeCampaignSubType: + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CampaignCampaignSubType: """ Performs a POST request against the /marketing/campaigns/subTypes endpoint. @@ -110,9 +89,6 @@ def post( data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - CampaignSubTypeCampaignSubType: The parsed response data. + CampaignCampaignSubType: The parsed response data. """ - return self._parse_one( - CampaignSubTypeCampaignSubType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CampaignCampaignSubType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesIdEndpoint.py index 45d9e1116..5c88e3f0f 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsSubtypesIdEndpoint.py @@ -1,41 +1,32 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) -from pyconnectwise.models.manage import CampaignSubTypeCampaignSubType +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable +from pyconnectwise.models.manage import CampaignCampaignSubType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsSubtypesIdEndpoint( ConnectWiseEndpoint, - IGettable[CampaignSubTypeCampaignSubType, ConnectWiseManageRequestParams], - IPuttable[CampaignSubTypeCampaignSubType, ConnectWiseManageRequestParams], - IPatchable[CampaignSubTypeCampaignSubType, ConnectWiseManageRequestParams], - IPaginateable[CampaignSubTypeCampaignSubType, ConnectWiseManageRequestParams], + IGettable[CampaignCampaignSubType, ConnectWiseManageRequestParams], + IPatchable[CampaignCampaignSubType, ConnectWiseManageRequestParams], + IPuttable[CampaignCampaignSubType, ConnectWiseManageRequestParams], + IPaginateable[CampaignCampaignSubType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - IGettable.__init__(self, CampaignSubTypeCampaignSubType) - IPuttable.__init__(self, CampaignSubTypeCampaignSubType) - IPatchable.__init__(self, CampaignSubTypeCampaignSubType) - IPaginateable.__init__(self, CampaignSubTypeCampaignSubType) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IGettable.__init__(self, CampaignCampaignSubType) + IPatchable.__init__(self, CampaignCampaignSubType) + IPuttable.__init__(self, CampaignCampaignSubType) + IPaginateable.__init__(self, CampaignCampaignSubType) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaginatedResponse[CampaignSubTypeCampaignSubType]: + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[CampaignCampaignSubType]: """ Performs a GET request against the /marketing/campaigns/subTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,7 +35,7 @@ def paginated( page_size (int): The number of results to return per page. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - PaginatedResponse[CampaignSubTypeCampaignSubType]: The initialized PaginatedResponse object. + PaginatedResponse[CampaignCampaignSubType]: The initialized PaginatedResponse object. """ if params: params["page"] = page @@ -52,81 +43,57 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignSubTypeCampaignSubType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignCampaignSubType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignSubTypeCampaignSubType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/subTypes/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/subTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CampaignSubTypeCampaignSubType: The parsed response data. """ - return self._parse_one( - CampaignSubTypeCampaignSubType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CampaignCampaignSubType: """ - Performs a DELETE request against the /marketing/campaigns/subTypes/{id} endpoint. + Performs a GET request against the /marketing/campaigns/subTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CampaignCampaignSubType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CampaignCampaignSubType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignSubTypeCampaignSubType: + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None + ) -> CampaignCampaignSubType: """ - Performs a PUT request against the /marketing/campaigns/subTypes/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/subTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - CampaignSubTypeCampaignSubType: The parsed response data. + CampaignCampaignSubType: The parsed response data. """ - return self._parse_one( - CampaignSubTypeCampaignSubType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CampaignCampaignSubType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignSubTypeCampaignSubType: + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CampaignCampaignSubType: """ - Performs a PATCH request against the /marketing/campaigns/subTypes/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/subTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - CampaignSubTypeCampaignSubType: The parsed response data. + CampaignCampaignSubType: The parsed response data. """ - return self._parse_one( - CampaignSubTypeCampaignSubType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CampaignCampaignSubType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesCountEndpoint.py index 7325d469e..fe43f1ba4 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesEndpoint.py index 0836d24b6..c39cd5d26 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingCampaignsTypesCountEndpoint import ( - MarketingCampaignsTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingCampaignsTypesIdEndpoint import ( - MarketingCampaignsTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingCampaignsTypesInfoEndpoint import ( - MarketingCampaignsTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.MarketingCampaignsTypesCountEndpoint import MarketingCampaignsTypesCountEndpoint +from pyconnectwise.endpoints.manage.MarketingCampaignsTypesIdEndpoint import MarketingCampaignsTypesIdEndpoint +from pyconnectwise.endpoints.manage.MarketingCampaignsTypesInfoEndpoint import MarketingCampaignsTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CampaignType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesEndpoint( @@ -27,39 +19,30 @@ class MarketingCampaignsTypesEndpoint( IPostable[CampaignType, ConnectWiseManageRequestParams], IPaginateable[CampaignType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CampaignType]) IPostable.__init__(self, CampaignType) IPaginateable.__init__(self, CampaignType) - self.count = self._register_child_endpoint( - MarketingCampaignsTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - MarketingCampaignsTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(MarketingCampaignsTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(MarketingCampaignsTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> MarketingCampaignsTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsTypesIdEndpoint: The initialized MarketingCampaignsTypesIdEndpoint object. """ child = MarketingCampaignsTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignType]: """ Performs a GET request against the /marketing/campaigns/types endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CampaignType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CampaignType]: """ Performs a GET request against the /marketing/campaigns/types endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[CampaignType]: The parsed response data. """ - return self._parse_many( - CampaignType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CampaignType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignType: """ Performs a POST request against the /marketing/campaigns/types endpoint. @@ -117,6 +85,4 @@ def post( Returns: CampaignType: The parsed response data. """ - return self._parse_one( - CampaignType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CampaignType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdEndpoint.py index c31bf719a..3f51766f4 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdEndpoint.py @@ -1,53 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingCampaignsTypesIdInfoEndpoint import ( - MarketingCampaignsTypesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.MarketingCampaignsTypesIdInfoEndpoint import MarketingCampaignsTypesIdInfoEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsTypesIdSubtypesEndpoint import ( MarketingCampaignsTypesIdSubtypesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CampaignType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesIdEndpoint( ConnectWiseEndpoint, IGettable[CampaignType, ConnectWiseManageRequestParams], - IPuttable[CampaignType, ConnectWiseManageRequestParams], IPatchable[CampaignType, ConnectWiseManageRequestParams], + IPuttable[CampaignType, ConnectWiseManageRequestParams], IPaginateable[CampaignType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CampaignType) - IPuttable.__init__(self, CampaignType) IPatchable.__init__(self, CampaignType) + IPuttable.__init__(self, CampaignType) IPaginateable.__init__(self, CampaignType) + self.info = self._register_child_endpoint(MarketingCampaignsTypesIdInfoEndpoint(client, parent_endpoint=self)) self.sub_types = self._register_child_endpoint( MarketingCampaignsTypesIdSubtypesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - MarketingCampaignsTypesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignType]: """ Performs a GET request against the /marketing/campaigns/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +52,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/campaigns/types/{id} endpoint. + Performs a DELETE request against the /marketing/campaigns/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CampaignType: The parsed response data. """ - return self._parse_one( - CampaignType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignType: """ - Performs a DELETE request against the /marketing/campaigns/types/{id} endpoint. + Performs a GET request against the /marketing/campaigns/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CampaignType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CampaignType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CampaignType: """ - Performs a PUT request against the /marketing/campaigns/types/{id} endpoint. + Performs a PATCH request against the /marketing/campaigns/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +87,11 @@ def put( Returns: CampaignType: The parsed response data. """ - return self._parse_one( - CampaignType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CampaignType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignType: """ - Performs a PATCH request against the /marketing/campaigns/types/{id} endpoint. + Performs a PUT request against the /marketing/campaigns/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,7 +99,4 @@ def patch( Returns: CampaignType: The parsed response data. """ - return self._parse_one( - CampaignType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CampaignType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdInfoEndpoint.py index dc5dc53dc..d20646e4f 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CampaignTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsTypesIdInfoEndpoint( IGettable[CampaignTypeInfo, ConnectWiseManageRequestParams], IPaginateable[CampaignTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CampaignTypeInfo) IPaginateable.__init__(self, CampaignTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignTypeInfo]: """ Performs a GET request against the /marketing/campaigns/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CampaignTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CampaignTypeInfo: """ Performs a GET request against the /marketing/campaigns/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: CampaignTypeInfo: The parsed response data. """ - return self._parse_one( - CampaignTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CampaignTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesCountEndpoint.py index 17f8be1f6..ac98db262 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesIdSubtypesCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsTypesIdSubtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/types/{id}/subTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/types/{id}/subTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesEndpoint.py index addac18bd..8842b6c46 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsTypesIdSubtypesCountEndpoint import ( MarketingCampaignsTypesIdSubtypesCountEndpoint, @@ -5,55 +7,45 @@ from pyconnectwise.endpoints.manage.MarketingCampaignsTypesIdSubtypesIdEndpoint import ( MarketingCampaignsTypesIdSubtypesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) -from pyconnectwise.models.manage import TypeSubTypeCampaignSubType +from pyconnectwise.interfaces import IGettable, IPaginateable +from pyconnectwise.models.manage import TypeCampaignSubType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesIdSubtypesEndpoint( ConnectWiseEndpoint, - IGettable[list[TypeSubTypeCampaignSubType], ConnectWiseManageRequestParams], - IPaginateable[TypeSubTypeCampaignSubType, ConnectWiseManageRequestParams], + IGettable[list[TypeCampaignSubType], ConnectWiseManageRequestParams], + IPaginateable[TypeCampaignSubType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "subTypes", parent_endpoint=parent_endpoint - ) - IGettable.__init__(self, list[TypeSubTypeCampaignSubType]) - IPaginateable.__init__(self, TypeSubTypeCampaignSubType) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "subTypes", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[TypeCampaignSubType]) + IPaginateable.__init__(self, TypeCampaignSubType) self.count = self._register_child_endpoint( MarketingCampaignsTypesIdSubtypesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingCampaignsTypesIdSubtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingCampaignsTypesIdSubtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingCampaignsTypesIdSubtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingCampaignsTypesIdSubtypesIdEndpoint: The initialized MarketingCampaignsTypesIdSubtypesIdEndpoint object. """ - child = MarketingCampaignsTypesIdSubtypesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = MarketingCampaignsTypesIdSubtypesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaginatedResponse[TypeSubTypeCampaignSubType]: + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[TypeCampaignSubType]: """ Performs a GET request against the /marketing/campaigns/types/{id}/subTypes endpoint and returns an initialized PaginatedResponse object. @@ -62,7 +54,7 @@ def paginated( page_size (int): The number of results to return per page. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - PaginatedResponse[TypeSubTypeCampaignSubType]: The initialized PaginatedResponse object. + PaginatedResponse[TypeCampaignSubType]: The initialized PaginatedResponse object. """ if params: params["page"] = page @@ -70,19 +62,12 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TypeSubTypeCampaignSubType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TypeCampaignSubType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TypeSubTypeCampaignSubType]: + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> list[TypeCampaignSubType]: """ Performs a GET request against the /marketing/campaigns/types/{id}/subTypes endpoint. @@ -90,9 +75,6 @@ def get( data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - list[TypeSubTypeCampaignSubType]: The parsed response data. + list[TypeCampaignSubType]: The parsed response data. """ - return self._parse_many( - TypeSubTypeCampaignSubType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TypeCampaignSubType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesIdEndpoint.py index 5eb44c9c5..59c817ce1 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesIdSubtypesIdEndpoint.py @@ -1,34 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) -from pyconnectwise.models.manage import TypeSubTypeCampaignSubType +from pyconnectwise.interfaces import IGettable, IPaginateable +from pyconnectwise.models.manage import TypeCampaignSubType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesIdSubtypesIdEndpoint( ConnectWiseEndpoint, - IGettable[TypeSubTypeCampaignSubType, ConnectWiseManageRequestParams], - IPaginateable[TypeSubTypeCampaignSubType, ConnectWiseManageRequestParams], + IGettable[TypeCampaignSubType, ConnectWiseManageRequestParams], + IPaginateable[TypeCampaignSubType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - IGettable.__init__(self, TypeSubTypeCampaignSubType) - IPaginateable.__init__(self, TypeSubTypeCampaignSubType) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IGettable.__init__(self, TypeCampaignSubType) + IPaginateable.__init__(self, TypeCampaignSubType) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, - ) -> PaginatedResponse[TypeSubTypeCampaignSubType]: + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[TypeCampaignSubType]: """ Performs a GET request against the /marketing/campaigns/types/{id}/subTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -37,7 +31,7 @@ def paginated( page_size (int): The number of results to return per page. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - PaginatedResponse[TypeSubTypeCampaignSubType]: The initialized PaginatedResponse object. + PaginatedResponse[TypeCampaignSubType]: The initialized PaginatedResponse object. """ if params: params["page"] = page @@ -45,19 +39,12 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TypeSubTypeCampaignSubType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TypeCampaignSubType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TypeSubTypeCampaignSubType: + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> TypeCampaignSubType: """ Performs a GET request against the /marketing/campaigns/types/{id}/subTypes/{id} endpoint. @@ -65,9 +52,6 @@ def get( data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. Returns: - TypeSubTypeCampaignSubType: The parsed response data. + TypeCampaignSubType: The parsed response data. """ - return self._parse_one( - TypeSubTypeCampaignSubType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(TypeCampaignSubType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoCountEndpoint.py index 67bd69745..a27992eef 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class MarketingCampaignsTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/campaigns/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/campaigns/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoEndpoint.py index 5200f76d4..a3750b4b6 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingCampaignsTypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingCampaignsTypesInfoCountEndpoint import ( MarketingCampaignsTypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CampaignTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingCampaignsTypesInfoEndpoint( @@ -19,10 +18,8 @@ class MarketingCampaignsTypesInfoEndpoint( IGettable[list[CampaignTypeInfo], ConnectWiseManageRequestParams], IPaginateable[CampaignTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CampaignTypeInfo]) IPaginateable.__init__(self, CampaignTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CampaignTypeInfo]: """ Performs a GET request against the /marketing/campaigns/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CampaignTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CampaignTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CampaignTypeInfo]: """ Performs a GET request against the /marketing/campaigns/types/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[CampaignTypeInfo]: The parsed response data. """ - return self._parse_many( - CampaignTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CampaignTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingEndpoint.py index 333e44cb9..da0a7db8b 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingEndpoint.py @@ -1,21 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingCampaignsEndpoint import ( - MarketingCampaignsEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingGroupsEndpoint import ( - MarketingGroupsEndpoint, -) +from pyconnectwise.endpoints.manage.MarketingCampaignsEndpoint import MarketingCampaignsEndpoint +from pyconnectwise.endpoints.manage.MarketingGroupsEndpoint import MarketingGroupsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "marketing", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "marketing", parent_endpoint=parent_endpoint) - self.campaigns = self._register_child_endpoint( - MarketingCampaignsEndpoint(client, parent_endpoint=self) - ) - self.groups = self._register_child_endpoint( - MarketingGroupsEndpoint(client, parent_endpoint=self) - ) + self.campaigns = self._register_child_endpoint(MarketingCampaignsEndpoint(client, parent_endpoint=self)) + self.groups = self._register_child_endpoint(MarketingGroupsEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsCountEndpoint.py index dfcaad937..b562e2b06 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsCountEndpoint( @@ -16,18 +15,13 @@ class MarketingGroupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/groups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/groups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsEndpoint.py index 488f0714b..2df8f3128 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingGroupsCountEndpoint import ( - MarketingGroupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingGroupsIdEndpoint import ( - MarketingGroupsIdEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingGroupsInfoEndpoint import ( - MarketingGroupsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.MarketingGroupsCountEndpoint import MarketingGroupsCountEndpoint +from pyconnectwise.endpoints.manage.MarketingGroupsIdEndpoint import MarketingGroupsIdEndpoint +from pyconnectwise.endpoints.manage.MarketingGroupsInfoEndpoint import MarketingGroupsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Group from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsEndpoint( @@ -27,39 +19,30 @@ class MarketingGroupsEndpoint( IPostable[Group, ConnectWiseManageRequestParams], IPaginateable[Group, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "groups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "groups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Group]) IPostable.__init__(self, Group) IPaginateable.__init__(self, Group) - self.count = self._register_child_endpoint( - MarketingGroupsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - MarketingGroupsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(MarketingGroupsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(MarketingGroupsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> MarketingGroupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingGroupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingGroupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingGroupsIdEndpoint: The initialized MarketingGroupsIdEndpoint object. """ child = MarketingGroupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Group]: """ Performs a GET request against the /marketing/groups endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Group, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Group, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Group]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Group]: """ Performs a GET request against the /marketing/groups endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Group]: The parsed response data. """ - return self._parse_many( - Group, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Group, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Group: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Group: """ Performs a POST request against the /marketing/groups endpoint. @@ -117,6 +83,4 @@ def post( Returns: Group: The parsed response data. """ - return self._parse_one( - Group, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Group, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesCountEndpoint.py index 1325ab6a1..a2e027732 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdCompaniesCountEndpoint( @@ -16,18 +15,13 @@ class MarketingGroupsIdCompaniesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/groups/{id}/companies/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/groups/{id}/companies/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesEndpoint.py index d03ad787b..ebdffa4d7 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.MarketingGroupsIdCompaniesCountEndpoint import ( MarketingGroupsIdCompaniesCountEndpoint, ) -from pyconnectwise.endpoints.manage.MarketingGroupsIdCompaniesIdEndpoint import ( - MarketingGroupsIdCompaniesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.MarketingGroupsIdCompaniesIdEndpoint import MarketingGroupsIdCompaniesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MarketingCompany from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdCompaniesEndpoint( @@ -24,10 +20,8 @@ class MarketingGroupsIdCompaniesEndpoint( IPostable[MarketingCompany, ConnectWiseManageRequestParams], IPaginateable[MarketingCompany, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "companies", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "companies", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MarketingCompany]) IPostable.__init__(self, MarketingCompany) IPaginateable.__init__(self, MarketingCompany) @@ -36,24 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 MarketingGroupsIdCompaniesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> MarketingGroupsIdCompaniesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingGroupsIdCompaniesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingGroupsIdCompaniesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingGroupsIdCompaniesIdEndpoint: The initialized MarketingGroupsIdCompaniesIdEndpoint object. """ child = MarketingGroupsIdCompaniesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketingCompany]: """ Performs a GET request against the /marketing/groups/{id}/companies endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketingCompany, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketingCompany, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MarketingCompany]: """ Performs a GET request against the /marketing/groups/{id}/companies endpoint. @@ -93,16 +77,9 @@ def get( Returns: list[MarketingCompany]: The parsed response data. """ - return self._parse_many( - MarketingCompany, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MarketingCompany, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingCompany: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketingCompany: """ Performs a POST request against the /marketing/groups/{id}/companies endpoint. @@ -112,7 +89,4 @@ def post( Returns: MarketingCompany: The parsed response data. """ - return self._parse_one( - MarketingCompany, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MarketingCompany, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesIdEndpoint.py index aa81582d0..e52bea67b 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdCompaniesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MarketingCompany from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdCompaniesIdEndpoint( ConnectWiseEndpoint, IGettable[MarketingCompany, ConnectWiseManageRequestParams], - IPuttable[MarketingCompany, ConnectWiseManageRequestParams], IPatchable[MarketingCompany, ConnectWiseManageRequestParams], + IPuttable[MarketingCompany, ConnectWiseManageRequestParams], IPaginateable[MarketingCompany, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MarketingCompany) - IPuttable.__init__(self, MarketingCompany) IPatchable.__init__(self, MarketingCompany) + IPuttable.__init__(self, MarketingCompany) IPaginateable.__init__(self, MarketingCompany) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketingCompany]: """ Performs a GET request against the /marketing/groups/{id}/companies/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketingCompany, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketingCompany, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingCompany: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/groups/{id}/companies/{id} endpoint. + Performs a DELETE request against the /marketing/groups/{id}/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MarketingCompany: The parsed response data. """ - return self._parse_one( - MarketingCompany, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketingCompany: """ - Performs a DELETE request against the /marketing/groups/{id}/companies/{id} endpoint. + Performs a GET request against the /marketing/groups/{id}/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MarketingCompany: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MarketingCompany, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingCompany: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MarketingCompany: """ - Performs a PUT request against the /marketing/groups/{id}/companies/{id} endpoint. + Performs a PATCH request against the /marketing/groups/{id}/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: MarketingCompany: The parsed response data. """ - return self._parse_one( - MarketingCompany, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MarketingCompany, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingCompany: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketingCompany: """ - Performs a PATCH request against the /marketing/groups/{id}/companies/{id} endpoint. + Performs a PUT request against the /marketing/groups/{id}/companies/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: MarketingCompany: The parsed response data. """ - return self._parse_one( - MarketingCompany, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MarketingCompany, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsCountEndpoint.py index 0ef0279ff..c542ed664 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdContactsCountEndpoint( @@ -16,18 +15,13 @@ class MarketingGroupsIdContactsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/groups/{id}/contacts/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/groups/{id}/contacts/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsEndpoint.py index ec713e579..b2690b3f1 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingGroupsIdContactsCountEndpoint import ( - MarketingGroupsIdContactsCountEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingGroupsIdContactsIdEndpoint import ( - MarketingGroupsIdContactsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.MarketingGroupsIdContactsCountEndpoint import MarketingGroupsIdContactsCountEndpoint +from pyconnectwise.endpoints.manage.MarketingGroupsIdContactsIdEndpoint import MarketingGroupsIdContactsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MarketingContact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdContactsEndpoint( @@ -24,36 +18,29 @@ class MarketingGroupsIdContactsEndpoint( IPostable[MarketingContact, ConnectWiseManageRequestParams], IPaginateable[MarketingContact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contacts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "contacts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MarketingContact]) IPostable.__init__(self, MarketingContact) IPaginateable.__init__(self, MarketingContact) - self.count = self._register_child_endpoint( - MarketingGroupsIdContactsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(MarketingGroupsIdContactsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> MarketingGroupsIdContactsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> MarketingGroupsIdContactsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized MarketingGroupsIdContactsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: MarketingGroupsIdContactsIdEndpoint: The initialized MarketingGroupsIdContactsIdEndpoint object. """ child = MarketingGroupsIdContactsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketingContact]: """ Performs a GET request against the /marketing/groups/{id}/contacts endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketingContact, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketingContact, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MarketingContact]: """ Performs a GET request against the /marketing/groups/{id}/contacts endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[MarketingContact]: The parsed response data. """ - return self._parse_many( - MarketingContact, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MarketingContact, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingContact: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketingContact: """ Performs a POST request against the /marketing/groups/{id}/contacts endpoint. @@ -112,7 +85,4 @@ def post( Returns: MarketingContact: The parsed response data. """ - return self._parse_one( - MarketingContact, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MarketingContact, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsIdEndpoint.py index a33dc8294..51635d34b 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdContactsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MarketingContact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdContactsIdEndpoint( ConnectWiseEndpoint, IGettable[MarketingContact, ConnectWiseManageRequestParams], - IPuttable[MarketingContact, ConnectWiseManageRequestParams], IPatchable[MarketingContact, ConnectWiseManageRequestParams], + IPuttable[MarketingContact, ConnectWiseManageRequestParams], IPaginateable[MarketingContact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MarketingContact) - IPuttable.__init__(self, MarketingContact) IPatchable.__init__(self, MarketingContact) + IPuttable.__init__(self, MarketingContact) IPaginateable.__init__(self, MarketingContact) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketingContact]: """ Performs a GET request against the /marketing/groups/{id}/contacts/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketingContact, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketingContact, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingContact: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/groups/{id}/contacts/{id} endpoint. + Performs a DELETE request against the /marketing/groups/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MarketingContact: The parsed response data. """ - return self._parse_one( - MarketingContact, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketingContact: """ - Performs a DELETE request against the /marketing/groups/{id}/contacts/{id} endpoint. + Performs a GET request against the /marketing/groups/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MarketingContact: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MarketingContact, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingContact: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MarketingContact: """ - Performs a PUT request against the /marketing/groups/{id}/contacts/{id} endpoint. + Performs a PATCH request against the /marketing/groups/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: MarketingContact: The parsed response data. """ - return self._parse_one( - MarketingContact, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MarketingContact, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketingContact: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketingContact: """ - Performs a PATCH request against the /marketing/groups/{id}/contacts/{id} endpoint. + Performs a PUT request against the /marketing/groups/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: MarketingContact: The parsed response data. """ - return self._parse_one( - MarketingContact, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MarketingContact, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdEndpoint.py index a2db3076c..5f86b6fc1 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdEndpoint.py @@ -1,65 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingGroupsIdCompaniesEndpoint import ( - MarketingGroupsIdCompaniesEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingGroupsIdContactsEndpoint import ( - MarketingGroupsIdContactsEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingGroupsIdInfoEndpoint import ( - MarketingGroupsIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.MarketingGroupsIdUsagesEndpoint import ( - MarketingGroupsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.MarketingGroupsIdCompaniesEndpoint import MarketingGroupsIdCompaniesEndpoint +from pyconnectwise.endpoints.manage.MarketingGroupsIdContactsEndpoint import MarketingGroupsIdContactsEndpoint +from pyconnectwise.endpoints.manage.MarketingGroupsIdInfoEndpoint import MarketingGroupsIdInfoEndpoint +from pyconnectwise.endpoints.manage.MarketingGroupsIdUsagesEndpoint import MarketingGroupsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Group from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdEndpoint( ConnectWiseEndpoint, IGettable[Group, ConnectWiseManageRequestParams], - IPuttable[Group, ConnectWiseManageRequestParams], IPatchable[Group, ConnectWiseManageRequestParams], + IPuttable[Group, ConnectWiseManageRequestParams], IPaginateable[Group, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Group) - IPuttable.__init__(self, Group) IPatchable.__init__(self, Group) + IPuttable.__init__(self, Group) IPaginateable.__init__(self, Group) - self.usages = self._register_child_endpoint( - MarketingGroupsIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.companies = self._register_child_endpoint( - MarketingGroupsIdCompaniesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - MarketingGroupsIdInfoEndpoint(client, parent_endpoint=self) - ) - self.contacts = self._register_child_endpoint( - MarketingGroupsIdContactsEndpoint(client, parent_endpoint=self) - ) + self.companies = self._register_child_endpoint(MarketingGroupsIdCompaniesEndpoint(client, parent_endpoint=self)) + self.contacts = self._register_child_endpoint(MarketingGroupsIdContactsEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(MarketingGroupsIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(MarketingGroupsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Group]: """ Performs a GET request against the /marketing/groups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -76,54 +51,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Group, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Group, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Group: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /marketing/groups/{id} endpoint. + Performs a DELETE request against the /marketing/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Group: The parsed response data. """ - return self._parse_one( - Group, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Group: """ - Performs a DELETE request against the /marketing/groups/{id} endpoint. + Performs a GET request against the /marketing/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Group: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Group, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Group: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Group: """ - Performs a PUT request against the /marketing/groups/{id} endpoint. + Performs a PATCH request against the /marketing/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,17 +85,11 @@ def put( Returns: Group: The parsed response data. """ - return self._parse_one( - Group, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Group, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Group: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Group: """ - Performs a PATCH request against the /marketing/groups/{id} endpoint. + Performs a PUT request against the /marketing/groups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -149,6 +97,4 @@ def patch( Returns: Group: The parsed response data. """ - return self._parse_one( - Group, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Group, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdInfoEndpoint.py index 89ec602dd..f8bbef469 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import GroupInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdInfoEndpoint( @@ -16,18 +15,13 @@ class MarketingGroupsIdInfoEndpoint( IGettable[GroupInfo, ConnectWiseManageRequestParams], IPaginateable[GroupInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, GroupInfo) IPaginateable.__init__(self, GroupInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GroupInfo]: """ Performs a GET request against the /marketing/groups/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GroupInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GroupInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GroupInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GroupInfo: """ Performs a GET request against the /marketing/groups/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: GroupInfo: The parsed response data. """ - return self._parse_one( - GroupInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(GroupInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesEndpoint.py index ff402922a..26f52e9a2 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingGroupsIdUsagesListEndpoint import ( - MarketingGroupsIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.MarketingGroupsIdUsagesListEndpoint import MarketingGroupsIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdUsagesEndpoint( @@ -19,22 +16,15 @@ class MarketingGroupsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - MarketingGroupsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(MarketingGroupsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /marketing/groups/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /marketing/groups/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesListEndpoint.py index e25cf4cc7..0fddfedcb 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class MarketingGroupsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /marketing/groups/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /marketing/groups/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoCountEndpoint.py index 5fb0baa11..d1ae5af0d 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsInfoCountEndpoint( @@ -16,18 +15,13 @@ class MarketingGroupsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /marketing/groups/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /marketing/groups/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoEndpoint.py index 6921c14c2..100adfd14 100644 --- a/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/MarketingGroupsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.MarketingGroupsInfoCountEndpoint import ( - MarketingGroupsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.MarketingGroupsInfoCountEndpoint import MarketingGroupsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import GroupInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class MarketingGroupsInfoEndpoint( @@ -19,22 +16,15 @@ class MarketingGroupsInfoEndpoint( IGettable[list[GroupInfo], ConnectWiseManageRequestParams], IPaginateable[GroupInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[GroupInfo]) IPaginateable.__init__(self, GroupInfo) - self.count = self._register_child_endpoint( - MarketingGroupsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(MarketingGroupsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GroupInfo]: """ Performs a GET request against the /marketing/groups/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - GroupInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), GroupInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[GroupInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[GroupInfo]: """ Performs a GET request against the /marketing/groups/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[GroupInfo]: The parsed response data. """ - return self._parse_many( - GroupInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(GroupInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsCountEndpoint.py index 7fa9e75ff..bf75139b9 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementAdjustmentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/adjustments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/adjustments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsEndpoint.py index deb2751f4..6d87e1744 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementAdjustmentsCountEndpoint import ( - ProcurementAdjustmentsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementAdjustmentsIdEndpoint import ( - ProcurementAdjustmentsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesEndpoint import ( - ProcurementAdjustmentsTypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementAdjustmentsCountEndpoint import ProcurementAdjustmentsCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementAdjustmentsIdEndpoint import ProcurementAdjustmentsIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesEndpoint import ProcurementAdjustmentsTypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProcurementAdjustment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsEndpoint( @@ -27,39 +19,30 @@ class ProcurementAdjustmentsEndpoint( IPostable[ProcurementAdjustment, ConnectWiseManageRequestParams], IPaginateable[ProcurementAdjustment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "adjustments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "adjustments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProcurementAdjustment]) IPostable.__init__(self, ProcurementAdjustment) IPaginateable.__init__(self, ProcurementAdjustment) - self.count = self._register_child_endpoint( - ProcurementAdjustmentsCountEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - ProcurementAdjustmentsTypesEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementAdjustmentsCountEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(ProcurementAdjustmentsTypesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementAdjustmentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementAdjustmentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementAdjustmentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementAdjustmentsIdEndpoint: The initialized ProcurementAdjustmentsIdEndpoint object. """ child = ProcurementAdjustmentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProcurementAdjustment]: """ Performs a GET request against the /procurement/adjustments endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProcurementAdjustment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProcurementAdjustment, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProcurementAdjustment]: """ Performs a GET request against the /procurement/adjustments endpoint. @@ -99,15 +75,10 @@ def get( Returns: list[ProcurementAdjustment]: The parsed response data. """ - return self._parse_many( - ProcurementAdjustment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProcurementAdjustment, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProcurementAdjustment: """ Performs a POST request against the /procurement/adjustments endpoint. @@ -118,7 +89,4 @@ def post( Returns: ProcurementAdjustment: The parsed response data. """ - return self._parse_one( - ProcurementAdjustment, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProcurementAdjustment, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsCountEndpoint.py index 44c5c35c9..78707a6cd 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsIdDetailsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementAdjustmentsIdDetailsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/adjustments/{id}/details/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/adjustments/{id}/details/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsEndpoint.py index 9195bada9..c69e4a98a 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementAdjustmentsIdDetailsCountEndpoint import ( ProcurementAdjustmentsIdDetailsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementAdjustmentsIdDetailsIdEndpoint import ( ProcurementAdjustmentsIdDetailsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AdjustmentDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsIdDetailsEndpoint( @@ -24,10 +22,8 @@ class ProcurementAdjustmentsIdDetailsEndpoint( IPostable[AdjustmentDetail, ConnectWiseManageRequestParams], IPaginateable[AdjustmentDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "details", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "details", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AdjustmentDetail]) IPostable.__init__(self, AdjustmentDetail) IPaginateable.__init__(self, AdjustmentDetail) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProcurementAdjustmentsIdDetailsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProcurementAdjustmentsIdDetailsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementAdjustmentsIdDetailsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementAdjustmentsIdDetailsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementAdjustmentsIdDetailsIdEndpoint: The initialized ProcurementAdjustmentsIdDetailsIdEndpoint object. """ - child = ProcurementAdjustmentsIdDetailsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementAdjustmentsIdDetailsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AdjustmentDetail]: """ Performs a GET request against the /procurement/adjustments/{id}/details endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AdjustmentDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AdjustmentDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AdjustmentDetail]: """ Performs a GET request against the /procurement/adjustments/{id}/details endpoint. @@ -95,16 +79,9 @@ def get( Returns: list[AdjustmentDetail]: The parsed response data. """ - return self._parse_many( - AdjustmentDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AdjustmentDetail, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AdjustmentDetail: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AdjustmentDetail: """ Performs a POST request against the /procurement/adjustments/{id}/details endpoint. @@ -114,7 +91,4 @@ def post( Returns: AdjustmentDetail: The parsed response data. """ - return self._parse_one( - AdjustmentDetail, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AdjustmentDetail, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsIdEndpoint.py index 45b2c1c4c..ae50a72b0 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdDetailsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AdjustmentDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsIdDetailsIdEndpoint( @@ -16,18 +15,13 @@ class ProcurementAdjustmentsIdDetailsIdEndpoint( IGettable[AdjustmentDetail, ConnectWiseManageRequestParams], IPaginateable[AdjustmentDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AdjustmentDetail) IPaginateable.__init__(self, AdjustmentDetail) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AdjustmentDetail]: """ Performs a GET request against the /procurement/adjustments/{id}/details/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,27 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AdjustmentDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AdjustmentDetail, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AdjustmentDetail: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/adjustments/{id}/details/{id} endpoint. + Performs a DELETE request against the /procurement/adjustments/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AdjustmentDetail: The parsed response data. """ - return self._parse_one( - AdjustmentDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AdjustmentDetail: """ - Performs a DELETE request against the /procurement/adjustments/{id}/details/{id} endpoint. + Performs a GET request against the /procurement/adjustments/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AdjustmentDetail: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AdjustmentDetail, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdEndpoint.py index aa325b961..7525f3df1 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementAdjustmentsIdDetailsEndpoint import ( ProcurementAdjustmentsIdDetailsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProcurementAdjustment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsIdEndpoint( ConnectWiseEndpoint, IGettable[ProcurementAdjustment, ConnectWiseManageRequestParams], - IPuttable[ProcurementAdjustment, ConnectWiseManageRequestParams], IPatchable[ProcurementAdjustment, ConnectWiseManageRequestParams], + IPuttable[ProcurementAdjustment, ConnectWiseManageRequestParams], IPaginateable[ProcurementAdjustment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProcurementAdjustment) - IPuttable.__init__(self, ProcurementAdjustment) IPatchable.__init__(self, ProcurementAdjustment) + IPuttable.__init__(self, ProcurementAdjustment) IPaginateable.__init__(self, ProcurementAdjustment) self.details = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProcurementAdjustment]: """ Performs a GET request against the /procurement/adjustments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +50,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProcurementAdjustment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProcurementAdjustment, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProcurementAdjustment: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/adjustments/{id} endpoint. + Performs a DELETE request against the /procurement/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProcurementAdjustment: The parsed response data. """ - return self._parse_one( - ProcurementAdjustment, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ProcurementAdjustment: """ - Performs a DELETE request against the /procurement/adjustments/{id} endpoint. + Performs a GET request against the /procurement/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProcurementAdjustment: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProcurementAdjustment, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ProcurementAdjustment: """ - Performs a PUT request against the /procurement/adjustments/{id} endpoint. + Performs a PATCH request against the /procurement/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +89,13 @@ def put( Returns: ProcurementAdjustment: The parsed response data. """ - return self._parse_one( - ProcurementAdjustment, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ProcurementAdjustment, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProcurementAdjustment: """ - Performs a PATCH request against the /procurement/adjustments/{id} endpoint. + Performs a PUT request against the /procurement/adjustments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +103,4 @@ def patch( Returns: ProcurementAdjustment: The parsed response data. """ - return self._parse_one( - ProcurementAdjustment, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProcurementAdjustment, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesCountEndpoint.py index 9328ba98b..c8e10d71f 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementAdjustmentsTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/adjustments/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/adjustments/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesEndpoint.py index ffbb26218..d27a28a99 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesEndpoint.py @@ -1,24 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesCountEndpoint import ( ProcurementAdjustmentsTypesCountEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesIdEndpoint import ( - ProcurementAdjustmentsTypesIdEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesIdEndpoint import ProcurementAdjustmentsTypesIdEndpoint from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesInfoEndpoint import ( ProcurementAdjustmentsTypesInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AdjustmentType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesEndpoint( @@ -27,10 +23,8 @@ class ProcurementAdjustmentsTypesEndpoint( IPostable[AdjustmentType, ConnectWiseManageRequestParams], IPaginateable[AdjustmentType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AdjustmentType]) IPostable.__init__(self, AdjustmentType) IPaginateable.__init__(self, AdjustmentType) @@ -38,28 +32,23 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 self.count = self._register_child_endpoint( ProcurementAdjustmentsTypesCountEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ProcurementAdjustmentsTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProcurementAdjustmentsTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementAdjustmentsTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementAdjustmentsTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementAdjustmentsTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementAdjustmentsTypesIdEndpoint: The initialized ProcurementAdjustmentsTypesIdEndpoint object. """ child = ProcurementAdjustmentsTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AdjustmentType]: """ Performs a GET request against the /procurement/adjustments/types endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +66,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AdjustmentType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AdjustmentType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AdjustmentType]: """ Performs a GET request against the /procurement/adjustments/types endpoint. @@ -99,16 +81,9 @@ def get( Returns: list[AdjustmentType]: The parsed response data. """ - return self._parse_many( - AdjustmentType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AdjustmentType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AdjustmentType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AdjustmentType: """ Performs a POST request against the /procurement/adjustments/types endpoint. @@ -118,7 +93,4 @@ def post( Returns: AdjustmentType: The parsed response data. """ - return self._parse_one( - AdjustmentType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AdjustmentType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdEndpoint.py index 91eaa7713..302324769 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesIdInfoEndpoint import ( ProcurementAdjustmentsTypesIdInfoEndpoint, @@ -5,49 +7,38 @@ from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesIdUsagesEndpoint import ( ProcurementAdjustmentsTypesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AdjustmentType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesIdEndpoint( ConnectWiseEndpoint, IGettable[AdjustmentType, ConnectWiseManageRequestParams], - IPuttable[AdjustmentType, ConnectWiseManageRequestParams], IPatchable[AdjustmentType, ConnectWiseManageRequestParams], + IPuttable[AdjustmentType, ConnectWiseManageRequestParams], IPaginateable[AdjustmentType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AdjustmentType) - IPuttable.__init__(self, AdjustmentType) IPatchable.__init__(self, AdjustmentType) + IPuttable.__init__(self, AdjustmentType) IPaginateable.__init__(self, AdjustmentType) - self.usages = self._register_child_endpoint( - ProcurementAdjustmentsTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( ProcurementAdjustmentsTypesIdInfoEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint( + ProcurementAdjustmentsTypesIdUsagesEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AdjustmentType]: """ Performs a GET request against the /procurement/adjustments/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +56,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AdjustmentType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AdjustmentType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AdjustmentType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/adjustments/types/{id} endpoint. + Performs a DELETE request against the /procurement/adjustments/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AdjustmentType: The parsed response data. """ - return self._parse_one( - AdjustmentType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AdjustmentType: """ - Performs a DELETE request against the /procurement/adjustments/types/{id} endpoint. + Performs a GET request against the /procurement/adjustments/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AdjustmentType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AdjustmentType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AdjustmentType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AdjustmentType: """ - Performs a PUT request against the /procurement/adjustments/types/{id} endpoint. + Performs a PATCH request against the /procurement/adjustments/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +91,11 @@ def put( Returns: AdjustmentType: The parsed response data. """ - return self._parse_one( - AdjustmentType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AdjustmentType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AdjustmentType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AdjustmentType: """ - Performs a PATCH request against the /procurement/adjustments/types/{id} endpoint. + Performs a PUT request against the /procurement/adjustments/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +103,4 @@ def patch( Returns: AdjustmentType: The parsed response data. """ - return self._parse_one( - AdjustmentType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AdjustmentType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdInfoEndpoint.py index e64d0608a..5b72a83d2 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AdjustmentTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementAdjustmentsTypesIdInfoEndpoint( IGettable[AdjustmentTypeInfo, ConnectWiseManageRequestParams], IPaginateable[AdjustmentTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, AdjustmentTypeInfo) IPaginateable.__init__(self, AdjustmentTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AdjustmentTypeInfo]: """ Performs a GET request against the /procurement/adjustments/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AdjustmentTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AdjustmentTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AdjustmentTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AdjustmentTypeInfo: """ Performs a GET request against the /procurement/adjustments/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: AdjustmentTypeInfo: The parsed response data. """ - return self._parse_one( - AdjustmentTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(AdjustmentTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesEndpoint.py index 0ea3f3500..5f27e4fe3 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesIdUsagesListEndpoint import ( ProcurementAdjustmentsTypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesIdUsagesEndpoint( @@ -19,24 +18,17 @@ class ProcurementAdjustmentsTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - ProcurementAdjustmentsTypesIdUsagesListEndpoint( - client, parent_endpoint=self - ) + ProcurementAdjustmentsTypesIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/adjustments/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/adjustments/types/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesListEndpoint.py index bcf004c4f..926ced5c0 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProcurementAdjustmentsTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/adjustments/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/adjustments/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoCountEndpoint.py index 4421c7489..8700f0ed1 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementAdjustmentsTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/adjustments/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/adjustments/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoEndpoint.py index f30d1d339..f1c1de0c8 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementAdjustmentsTypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementAdjustmentsTypesInfoCountEndpoint import ( ProcurementAdjustmentsTypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AdjustmentTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementAdjustmentsTypesInfoEndpoint( @@ -19,10 +18,8 @@ class ProcurementAdjustmentsTypesInfoEndpoint( IGettable[list[AdjustmentTypeInfo], ConnectWiseManageRequestParams], IPaginateable[AdjustmentTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AdjustmentTypeInfo]) IPaginateable.__init__(self, AdjustmentTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AdjustmentTypeInfo]: """ Performs a GET request against the /procurement/adjustments/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AdjustmentTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AdjustmentTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AdjustmentTypeInfo]: """ Performs a GET request against the /procurement/adjustments/types/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[AdjustmentTypeInfo]: The parsed response data. """ - return self._parse_many( - AdjustmentTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AdjustmentTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogCountEndpoint.py index 2b581e881..19fe49549 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/catalog/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/catalog/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogEndpoint.py index 1f7fc6aae..7c1fb9698 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementCatalogCountEndpoint import ( - ProcurementCatalogCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCatalogIdEndpoint import ( - ProcurementCatalogIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCatalogInfoEndpoint import ( - ProcurementCatalogInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementCatalogCountEndpoint import ProcurementCatalogCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementCatalogIdEndpoint import ProcurementCatalogIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementCatalogInfoEndpoint import ProcurementCatalogInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CatalogItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogEndpoint( @@ -27,39 +19,30 @@ class ProcurementCatalogEndpoint( IPostable[CatalogItem, ConnectWiseManageRequestParams], IPaginateable[CatalogItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "catalog", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "catalog", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CatalogItem]) IPostable.__init__(self, CatalogItem) IPaginateable.__init__(self, CatalogItem) - self.count = self._register_child_endpoint( - ProcurementCatalogCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementCatalogInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementCatalogCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementCatalogInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementCatalogIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementCatalogIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementCatalogIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementCatalogIdEndpoint: The initialized ProcurementCatalogIdEndpoint object. """ child = ProcurementCatalogIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogItem]: """ Performs a GET request against the /procurement/catalog endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogItem, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CatalogItem]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CatalogItem]: """ Performs a GET request against the /procurement/catalog endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[CatalogItem]: The parsed response data. """ - return self._parse_many( - CatalogItem, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CatalogItem, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogItem: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogItem: """ Performs a POST request against the /procurement/catalog endpoint. @@ -117,6 +85,4 @@ def post( Returns: CatalogItem: The parsed response data. """ - return self._parse_one( - CatalogItem, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CatalogItem, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsCountEndpoint.py index d8162a736..e6a5d3135 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdComponentsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogIdComponentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/catalog/{id}/components/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/catalog/{id}/components/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsEndpoint.py index 73b8e79b6..bbf0cd464 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementCatalogIdComponentsCountEndpoint import ( ProcurementCatalogIdComponentsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementCatalogIdComponentsIdEndpoint import ( ProcurementCatalogIdComponentsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CatalogComponent from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdComponentsEndpoint( @@ -24,10 +22,8 @@ class ProcurementCatalogIdComponentsEndpoint( IPostable[CatalogComponent, ConnectWiseManageRequestParams], IPaginateable[CatalogComponent, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "components", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "components", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CatalogComponent]) IPostable.__init__(self, CatalogComponent) IPaginateable.__init__(self, CatalogComponent) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProcurementCatalogIdComponentsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProcurementCatalogIdComponentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementCatalogIdComponentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementCatalogIdComponentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementCatalogIdComponentsIdEndpoint: The initialized ProcurementCatalogIdComponentsIdEndpoint object. """ - child = ProcurementCatalogIdComponentsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementCatalogIdComponentsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogComponent]: """ Performs a GET request against the /procurement/catalog/{id}/components endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogComponent, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogComponent, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CatalogComponent]: """ Performs a GET request against the /procurement/catalog/{id}/components endpoint. @@ -95,16 +79,9 @@ def get( Returns: list[CatalogComponent]: The parsed response data. """ - return self._parse_many( - CatalogComponent, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CatalogComponent, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogComponent: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogComponent: """ Performs a POST request against the /procurement/catalog/{id}/components endpoint. @@ -114,7 +91,4 @@ def post( Returns: CatalogComponent: The parsed response data. """ - return self._parse_one( - CatalogComponent, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CatalogComponent, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsIdEndpoint.py index 8997d38e2..46eacebfb 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdComponentsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CatalogComponent from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdComponentsIdEndpoint( ConnectWiseEndpoint, IGettable[CatalogComponent, ConnectWiseManageRequestParams], - IPuttable[CatalogComponent, ConnectWiseManageRequestParams], IPatchable[CatalogComponent, ConnectWiseManageRequestParams], + IPuttable[CatalogComponent, ConnectWiseManageRequestParams], IPaginateable[CatalogComponent, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CatalogComponent) - IPuttable.__init__(self, CatalogComponent) IPatchable.__init__(self, CatalogComponent) + IPuttable.__init__(self, CatalogComponent) IPaginateable.__init__(self, CatalogComponent) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogComponent]: """ Performs a GET request against the /procurement/catalog/{id}/components/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogComponent, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogComponent, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogComponent: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/catalog/{id}/components/{id} endpoint. + Performs a DELETE request against the /procurement/catalog/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CatalogComponent: The parsed response data. """ - return self._parse_one( - CatalogComponent, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogComponent: """ - Performs a DELETE request against the /procurement/catalog/{id}/components/{id} endpoint. + Performs a GET request against the /procurement/catalog/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CatalogComponent: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CatalogComponent, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogComponent: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CatalogComponent: """ - Performs a PUT request against the /procurement/catalog/{id}/components/{id} endpoint. + Performs a PATCH request against the /procurement/catalog/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: CatalogComponent: The parsed response data. """ - return self._parse_one( - CatalogComponent, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CatalogComponent, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogComponent: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogComponent: """ - Performs a PATCH request against the /procurement/catalog/{id}/components/{id} endpoint. + Performs a PUT request against the /procurement/catalog/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: CatalogComponent: The parsed response data. """ - return self._parse_one( - CatalogComponent, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CatalogComponent, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdEndpoint.py index b9456d4ce..2311f5f10 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdEndpoint.py @@ -1,79 +1,56 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementCatalogIdComponentsEndpoint import ( - ProcurementCatalogIdComponentsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCatalogIdInfoEndpoint import ( - ProcurementCatalogIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCatalogIdInventoryEndpoint import ( - ProcurementCatalogIdInventoryEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementCatalogIdComponentsEndpoint import ProcurementCatalogIdComponentsEndpoint +from pyconnectwise.endpoints.manage.ProcurementCatalogIdInfoEndpoint import ProcurementCatalogIdInfoEndpoint +from pyconnectwise.endpoints.manage.ProcurementCatalogIdInventoryEndpoint import ProcurementCatalogIdInventoryEndpoint from pyconnectwise.endpoints.manage.ProcurementCatalogIdMinimumstockbywarehouseEndpoint import ( ProcurementCatalogIdMinimumstockbywarehouseEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementCatalogIdPricingEndpoint import ( - ProcurementCatalogIdPricingEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementCatalogIdPricingEndpoint import ProcurementCatalogIdPricingEndpoint from pyconnectwise.endpoints.manage.ProcurementCatalogIdQuantityonhandEndpoint import ( ProcurementCatalogIdQuantityonhandEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CatalogItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdEndpoint( ConnectWiseEndpoint, IGettable[CatalogItem, ConnectWiseManageRequestParams], - IPuttable[CatalogItem, ConnectWiseManageRequestParams], IPatchable[CatalogItem, ConnectWiseManageRequestParams], + IPuttable[CatalogItem, ConnectWiseManageRequestParams], IPaginateable[CatalogItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CatalogItem) - IPuttable.__init__(self, CatalogItem) IPatchable.__init__(self, CatalogItem) + IPuttable.__init__(self, CatalogItem) IPaginateable.__init__(self, CatalogItem) - self.info = self._register_child_endpoint( - ProcurementCatalogIdInfoEndpoint(client, parent_endpoint=self) - ) self.components = self._register_child_endpoint( ProcurementCatalogIdComponentsEndpoint(client, parent_endpoint=self) ) + self.info = self._register_child_endpoint(ProcurementCatalogIdInfoEndpoint(client, parent_endpoint=self)) self.inventory = self._register_child_endpoint( ProcurementCatalogIdInventoryEndpoint(client, parent_endpoint=self) ) - self.pricing = self._register_child_endpoint( - ProcurementCatalogIdPricingEndpoint(client, parent_endpoint=self) - ) self.minimum_stock_by_warehouse = self._register_child_endpoint( - ProcurementCatalogIdMinimumstockbywarehouseEndpoint( - client, parent_endpoint=self - ) + ProcurementCatalogIdMinimumstockbywarehouseEndpoint(client, parent_endpoint=self) ) + self.pricing = self._register_child_endpoint(ProcurementCatalogIdPricingEndpoint(client, parent_endpoint=self)) self.quantity_on_hand = self._register_child_endpoint( ProcurementCatalogIdQuantityonhandEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogItem]: """ Performs a GET request against the /procurement/catalog/{id} endpoint and returns an initialized PaginatedResponse object. @@ -91,53 +68,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogItem, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogItem: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/catalog/{id} endpoint. + Performs a DELETE request against the /procurement/catalog/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CatalogItem: The parsed response data. """ - return self._parse_one( - CatalogItem, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogItem: """ - Performs a DELETE request against the /procurement/catalog/{id} endpoint. + Performs a GET request against the /procurement/catalog/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CatalogItem: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CatalogItem, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogItem: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CatalogItem: """ - Performs a PUT request against the /procurement/catalog/{id} endpoint. + Performs a PATCH request against the /procurement/catalog/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -145,17 +103,11 @@ def put( Returns: CatalogItem: The parsed response data. """ - return self._parse_one( - CatalogItem, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CatalogItem, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogItem: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogItem: """ - Performs a PATCH request against the /procurement/catalog/{id} endpoint. + Performs a PUT request against the /procurement/catalog/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -163,6 +115,4 @@ def patch( Returns: CatalogItem: The parsed response data. """ - return self._parse_one( - CatalogItem, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(CatalogItem, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInfoEndpoint.py index 7a6557d24..972d7411a 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CatalogItemInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogIdInfoEndpoint( IGettable[CatalogItemInfo, ConnectWiseManageRequestParams], IPaginateable[CatalogItemInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CatalogItemInfo) IPaginateable.__init__(self, CatalogItemInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogItemInfo]: """ Performs a GET request against the /procurement/catalog/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogItemInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogItemInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogItemInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogItemInfo: """ Performs a GET request against the /procurement/catalog/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: CatalogItemInfo: The parsed response data. """ - return self._parse_one( - CatalogItemInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CatalogItemInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryCountEndpoint.py index 95d78ec6d..228845770 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdInventoryCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogIdInventoryCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/catalog/{id}/inventory/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/catalog/{id}/inventory/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryEndpoint.py index 2cbee2028..5447d0b40 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementCatalogIdInventoryCountEndpoint import ( ProcurementCatalogIdInventoryCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementCatalogIdInventoryIdEndpoint import ( ProcurementCatalogIdInventoryIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CatalogInventory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdInventoryEndpoint( @@ -22,10 +21,8 @@ class ProcurementCatalogIdInventoryEndpoint( IGettable[list[CatalogInventory], ConnectWiseManageRequestParams], IPaginateable[CatalogInventory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "inventory", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "inventory", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CatalogInventory]) IPaginateable.__init__(self, CatalogInventory) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProcurementCatalogIdInventoryCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProcurementCatalogIdInventoryIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementCatalogIdInventoryIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementCatalogIdInventoryIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementCatalogIdInventoryIdEndpoint: The initialized ProcurementCatalogIdInventoryIdEndpoint object. """ - child = ProcurementCatalogIdInventoryIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementCatalogIdInventoryIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogInventory]: """ Performs a GET request against the /procurement/catalog/{id}/inventory endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogInventory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogInventory, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CatalogInventory]: """ Performs a GET request against the /procurement/catalog/{id}/inventory endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[CatalogInventory]: The parsed response data. """ - return self._parse_many( - CatalogInventory, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CatalogInventory, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryIdEndpoint.py index b51a54479..b2f27db8a 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdInventoryIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CatalogInventory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdInventoryIdEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogIdInventoryIdEndpoint( IGettable[CatalogInventory, ConnectWiseManageRequestParams], IPaginateable[CatalogInventory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CatalogInventory) IPaginateable.__init__(self, CatalogInventory) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogInventory]: """ Performs a GET request against the /procurement/catalog/{id}/inventory/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogInventory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogInventory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogInventory: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogInventory: """ Performs a GET request against the /procurement/catalog/{id}/inventory/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: CatalogInventory: The parsed response data. """ - return self._parse_one( - CatalogInventory, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CatalogInventory, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint.py index 29a52bb18..5c0a3bfc4 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/catalog/{id}/minimumStockByWarehouse/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/catalog/{id}/minimumStockByWarehouse/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseEndpoint.py index cb8ed57b5..31e72783f 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint import ( ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint import ( ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MinimumStockByWarehouse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdMinimumstockbywarehouseEndpoint( @@ -24,42 +22,31 @@ class ProcurementCatalogIdMinimumstockbywarehouseEndpoint( IPostable[MinimumStockByWarehouse, ConnectWiseManageRequestParams], IPaginateable[MinimumStockByWarehouse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "minimumStockByWarehouse", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "minimumStockByWarehouse", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MinimumStockByWarehouse]) IPostable.__init__(self, MinimumStockByWarehouse) IPaginateable.__init__(self, MinimumStockByWarehouse) self.count = self._register_child_endpoint( - ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint( - client, parent_endpoint=self - ) + ProcurementCatalogIdMinimumstockbywarehouseCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint: + def id(self, _id: int) -> ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint: The initialized ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint object. """ - child = ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MinimumStockByWarehouse]: """ Performs a GET request against the /procurement/catalog/{id}/minimumStockByWarehouse endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MinimumStockByWarehouse, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MinimumStockByWarehouse, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MinimumStockByWarehouse]: """ Performs a GET request against the /procurement/catalog/{id}/minimumStockByWarehouse endpoint. @@ -99,15 +79,10 @@ def get( Returns: list[MinimumStockByWarehouse]: The parsed response data. """ - return self._parse_many( - MinimumStockByWarehouse, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MinimumStockByWarehouse, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MinimumStockByWarehouse: """ Performs a POST request against the /procurement/catalog/{id}/minimumStockByWarehouse endpoint. @@ -118,7 +93,4 @@ def post( Returns: MinimumStockByWarehouse: The parsed response data. """ - return self._parse_one( - MinimumStockByWarehouse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MinimumStockByWarehouse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint.py index 5bca8721d..8181b16cc 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MinimumStockByWarehouse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdMinimumstockbywarehouseIdEndpoint( ConnectWiseEndpoint, IGettable[MinimumStockByWarehouse, ConnectWiseManageRequestParams], - IPuttable[MinimumStockByWarehouse, ConnectWiseManageRequestParams], IPatchable[MinimumStockByWarehouse, ConnectWiseManageRequestParams], + IPuttable[MinimumStockByWarehouse, ConnectWiseManageRequestParams], IPaginateable[MinimumStockByWarehouse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MinimumStockByWarehouse) - IPuttable.__init__(self, MinimumStockByWarehouse) IPatchable.__init__(self, MinimumStockByWarehouse) + IPuttable.__init__(self, MinimumStockByWarehouse) IPaginateable.__init__(self, MinimumStockByWarehouse) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MinimumStockByWarehouse]: """ Performs a GET request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MinimumStockByWarehouse, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MinimumStockByWarehouse, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MinimumStockByWarehouse: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. + Performs a DELETE request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MinimumStockByWarehouse: The parsed response data. """ - return self._parse_one( - MinimumStockByWarehouse, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> MinimumStockByWarehouse: """ - Performs a DELETE request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. + Performs a GET request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MinimumStockByWarehouse: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MinimumStockByWarehouse, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> MinimumStockByWarehouse: """ - Performs a PUT request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. + Performs a PATCH request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: MinimumStockByWarehouse: The parsed response data. """ - return self._parse_one( - MinimumStockByWarehouse, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MinimumStockByWarehouse, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MinimumStockByWarehouse: """ - Performs a PATCH request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. + Performs a PUT request against the /procurement/catalog/{id}/minimumStockByWarehouse/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: MinimumStockByWarehouse: The parsed response data. """ - return self._parse_one( - MinimumStockByWarehouse, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MinimumStockByWarehouse, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdPricingEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdPricingEndpoint.py index b0d836cdd..127c393fd 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdPricingEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdPricingEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import CatalogPricing -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdPricingEndpoint( ConnectWiseEndpoint, IPostable[CatalogPricing, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "pricing", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "pricing", parent_endpoint=parent_endpoint) IPostable.__init__(self, CatalogPricing) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CatalogPricing: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CatalogPricing: """ Performs a POST request against the /procurement/catalog/{id}/pricing endpoint. @@ -32,7 +26,4 @@ def post( Returns: CatalogPricing: The parsed response data. """ - return self._parse_one( - CatalogPricing, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CatalogPricing, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdQuantityonhandEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdQuantityonhandEndpoint.py index 35f6ac8a3..8a485838b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdQuantityonhandEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogIdQuantityonhandEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogIdQuantityonhandEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogIdQuantityonhandEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "quantityOnHand", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "quantityOnHand", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/catalog/{id}/quantityOnHand endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/catalog/{id}/quantityOnHand endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoCountEndpoint.py index dd9b28b7b..70be0722f 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCatalogInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/catalog/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/catalog/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoEndpoint.py index 1d3bac895..70d1ace46 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCatalogInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementCatalogInfoCountEndpoint import ( - ProcurementCatalogInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProcurementCatalogInfoCountEndpoint import ProcurementCatalogInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CatalogItemInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCatalogInfoEndpoint( @@ -19,22 +16,15 @@ class ProcurementCatalogInfoEndpoint( IGettable[list[CatalogItemInfo], ConnectWiseManageRequestParams], IPaginateable[CatalogItemInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CatalogItemInfo]) IPaginateable.__init__(self, CatalogItemInfo) - self.count = self._register_child_endpoint( - ProcurementCatalogInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementCatalogInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CatalogItemInfo]: """ Performs a GET request against the /procurement/catalog/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CatalogItemInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CatalogItemInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CatalogItemInfo]: """ Performs a GET request against the /procurement/catalog/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[CatalogItemInfo]: The parsed response data. """ - return self._parse_many( - CatalogItemInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CatalogItemInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesCountEndpoint.py index b415b71b8..403b282e6 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/categories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/categories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesEndpoint.py index fabba2502..00e1dbf52 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementCategoriesCountEndpoint import ( - ProcurementCategoriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCategoriesIdEndpoint import ( - ProcurementCategoriesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCategoriesInfoEndpoint import ( - ProcurementCategoriesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementCategoriesCountEndpoint import ProcurementCategoriesCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementCategoriesIdEndpoint import ProcurementCategoriesIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementCategoriesInfoEndpoint import ProcurementCategoriesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Category from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesEndpoint( @@ -27,39 +19,30 @@ class ProcurementCategoriesEndpoint( IPostable[Category, ConnectWiseManageRequestParams], IPaginateable[Category, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "categories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "categories", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Category]) IPostable.__init__(self, Category) IPaginateable.__init__(self, Category) - self.count = self._register_child_endpoint( - ProcurementCategoriesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementCategoriesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementCategoriesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementCategoriesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementCategoriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementCategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementCategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementCategoriesIdEndpoint: The initialized ProcurementCategoriesIdEndpoint object. """ child = ProcurementCategoriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Category]: """ Performs a GET request against the /procurement/categories endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Category, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Category, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Category]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Category]: """ Performs a GET request against the /procurement/categories endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Category]: The parsed response data. """ - return self._parse_many( - Category, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Category, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Category: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Category: """ Performs a POST request against the /procurement/categories endpoint. @@ -117,6 +83,4 @@ def post( Returns: Category: The parsed response data. """ - return self._parse_one( - Category, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Category, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdEndpoint.py index 3446a456d..0870de377 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdEndpoint.py @@ -1,53 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementCategoriesIdInfoEndpoint import ( - ProcurementCategoriesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementCategoriesIdInfoEndpoint import ProcurementCategoriesIdInfoEndpoint from pyconnectwise.endpoints.manage.ProcurementCategoriesIdSubcategoriesEndpoint import ( ProcurementCategoriesIdSubcategoriesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Category from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesIdEndpoint( ConnectWiseEndpoint, IGettable[Category, ConnectWiseManageRequestParams], - IPuttable[Category, ConnectWiseManageRequestParams], IPatchable[Category, ConnectWiseManageRequestParams], + IPuttable[Category, ConnectWiseManageRequestParams], IPaginateable[Category, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Category) - IPuttable.__init__(self, Category) IPatchable.__init__(self, Category) + IPuttable.__init__(self, Category) IPaginateable.__init__(self, Category) + self.info = self._register_child_endpoint(ProcurementCategoriesIdInfoEndpoint(client, parent_endpoint=self)) self.subcategories = self._register_child_endpoint( ProcurementCategoriesIdSubcategoriesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ProcurementCategoriesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Category]: """ Performs a GET request against the /procurement/categories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +51,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Category, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Category, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Category: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/categories/{id} endpoint. + Performs a DELETE request against the /procurement/categories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Category: The parsed response data. """ - return self._parse_one( - Category, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Category: """ - Performs a DELETE request against the /procurement/categories/{id} endpoint. + Performs a GET request against the /procurement/categories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Category: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Category, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Category: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Category: """ - Performs a PUT request against the /procurement/categories/{id} endpoint. + Performs a PATCH request against the /procurement/categories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +85,11 @@ def put( Returns: Category: The parsed response data. """ - return self._parse_one( - Category, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Category, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Category: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Category: """ - Performs a PATCH request against the /procurement/categories/{id} endpoint. + Performs a PUT request against the /procurement/categories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +97,4 @@ def patch( Returns: Category: The parsed response data. """ - return self._parse_one( - Category, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Category, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdInfoEndpoint.py index fe8fff4ca..943db05d0 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CategoryInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementCategoriesIdInfoEndpoint( IGettable[CategoryInfo, ConnectWiseManageRequestParams], IPaginateable[CategoryInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CategoryInfo) IPaginateable.__init__(self, CategoryInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CategoryInfo]: """ Performs a GET request against the /procurement/categories/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CategoryInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CategoryInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CategoryInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CategoryInfo: """ Performs a GET request against the /procurement/categories/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: CategoryInfo: The parsed response data. """ - return self._parse_one( - CategoryInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CategoryInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesCountEndpoint.py index 6d07fd27c..e38e07edf 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesIdSubcategoriesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCategoriesIdSubcategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/categories/{id}/subcategories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/categories/{id}/subcategories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesEndpoint.py index c1adc84da..c24f367ca 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementCategoriesIdSubcategoriesCountEndpoint import ( ProcurementCategoriesIdSubcategoriesCountEndpoint, @@ -9,37 +11,30 @@ ProcurementCategoriesIdSubcategoriesInfoEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ProcurementCategoriesIdSubcategoriesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "subcategories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "subcategories", parent_endpoint=parent_endpoint) self.count = self._register_child_endpoint( - ProcurementCategoriesIdSubcategoriesCountEndpoint( - client, parent_endpoint=self - ) + ProcurementCategoriesIdSubcategoriesCountEndpoint(client, parent_endpoint=self) ) self.info = self._register_child_endpoint( - ProcurementCategoriesIdSubcategoriesInfoEndpoint( - client, parent_endpoint=self - ) + ProcurementCategoriesIdSubcategoriesInfoEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementCategoriesIdSubcategoriesIdEndpoint: + def id(self, _id: int) -> ProcurementCategoriesIdSubcategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementCategoriesIdSubcategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementCategoriesIdSubcategoriesIdEndpoint: The initialized ProcurementCategoriesIdSubcategoriesIdEndpoint object. """ - child = ProcurementCategoriesIdSubcategoriesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementCategoriesIdSubcategoriesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdEndpoint.py index d6fdbb463..4ccab8cb3 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementCategoriesIdSubcategoriesIdInfoEndpoint import ( ProcurementCategoriesIdSubcategoriesIdInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import LegacySubCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesIdSubcategoriesIdEndpoint( ConnectWiseEndpoint, IGettable[LegacySubCategory, ConnectWiseManageRequestParams], - IPuttable[LegacySubCategory, ConnectWiseManageRequestParams], IPatchable[LegacySubCategory, ConnectWiseManageRequestParams], + IPuttable[LegacySubCategory, ConnectWiseManageRequestParams], IPaginateable[LegacySubCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LegacySubCategory) - IPuttable.__init__(self, LegacySubCategory) IPatchable.__init__(self, LegacySubCategory) + IPuttable.__init__(self, LegacySubCategory) IPaginateable.__init__(self, LegacySubCategory) self.info = self._register_child_endpoint( - ProcurementCategoriesIdSubcategoriesIdInfoEndpoint( - client, parent_endpoint=self - ) + ProcurementCategoriesIdSubcategoriesIdInfoEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LegacySubCategory]: """ Performs a GET request against the /procurement/categories/{id}/subcategories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LegacySubCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LegacySubCategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LegacySubCategory: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/categories/{id}/subcategories/{id} endpoint. + Performs a DELETE request against the /procurement/categories/{id}/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - LegacySubCategory: The parsed response data. """ - return self._parse_one( - LegacySubCategory, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LegacySubCategory: """ - Performs a DELETE request against the /procurement/categories/{id}/subcategories/{id} endpoint. + Performs a GET request against the /procurement/categories/{id}/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + LegacySubCategory: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(LegacySubCategory, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LegacySubCategory: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> LegacySubCategory: """ - Performs a PUT request against the /procurement/categories/{id}/subcategories/{id} endpoint. + Performs a PATCH request against the /procurement/categories/{id}/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -116,18 +85,11 @@ def put( Returns: LegacySubCategory: The parsed response data. """ - return self._parse_one( - LegacySubCategory, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(LegacySubCategory, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> LegacySubCategory: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LegacySubCategory: """ - Performs a PATCH request against the /procurement/categories/{id}/subcategories/{id} endpoint. + Performs a PUT request against the /procurement/categories/{id}/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,7 +97,4 @@ def patch( Returns: LegacySubCategory: The parsed response data. """ - return self._parse_one( - LegacySubCategory, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(LegacySubCategory, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdInfoEndpoint.py index 5e2cec6a6..6a0bd6884 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LegacySubCategoryInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesIdSubcategoriesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementCategoriesIdSubcategoriesIdInfoEndpoint( IGettable[LegacySubCategoryInfo, ConnectWiseManageRequestParams], IPaginateable[LegacySubCategoryInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, LegacySubCategoryInfo) IPaginateable.__init__(self, LegacySubCategoryInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LegacySubCategoryInfo]: """ Performs a GET request against the /procurement/categories/{id}/subcategories/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LegacySubCategoryInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LegacySubCategoryInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> LegacySubCategoryInfo: """ Performs a GET request against the /procurement/categories/{id}/subcategories/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: LegacySubCategoryInfo: The parsed response data. """ - return self._parse_one( - LegacySubCategoryInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(LegacySubCategoryInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoCountEndpoint.py index 50f6b17be..77e3f060a 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesIdSubcategoriesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCategoriesIdSubcategoriesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/categories/{id}/subcategories/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/categories/{id}/subcategories/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoEndpoint.py index bf8ff2244..2d85beefc 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesIdSubcategoriesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementCategoriesIdSubcategoriesInfoCountEndpoint import ( ProcurementCategoriesIdSubcategoriesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LegacySubCategoryInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesIdSubcategoriesInfoEndpoint( @@ -19,24 +18,17 @@ class ProcurementCategoriesIdSubcategoriesInfoEndpoint( IGettable[list[LegacySubCategoryInfo], ConnectWiseManageRequestParams], IPaginateable[LegacySubCategoryInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LegacySubCategoryInfo]) IPaginateable.__init__(self, LegacySubCategoryInfo) self.count = self._register_child_endpoint( - ProcurementCategoriesIdSubcategoriesInfoCountEndpoint( - client, parent_endpoint=self - ) + ProcurementCategoriesIdSubcategoriesInfoCountEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LegacySubCategoryInfo]: """ Performs a GET request against the /procurement/categories/{id}/subcategories/info endpoint and returns an initialized PaginatedResponse object. @@ -54,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LegacySubCategoryInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LegacySubCategoryInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[LegacySubCategoryInfo]: """ Performs a GET request against the /procurement/categories/{id}/subcategories/info endpoint. @@ -76,7 +61,4 @@ def get( Returns: list[LegacySubCategoryInfo]: The parsed response data. """ - return self._parse_many( - LegacySubCategoryInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(LegacySubCategoryInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoCountEndpoint.py index a2087dea1..4d50dba1d 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementCategoriesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/categories/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/categories/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoEndpoint.py index 489297844..9d466692a 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementCategoriesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementCategoriesInfoCountEndpoint import ( - ProcurementCategoriesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProcurementCategoriesInfoCountEndpoint import ProcurementCategoriesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CategoryInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementCategoriesInfoEndpoint( @@ -19,22 +16,15 @@ class ProcurementCategoriesInfoEndpoint( IGettable[list[CategoryInfo], ConnectWiseManageRequestParams], IPaginateable[CategoryInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CategoryInfo]) IPaginateable.__init__(self, CategoryInfo) - self.count = self._register_child_endpoint( - ProcurementCategoriesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementCategoriesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CategoryInfo]: """ Performs a GET request against the /procurement/categories/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CategoryInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CategoryInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CategoryInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CategoryInfo]: """ Performs a GET request against the /procurement/categories/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[CategoryInfo]: The parsed response data. """ - return self._parse_many( - CategoryInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CategoryInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsCountEndpoint.py index 28fb61844..08ecbd744 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsCountEndpoint.py @@ -17,9 +17,7 @@ class ProcurementDirectionalsyncsCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsEndpoint.py index 626b38be4..aff06ea35 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsEndpoint.py @@ -25,9 +25,7 @@ class ProcurementDirectionalsyncsEndpoint( IPaginateable[DirectionalSync, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "directionalSyncs", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "directionalSyncs", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DirectionalSync]) IPostable.__init__(self, DirectionalSync) IPaginateable.__init__(self, DirectionalSync) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsIdEndpoint.py index 89a0d1d67..988be7b30 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementDirectionalsyncsIdEndpoint.py @@ -22,9 +22,7 @@ class ProcurementDirectionalsyncsIdEndpoint( IPaginateable[DirectionalSync, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, DirectionalSync) IPuttable.__init__(self, DirectionalSync) IPatchable.__init__(self, DirectionalSync) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementEndpoint.py index 3b375146b..b73bbe06b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementEndpoint.py @@ -1,141 +1,78 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementAdjustmentsEndpoint import ( - ProcurementAdjustmentsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCatalogEndpoint import ( - ProcurementCatalogEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementCategoriesEndpoint import ( - ProcurementCategoriesEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementDirectionalsyncsEndpoint import ( - ProcurementDirectionalsyncsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementManufacturersEndpoint import ( - ProcurementManufacturersEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementOnhandserialnumbersEndpoint import ( - ProcurementOnhandserialnumbersEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementPricingschedulesEndpoint import ( - ProcurementPricingschedulesEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementProductsEndpoint import ( - ProcurementProductsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementPurchaseordersEndpoint import ( - ProcurementPurchaseordersEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementAdjustmentsEndpoint import ProcurementAdjustmentsEndpoint +from pyconnectwise.endpoints.manage.ProcurementCatalogEndpoint import ProcurementCatalogEndpoint +from pyconnectwise.endpoints.manage.ProcurementCategoriesEndpoint import ProcurementCategoriesEndpoint +from pyconnectwise.endpoints.manage.ProcurementManufacturersEndpoint import ProcurementManufacturersEndpoint +from pyconnectwise.endpoints.manage.ProcurementOnhandserialnumbersEndpoint import ProcurementOnhandserialnumbersEndpoint +from pyconnectwise.endpoints.manage.ProcurementPricingschedulesEndpoint import ProcurementPricingschedulesEndpoint +from pyconnectwise.endpoints.manage.ProcurementProductsEndpoint import ProcurementProductsEndpoint +from pyconnectwise.endpoints.manage.ProcurementPurchaseordersEndpoint import ProcurementPurchaseordersEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesEndpoint import ( ProcurementPurchaseorderstatusesEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementPurchasingdemandsEndpoint import ( - ProcurementPurchasingdemandsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmaactionsEndpoint import ( - ProcurementRmaactionsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmadispositionsEndpoint import ( - ProcurementRmadispositionsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmastatusesEndpoint import ( - ProcurementRmastatusesEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmatagsEndpoint import ( - ProcurementRmatagsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementSettingsEndpoint import ( - ProcurementSettingsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsEndpoint import ( - ProcurementShipmentmethodsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementSubcategoriesEndpoint import ( - ProcurementSubcategoriesEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementTypesEndpoint import ( - ProcurementTypesEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresEndpoint import ( - ProcurementUnitofmeasuresEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementWarehousebinsEndpoint import ( - ProcurementWarehousebinsEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementWarehousesEndpoint import ( - ProcurementWarehousesEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementPurchasingdemandsEndpoint import ProcurementPurchasingdemandsEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmaactionsEndpoint import ProcurementRmaactionsEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmadispositionsEndpoint import ProcurementRmadispositionsEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmastatusesEndpoint import ProcurementRmastatusesEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmatagsEndpoint import ProcurementRmatagsEndpoint +from pyconnectwise.endpoints.manage.ProcurementSettingsEndpoint import ProcurementSettingsEndpoint +from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsEndpoint import ProcurementShipmentmethodsEndpoint +from pyconnectwise.endpoints.manage.ProcurementSubcategoriesEndpoint import ProcurementSubcategoriesEndpoint +from pyconnectwise.endpoints.manage.ProcurementTypesEndpoint import ProcurementTypesEndpoint +from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresEndpoint import ProcurementUnitofmeasuresEndpoint +from pyconnectwise.endpoints.manage.ProcurementWarehousebinsEndpoint import ProcurementWarehousebinsEndpoint +from pyconnectwise.endpoints.manage.ProcurementWarehousesEndpoint import ProcurementWarehousesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "procurement", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "procurement", parent_endpoint=parent_endpoint) - self.unit_of_measures = self._register_child_endpoint( - ProcurementUnitofmeasuresEndpoint(client, parent_endpoint=self) - ) - self.purchasing_demands = self._register_child_endpoint( - ProcurementPurchasingdemandsEndpoint(client, parent_endpoint=self) - ) - self.settings = self._register_child_endpoint( - ProcurementSettingsEndpoint(client, parent_endpoint=self) - ) - self.directional_syncs = self._register_child_endpoint( - ProcurementDirectionalsyncsEndpoint(client, parent_endpoint=self) - ) - self.pricingschedules = self._register_child_endpoint( - ProcurementPricingschedulesEndpoint(client, parent_endpoint=self) - ) - self.r_m_a_dispositions = self._register_child_endpoint( - ProcurementRmadispositionsEndpoint(client, parent_endpoint=self) - ) - self.catalog = self._register_child_endpoint( - ProcurementCatalogEndpoint(client, parent_endpoint=self) - ) - self.warehouses = self._register_child_endpoint( - ProcurementWarehousesEndpoint(client, parent_endpoint=self) - ) - self.categories = self._register_child_endpoint( - ProcurementCategoriesEndpoint(client, parent_endpoint=self) - ) - self.adjustments = self._register_child_endpoint( - ProcurementAdjustmentsEndpoint(client, parent_endpoint=self) - ) + self.adjustments = self._register_child_endpoint(ProcurementAdjustmentsEndpoint(client, parent_endpoint=self)) + self.catalog = self._register_child_endpoint(ProcurementCatalogEndpoint(client, parent_endpoint=self)) + self.categories = self._register_child_endpoint(ProcurementCategoriesEndpoint(client, parent_endpoint=self)) self.manufacturers = self._register_child_endpoint( ProcurementManufacturersEndpoint(client, parent_endpoint=self) ) - self.rma_actions = self._register_child_endpoint( - ProcurementRmaactionsEndpoint(client, parent_endpoint=self) - ) - self.subcategories = self._register_child_endpoint( - ProcurementSubcategoriesEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - ProcurementTypesEndpoint(client, parent_endpoint=self) - ) self.onhandserialnumbers = self._register_child_endpoint( ProcurementOnhandserialnumbersEndpoint(client, parent_endpoint=self) ) + self.pricingschedules = self._register_child_endpoint( + ProcurementPricingschedulesEndpoint(client, parent_endpoint=self) + ) + self.products = self._register_child_endpoint(ProcurementProductsEndpoint(client, parent_endpoint=self)) self.purchaseorders = self._register_child_endpoint( ProcurementPurchaseordersEndpoint(client, parent_endpoint=self) ) - self.products = self._register_child_endpoint( - ProcurementProductsEndpoint(client, parent_endpoint=self) - ) self.purchaseorderstatuses = self._register_child_endpoint( ProcurementPurchaseorderstatusesEndpoint(client, parent_endpoint=self) ) + self.purchasing_demands = self._register_child_endpoint( + ProcurementPurchasingdemandsEndpoint(client, parent_endpoint=self) + ) + self.r_m_a_dispositions = self._register_child_endpoint( + ProcurementRmadispositionsEndpoint(client, parent_endpoint=self) + ) + self.rma_actions = self._register_child_endpoint(ProcurementRmaactionsEndpoint(client, parent_endpoint=self)) + self.rma_statuses = self._register_child_endpoint(ProcurementRmastatusesEndpoint(client, parent_endpoint=self)) + self.rma_tags = self._register_child_endpoint(ProcurementRmatagsEndpoint(client, parent_endpoint=self)) + self.settings = self._register_child_endpoint(ProcurementSettingsEndpoint(client, parent_endpoint=self)) self.shipmentmethods = self._register_child_endpoint( ProcurementShipmentmethodsEndpoint(client, parent_endpoint=self) ) - self.rma_tags = self._register_child_endpoint( - ProcurementRmatagsEndpoint(client, parent_endpoint=self) + self.subcategories = self._register_child_endpoint( + ProcurementSubcategoriesEndpoint(client, parent_endpoint=self) + ) + self.types = self._register_child_endpoint(ProcurementTypesEndpoint(client, parent_endpoint=self)) + self.unit_of_measures = self._register_child_endpoint( + ProcurementUnitofmeasuresEndpoint(client, parent_endpoint=self) ) self.warehouse_bins = self._register_child_endpoint( ProcurementWarehousebinsEndpoint(client, parent_endpoint=self) ) - self.rma_statuses = self._register_child_endpoint( - ProcurementRmastatusesEndpoint(client, parent_endpoint=self) - ) + self.warehouses = self._register_child_endpoint(ProcurementWarehousesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountEndpoint.py index 42180ae84..beebb5a3e 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementManufacturersCountInfoEndpoint import ( ProcurementManufacturersCountInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementManufacturersCountEndpoint( @@ -19,10 +18,8 @@ class ProcurementManufacturersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/manufacturers/count endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/manufacturers/count endpoint. @@ -74,6 +57,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountInfoEndpoint.py index 318b0f583..17c898954 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersCountInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementManufacturersCountInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementManufacturersCountInfoEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/manufacturers/count/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/manufacturers/count/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersEndpoint.py index 6ecd82f77..c3449a9ea 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementManufacturersCountEndpoint import ( - ProcurementManufacturersCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementManufacturersIdEndpoint import ( - ProcurementManufacturersIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementManufacturersInfoEndpoint import ( - ProcurementManufacturersInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementManufacturersCountEndpoint import ProcurementManufacturersCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementManufacturersIdEndpoint import ProcurementManufacturersIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementManufacturersInfoEndpoint import ProcurementManufacturersInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Manufacturer from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementManufacturersEndpoint( @@ -27,39 +19,30 @@ class ProcurementManufacturersEndpoint( IPostable[Manufacturer, ConnectWiseManageRequestParams], IPaginateable[Manufacturer, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "manufacturers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "manufacturers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Manufacturer]) IPostable.__init__(self, Manufacturer) IPaginateable.__init__(self, Manufacturer) - self.count = self._register_child_endpoint( - ProcurementManufacturersCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementManufacturersInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementManufacturersCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementManufacturersInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementManufacturersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementManufacturersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementManufacturersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementManufacturersIdEndpoint: The initialized ProcurementManufacturersIdEndpoint object. """ child = ProcurementManufacturersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Manufacturer]: """ Performs a GET request against the /procurement/manufacturers endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Manufacturer, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Manufacturer, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Manufacturer]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Manufacturer]: """ Performs a GET request against the /procurement/manufacturers endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[Manufacturer]: The parsed response data. """ - return self._parse_many( - Manufacturer, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Manufacturer, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Manufacturer: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Manufacturer: """ Performs a POST request against the /procurement/manufacturers endpoint. @@ -117,6 +85,4 @@ def post( Returns: Manufacturer: The parsed response data. """ - return self._parse_one( - Manufacturer, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Manufacturer, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdEndpoint.py index 9fd960d85..68422ec66 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementManufacturersIdInfoEndpoint import ( - ProcurementManufacturersIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProcurementManufacturersIdInfoEndpoint import ProcurementManufacturersIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Manufacturer from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementManufacturersIdEndpoint( ConnectWiseEndpoint, IGettable[Manufacturer, ConnectWiseManageRequestParams], - IPuttable[Manufacturer, ConnectWiseManageRequestParams], IPatchable[Manufacturer, ConnectWiseManageRequestParams], + IPuttable[Manufacturer, ConnectWiseManageRequestParams], IPaginateable[Manufacturer, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Manufacturer) - IPuttable.__init__(self, Manufacturer) IPatchable.__init__(self, Manufacturer) + IPuttable.__init__(self, Manufacturer) IPaginateable.__init__(self, Manufacturer) - self.info = self._register_child_endpoint( - ProcurementManufacturersIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProcurementManufacturersIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Manufacturer]: """ Performs a GET request against the /procurement/manufacturers/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Manufacturer, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Manufacturer, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Manufacturer: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/manufacturers/{id} endpoint. + Performs a DELETE request against the /procurement/manufacturers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Manufacturer: The parsed response data. """ - return self._parse_one( - Manufacturer, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Manufacturer: """ - Performs a DELETE request against the /procurement/manufacturers/{id} endpoint. + Performs a GET request against the /procurement/manufacturers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Manufacturer: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Manufacturer, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Manufacturer: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Manufacturer: """ - Performs a PUT request against the /procurement/manufacturers/{id} endpoint. + Performs a PATCH request against the /procurement/manufacturers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: Manufacturer: The parsed response data. """ - return self._parse_one( - Manufacturer, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Manufacturer, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Manufacturer: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Manufacturer: """ - Performs a PATCH request against the /procurement/manufacturers/{id} endpoint. + Performs a PUT request against the /procurement/manufacturers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +93,4 @@ def patch( Returns: Manufacturer: The parsed response data. """ - return self._parse_one( - Manufacturer, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(Manufacturer, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdInfoEndpoint.py index 36438eddd..042346909 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ManufacturerInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementManufacturersIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementManufacturersIdInfoEndpoint( IGettable[ManufacturerInfo, ConnectWiseManageRequestParams], IPaginateable[ManufacturerInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManufacturerInfo) IPaginateable.__init__(self, ManufacturerInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManufacturerInfo]: """ Performs a GET request against the /procurement/manufacturers/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManufacturerInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManufacturerInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManufacturerInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ManufacturerInfo: """ Performs a GET request against the /procurement/manufacturers/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ManufacturerInfo: The parsed response data. """ - return self._parse_one( - ManufacturerInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ManufacturerInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersInfoEndpoint.py index aed790ba7..ee7ec2517 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementManufacturersInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementManufacturersInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ManufacturerInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementManufacturersInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementManufacturersInfoEndpoint( IGettable[list[ManufacturerInfo], ConnectWiseManageRequestParams], IPaginateable[ManufacturerInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManufacturerInfo]) IPaginateable.__init__(self, ManufacturerInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManufacturerInfo]: """ Performs a GET request against the /procurement/manufacturers/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManufacturerInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManufacturerInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManufacturerInfo]: """ Performs a GET request against the /procurement/manufacturers/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[ManufacturerInfo]: The parsed response data. """ - return self._parse_many( - ManufacturerInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ManufacturerInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersCountEndpoint.py index c75ac32d0..4aaa6e5a2 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementOnhandserialnumbersCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementOnhandserialnumbersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/onhandserialnumbers/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/onhandserialnumbers/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersEndpoint.py index 026bdf247..9216933ca 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementOnhandserialnumbersCountEndpoint import ( ProcurementOnhandserialnumbersCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementOnhandserialnumbersIdEndpoint import ( ProcurementOnhandserialnumbersIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OnHandSerialNumber from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementOnhandserialnumbersEndpoint( @@ -22,10 +21,8 @@ class ProcurementOnhandserialnumbersEndpoint( IGettable[list[OnHandSerialNumber], ConnectWiseManageRequestParams], IPaginateable[OnHandSerialNumber, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "onhandserialnumbers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "onhandserialnumbers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OnHandSerialNumber]) IPaginateable.__init__(self, OnHandSerialNumber) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProcurementOnhandserialnumbersCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProcurementOnhandserialnumbersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementOnhandserialnumbersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementOnhandserialnumbersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementOnhandserialnumbersIdEndpoint: The initialized ProcurementOnhandserialnumbersIdEndpoint object. """ - child = ProcurementOnhandserialnumbersIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementOnhandserialnumbersIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OnHandSerialNumber]: """ Performs a GET request against the /procurement/onhandserialnumbers endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OnHandSerialNumber, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OnHandSerialNumber, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OnHandSerialNumber]: """ Performs a GET request against the /procurement/onhandserialnumbers endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[OnHandSerialNumber]: The parsed response data. """ - return self._parse_many( - OnHandSerialNumber, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OnHandSerialNumber, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersIdEndpoint.py index 003f28942..5cb2a8bf4 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementOnhandserialnumbersIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OnHandSerialNumber from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementOnhandserialnumbersIdEndpoint( @@ -16,18 +15,13 @@ class ProcurementOnhandserialnumbersIdEndpoint( IGettable[OnHandSerialNumber, ConnectWiseManageRequestParams], IPaginateable[OnHandSerialNumber, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OnHandSerialNumber) IPaginateable.__init__(self, OnHandSerialNumber) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OnHandSerialNumber]: """ Performs a GET request against the /procurement/onhandserialnumbers/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OnHandSerialNumber, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OnHandSerialNumber, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OnHandSerialNumber: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OnHandSerialNumber: """ Performs a GET request against the /procurement/onhandserialnumbers/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: OnHandSerialNumber: The parsed response data. """ - return self._parse_one( - OnHandSerialNumber, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(OnHandSerialNumber, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesCountEndpoint.py index c5164216f..fd90f0b06 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPricingschedulesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/pricingschedules/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/pricingschedules/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesEndpoint.py index be056c353..02032ac7f 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPricingschedulesCountEndpoint import ( ProcurementPricingschedulesCountEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdEndpoint import ( - ProcurementPricingschedulesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdEndpoint import ProcurementPricingschedulesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PricingSchedule from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesEndpoint( @@ -24,10 +20,8 @@ class ProcurementPricingschedulesEndpoint( IPostable[PricingSchedule, ConnectWiseManageRequestParams], IPaginateable[PricingSchedule, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "pricingschedules", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "pricingschedules", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PricingSchedule]) IPostable.__init__(self, PricingSchedule) IPaginateable.__init__(self, PricingSchedule) @@ -36,24 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProcurementPricingschedulesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProcurementPricingschedulesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementPricingschedulesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPricingschedulesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPricingschedulesIdEndpoint: The initialized ProcurementPricingschedulesIdEndpoint object. """ child = ProcurementPricingschedulesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PricingSchedule]: """ Performs a GET request against the /procurement/pricingschedules endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PricingSchedule, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PricingSchedule, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PricingSchedule]: """ Performs a GET request against the /procurement/pricingschedules endpoint. @@ -93,16 +77,9 @@ def get( Returns: list[PricingSchedule]: The parsed response data. """ - return self._parse_many( - PricingSchedule, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PricingSchedule, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingSchedule: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingSchedule: """ Performs a POST request against the /procurement/pricingschedules endpoint. @@ -112,7 +89,4 @@ def post( Returns: PricingSchedule: The parsed response data. """ - return self._parse_one( - PricingSchedule, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(PricingSchedule, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsCountEndpoint.py index 5d6702855..ccd9e5233 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesIdDetailsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPricingschedulesIdDetailsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsEndpoint.py index 733790919..01e14fe37 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdDetailsCountEndpoint import ( ProcurementPricingschedulesIdDetailsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdDetailsIdEndpoint import ( ProcurementPricingschedulesIdDetailsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PricingDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesIdDetailsEndpoint( @@ -24,42 +22,31 @@ class ProcurementPricingschedulesIdDetailsEndpoint( IPostable[PricingDetail, ConnectWiseManageRequestParams], IPaginateable[PricingDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "details", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "details", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PricingDetail]) IPostable.__init__(self, PricingDetail) IPaginateable.__init__(self, PricingDetail) self.count = self._register_child_endpoint( - ProcurementPricingschedulesIdDetailsCountEndpoint( - client, parent_endpoint=self - ) + ProcurementPricingschedulesIdDetailsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementPricingschedulesIdDetailsIdEndpoint: + def id(self, _id: int) -> ProcurementPricingschedulesIdDetailsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPricingschedulesIdDetailsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPricingschedulesIdDetailsIdEndpoint: The initialized ProcurementPricingschedulesIdDetailsIdEndpoint object. """ - child = ProcurementPricingschedulesIdDetailsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementPricingschedulesIdDetailsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PricingDetail]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PricingDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PricingDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PricingDetail]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details endpoint. @@ -99,15 +79,9 @@ def get( Returns: list[PricingDetail]: The parsed response data. """ - return self._parse_many( - PricingDetail, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PricingDetail, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingDetail: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingDetail: """ Performs a POST request against the /procurement/pricingschedules/{id}/details endpoint. @@ -117,7 +91,4 @@ def post( Returns: PricingDetail: The parsed response data. """ - return self._parse_one( - PricingDetail, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(PricingDetail, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint.py index 7a8ec4318..a71c301f8 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/{id}/breaks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/{id}/breaks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksEndpoint.py index 68da28914..0ba363eb8 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint import ( ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint import ( ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PricingBreak from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesIdDetailsIdBreaksEndpoint( @@ -24,42 +22,31 @@ class ProcurementPricingschedulesIdDetailsIdBreaksEndpoint( IPostable[PricingBreak, ConnectWiseManageRequestParams], IPaginateable[PricingBreak, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "breaks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "breaks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PricingBreak]) IPostable.__init__(self, PricingBreak) IPaginateable.__init__(self, PricingBreak) self.count = self._register_child_endpoint( - ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint( - client, parent_endpoint=self - ) + ProcurementPricingschedulesIdDetailsIdBreaksCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint: + def id(self, _id: int) -> ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint: The initialized ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint object. """ - child = ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PricingBreak]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/{id}/breaks endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +64,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PricingBreak, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PricingBreak, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[PricingBreak]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[PricingBreak]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/{id}/breaks endpoint. @@ -99,15 +77,9 @@ def get( Returns: list[PricingBreak]: The parsed response data. """ - return self._parse_many( - PricingBreak, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PricingBreak, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingBreak: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingBreak: """ Performs a POST request against the /procurement/pricingschedules/{id}/details/{id}/breaks endpoint. @@ -117,6 +89,4 @@ def post( Returns: PricingBreak: The parsed response data. """ - return self._parse_one( - PricingBreak, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(PricingBreak, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint.py index ed339d83f..4b4a9dddf 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PricingBreak from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesIdDetailsIdBreaksIdEndpoint( ConnectWiseEndpoint, IGettable[PricingBreak, ConnectWiseManageRequestParams], - IPuttable[PricingBreak, ConnectWiseManageRequestParams], IPatchable[PricingBreak, ConnectWiseManageRequestParams], + IPuttable[PricingBreak, ConnectWiseManageRequestParams], IPaginateable[PricingBreak, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PricingBreak) - IPuttable.__init__(self, PricingBreak) IPatchable.__init__(self, PricingBreak) + IPuttable.__init__(self, PricingBreak) IPaginateable.__init__(self, PricingBreak) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PricingBreak]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PricingBreak, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PricingBreak, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingBreak: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. + Performs a DELETE request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PricingBreak: The parsed response data. """ - return self._parse_one( - PricingBreak, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingBreak: """ - Performs a DELETE request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. + Performs a GET request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PricingBreak: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PricingBreak, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingBreak: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PricingBreak: """ - Performs a PUT request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. + Performs a PATCH request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: PricingBreak: The parsed response data. """ - return self._parse_one( - PricingBreak, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(PricingBreak, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingBreak: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingBreak: """ - Performs a PATCH request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. + Performs a PUT request against the /procurement/pricingschedules/{id}/details/{id}/breaks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: PricingBreak: The parsed response data. """ - return self._parse_one( - PricingBreak, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PricingBreak, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdEndpoint.py index d74eea134..1a86a5f0c 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdDetailsIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdDetailsIdBreaksEndpoint import ( ProcurementPricingschedulesIdDetailsIdBreaksEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PricingDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesIdDetailsIdEndpoint( ConnectWiseEndpoint, IGettable[PricingDetail, ConnectWiseManageRequestParams], - IPuttable[PricingDetail, ConnectWiseManageRequestParams], IPatchable[PricingDetail, ConnectWiseManageRequestParams], + IPuttable[PricingDetail, ConnectWiseManageRequestParams], IPaginateable[PricingDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PricingDetail) - IPuttable.__init__(self, PricingDetail) IPatchable.__init__(self, PricingDetail) + IPuttable.__init__(self, PricingDetail) IPaginateable.__init__(self, PricingDetail) self.breaks = self._register_child_endpoint( - ProcurementPricingschedulesIdDetailsIdBreaksEndpoint( - client, parent_endpoint=self - ) + ProcurementPricingschedulesIdDetailsIdBreaksEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PricingDetail]: """ Performs a GET request against the /procurement/pricingschedules/{id}/details/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PricingDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PricingDetail, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingDetail: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/pricingschedules/{id}/details/{id} endpoint. + Performs a DELETE request against the /procurement/pricingschedules/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PricingDetail: The parsed response data. """ - return self._parse_one( - PricingDetail, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingDetail: """ - Performs a DELETE request against the /procurement/pricingschedules/{id}/details/{id} endpoint. + Performs a GET request against the /procurement/pricingschedules/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PricingDetail: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PricingDetail, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingDetail: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PricingDetail: """ - Performs a PUT request against the /procurement/pricingschedules/{id}/details/{id} endpoint. + Performs a PATCH request against the /procurement/pricingschedules/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -115,17 +85,11 @@ def put( Returns: PricingDetail: The parsed response data. """ - return self._parse_one( - PricingDetail, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(PricingDetail, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingDetail: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingDetail: """ - Performs a PATCH request against the /procurement/pricingschedules/{id}/details/{id} endpoint. + Performs a PUT request against the /procurement/pricingschedules/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +97,4 @@ def patch( Returns: PricingDetail: The parsed response data. """ - return self._parse_one( - PricingDetail, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PricingDetail, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdEndpoint.py index df3733f7d..60505efdd 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPricingschedulesIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPricingschedulesIdDetailsEndpoint import ( ProcurementPricingschedulesIdDetailsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PricingSchedule from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPricingschedulesIdEndpoint( ConnectWiseEndpoint, IGettable[PricingSchedule, ConnectWiseManageRequestParams], - IPuttable[PricingSchedule, ConnectWiseManageRequestParams], IPatchable[PricingSchedule, ConnectWiseManageRequestParams], + IPuttable[PricingSchedule, ConnectWiseManageRequestParams], IPaginateable[PricingSchedule, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PricingSchedule) - IPuttable.__init__(self, PricingSchedule) IPatchable.__init__(self, PricingSchedule) + IPuttable.__init__(self, PricingSchedule) IPaginateable.__init__(self, PricingSchedule) self.details = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PricingSchedule]: """ Performs a GET request against the /procurement/pricingschedules/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PricingSchedule, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PricingSchedule, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingSchedule: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/pricingschedules/{id} endpoint. + Performs a DELETE request against the /procurement/pricingschedules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PricingSchedule: The parsed response data. """ - return self._parse_one( - PricingSchedule, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingSchedule: """ - Performs a DELETE request against the /procurement/pricingschedules/{id} endpoint. + Performs a GET request against the /procurement/pricingschedules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PricingSchedule: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PricingSchedule, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingSchedule: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PricingSchedule: """ - Performs a PUT request against the /procurement/pricingschedules/{id} endpoint. + Performs a PATCH request against the /procurement/pricingschedules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +85,11 @@ def put( Returns: PricingSchedule: The parsed response data. """ - return self._parse_one( - PricingSchedule, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(PricingSchedule, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PricingSchedule: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PricingSchedule: """ - Performs a PATCH request against the /procurement/pricingschedules/{id} endpoint. + Performs a PUT request against the /procurement/pricingschedules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +97,4 @@ def patch( Returns: PricingSchedule: The parsed response data. """ - return self._parse_one( - PricingSchedule, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PricingSchedule, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsCountEndpoint.py index 695b8363d..8827a8c48 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementProductsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/products/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/products/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsEndpoint.py index b247f9875..aa8a7c37d 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementProductsCountEndpoint import ( - ProcurementProductsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementProductsIdEndpoint import ( - ProcurementProductsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementProductsCountEndpoint import ProcurementProductsCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementProductsIdEndpoint import ProcurementProductsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProductItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsEndpoint( @@ -24,36 +18,29 @@ class ProcurementProductsEndpoint( IPostable[ProductItem, ConnectWiseManageRequestParams], IPaginateable[ProductItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "products", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "products", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductItem]) IPostable.__init__(self, ProductItem) IPaginateable.__init__(self, ProductItem) - self.count = self._register_child_endpoint( - ProcurementProductsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementProductsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementProductsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementProductsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementProductsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementProductsIdEndpoint: The initialized ProcurementProductsIdEndpoint object. """ child = ProcurementProductsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductItem]: """ Performs a GET request against the /procurement/products endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductItem, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ProductItem]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ProductItem]: """ Performs a GET request against the /procurement/products endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ProductItem]: The parsed response data. """ - return self._parse_many( - ProductItem, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ProductItem, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductItem: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductItem: """ Performs a POST request against the /procurement/products endpoint. @@ -111,6 +83,4 @@ def post( Returns: ProductItem: The parsed response data. """ - return self._parse_one( - ProductItem, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ProductItem, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsCountEndpoint.py index 69a403e31..1ac8068c6 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdComponentsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementProductsIdComponentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/products/{id}/components/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/products/{id}/components/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsEndpoint.py index 4848afe90..70e9531f4 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementProductsIdComponentsCountEndpoint import ( ProcurementProductsIdComponentsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementProductsIdComponentsIdEndpoint import ( ProcurementProductsIdComponentsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProductComponent from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdComponentsEndpoint( @@ -24,10 +22,8 @@ class ProcurementProductsIdComponentsEndpoint( IPostable[list[ProductComponent], ConnectWiseManageRequestParams], IPaginateable[ProductComponent, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "components", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "components", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductComponent]) IPostable.__init__(self, list[ProductComponent]) IPaginateable.__init__(self, ProductComponent) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProcurementProductsIdComponentsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProcurementProductsIdComponentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementProductsIdComponentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementProductsIdComponentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementProductsIdComponentsIdEndpoint: The initialized ProcurementProductsIdComponentsIdEndpoint object. """ - child = ProcurementProductsIdComponentsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementProductsIdComponentsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductComponent]: """ Performs a GET request against the /procurement/products/{id}/components endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductComponent, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductComponent, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductComponent]: """ Performs a GET request against the /procurement/products/{id}/components endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[ProductComponent]: The parsed response data. """ - return self._parse_many( - ProductComponent, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProductComponent, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductComponent]: """ Performs a POST request against the /procurement/products/{id}/components endpoint. @@ -114,7 +93,4 @@ def post( Returns: list[ProductComponent]: The parsed response data. """ - return self._parse_many( - ProductComponent, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_many(ProductComponent, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsIdEndpoint.py index e7c1b0183..f0729ee14 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdComponentsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProductComponent from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdComponentsIdEndpoint( ConnectWiseEndpoint, IGettable[list[ProductComponent], ConnectWiseManageRequestParams], - IPuttable[list[ProductComponent], ConnectWiseManageRequestParams], IPatchable[list[ProductComponent], ConnectWiseManageRequestParams], + IPuttable[list[ProductComponent], ConnectWiseManageRequestParams], IPaginateable[ProductComponent, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductComponent]) - IPuttable.__init__(self, list[ProductComponent]) IPatchable.__init__(self, list[ProductComponent]) + IPuttable.__init__(self, list[ProductComponent]) IPaginateable.__init__(self, ProductComponent) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductComponent]: """ Performs a GET request against the /procurement/products/{id}/components/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductComponent, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductComponent, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ProductComponent]: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/products/{id}/components/{id} endpoint. + Performs a DELETE request against the /procurement/products/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - list[ProductComponent]: The parsed response data. """ - return self._parse_many( - ProductComponent, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> list[ProductComponent]: """ - Performs a DELETE request against the /procurement/products/{id}/components/{id} endpoint. + Performs a GET request against the /procurement/products/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + list[ProductComponent]: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_many(ProductComponent, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductComponent]: """ - Performs a PUT request against the /procurement/products/{id}/components/{id} endpoint. + Performs a PATCH request against the /procurement/products/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: list[ProductComponent]: The parsed response data. """ - return self._parse_many( - ProductComponent, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_many(ProductComponent, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductComponent]: """ - Performs a PATCH request against the /procurement/products/{id}/components/{id} endpoint. + Performs a PUT request against the /procurement/products/{id}/components/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: list[ProductComponent]: The parsed response data. """ - return self._parse_many( - ProductComponent, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_many(ProductComponent, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdDetachEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdDetachEndpoint.py index 1eb42ada0..9ad1223ac 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdDetachEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdDetachEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ProductDetach -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdDetachEndpoint( ConnectWiseEndpoint, IPostable[ProductDetach, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "detach", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "detach", parent_endpoint=parent_endpoint) IPostable.__init__(self, ProductDetach) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductDetach: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductDetach: """ Performs a POST request against the /procurement/products/{id}/detach endpoint. @@ -32,7 +26,4 @@ def post( Returns: ProductDetach: The parsed response data. """ - return self._parse_one( - ProductDetach, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProductDetach, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdEndpoint.py index 70b13e2d9..1ed2030ab 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdEndpoint.py @@ -1,61 +1,46 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementProductsIdComponentsEndpoint import ( ProcurementProductsIdComponentsEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementProductsIdDetachEndpoint import ( - ProcurementProductsIdDetachEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementProductsIdDetachEndpoint import ProcurementProductsIdDetachEndpoint from pyconnectwise.endpoints.manage.ProcurementProductsIdPickingshippingdetailsEndpoint import ( ProcurementProductsIdPickingshippingdetailsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProductItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdEndpoint( ConnectWiseEndpoint, IGettable[ProductItem, ConnectWiseManageRequestParams], - IPuttable[ProductItem, ConnectWiseManageRequestParams], IPatchable[ProductItem, ConnectWiseManageRequestParams], + IPuttable[ProductItem, ConnectWiseManageRequestParams], IPaginateable[ProductItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProductItem) - IPuttable.__init__(self, ProductItem) IPatchable.__init__(self, ProductItem) + IPuttable.__init__(self, ProductItem) IPaginateable.__init__(self, ProductItem) - self.detach = self._register_child_endpoint( - ProcurementProductsIdDetachEndpoint(client, parent_endpoint=self) - ) self.components = self._register_child_endpoint( ProcurementProductsIdComponentsEndpoint(client, parent_endpoint=self) ) + self.detach = self._register_child_endpoint(ProcurementProductsIdDetachEndpoint(client, parent_endpoint=self)) self.picking_shipping_details = self._register_child_endpoint( - ProcurementProductsIdPickingshippingdetailsEndpoint( - client, parent_endpoint=self - ) + ProcurementProductsIdPickingshippingdetailsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductItem]: """ Performs a GET request against the /procurement/products/{id} endpoint and returns an initialized PaginatedResponse object. @@ -73,53 +58,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductItem, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductItem: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/products/{id} endpoint. + Performs a DELETE request against the /procurement/products/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProductItem: The parsed response data. """ - return self._parse_one( - ProductItem, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductItem: """ - Performs a DELETE request against the /procurement/products/{id} endpoint. + Performs a GET request against the /procurement/products/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProductItem: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProductItem, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductItem: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProductItem: """ - Performs a PUT request against the /procurement/products/{id} endpoint. + Performs a PATCH request against the /procurement/products/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,17 +93,11 @@ def put( Returns: ProductItem: The parsed response data. """ - return self._parse_one( - ProductItem, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ProductItem, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductItem: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductItem: """ - Performs a PATCH request against the /procurement/products/{id} endpoint. + Performs a PUT request against the /procurement/products/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -145,6 +105,4 @@ def patch( Returns: ProductItem: The parsed response data. """ - return self._parse_one( - ProductItem, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ProductItem, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsCountEndpoint.py index e2cd75108..9c345f184 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdPickingshippingdetailsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementProductsIdPickingshippingdetailsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/products/{id}/pickingShippingDetails/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/products/{id}/pickingShippingDetails/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsEndpoint.py index c1b3dc144..8c60c879e 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementProductsIdPickingshippingdetailsCountEndpoint import ( ProcurementProductsIdPickingshippingdetailsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementProductsIdPickingshippingdetailsIdEndpoint import ( ProcurementProductsIdPickingshippingdetailsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProductPickingShippingDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdPickingshippingdetailsEndpoint( @@ -24,42 +22,31 @@ class ProcurementProductsIdPickingshippingdetailsEndpoint( IPostable[list[ProductPickingShippingDetail], ConnectWiseManageRequestParams], IPaginateable[ProductPickingShippingDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "pickingShippingDetails", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "pickingShippingDetails", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductPickingShippingDetail]) IPostable.__init__(self, list[ProductPickingShippingDetail]) IPaginateable.__init__(self, ProductPickingShippingDetail) self.count = self._register_child_endpoint( - ProcurementProductsIdPickingshippingdetailsCountEndpoint( - client, parent_endpoint=self - ) + ProcurementProductsIdPickingshippingdetailsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementProductsIdPickingshippingdetailsIdEndpoint: + def id(self, _id: int) -> ProcurementProductsIdPickingshippingdetailsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementProductsIdPickingshippingdetailsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementProductsIdPickingshippingdetailsIdEndpoint: The initialized ProcurementProductsIdPickingshippingdetailsIdEndpoint object. """ - child = ProcurementProductsIdPickingshippingdetailsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementProductsIdPickingshippingdetailsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductPickingShippingDetail]: """ Performs a GET request against the /procurement/products/{id}/pickingShippingDetails endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductPickingShippingDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductPickingShippingDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductPickingShippingDetail]: """ Performs a GET request against the /procurement/products/{id}/pickingShippingDetails endpoint. @@ -100,14 +80,11 @@ def get( list[ProductPickingShippingDetail]: The parsed response data. """ return self._parse_many( - ProductPickingShippingDetail, - super()._make_request("GET", data=data, params=params).json(), + ProductPickingShippingDetail, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductPickingShippingDetail]: """ Performs a POST request against the /procurement/products/{id}/pickingShippingDetails endpoint. @@ -119,6 +96,5 @@ def post( list[ProductPickingShippingDetail]: The parsed response data. """ return self._parse_many( - ProductPickingShippingDetail, - super()._make_request("POST", data=data, params=params).json(), + ProductPickingShippingDetail, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsIdEndpoint.py index fd35a5f90..f02b80594 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementProductsIdPickingshippingdetailsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProductPickingShippingDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementProductsIdPickingshippingdetailsIdEndpoint( ConnectWiseEndpoint, IGettable[list[ProductPickingShippingDetail], ConnectWiseManageRequestParams], - IPuttable[list[ProductPickingShippingDetail], ConnectWiseManageRequestParams], IPatchable[list[ProductPickingShippingDetail], ConnectWiseManageRequestParams], + IPuttable[list[ProductPickingShippingDetail], ConnectWiseManageRequestParams], IPaginateable[ProductPickingShippingDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductPickingShippingDetail]) - IPuttable.__init__(self, list[ProductPickingShippingDetail]) IPatchable.__init__(self, list[ProductPickingShippingDetail]) + IPuttable.__init__(self, list[ProductPickingShippingDetail]) IPaginateable.__init__(self, ProductPickingShippingDetail) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductPickingShippingDetail]: """ Performs a GET request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductPickingShippingDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductPickingShippingDetail, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ProductPickingShippingDetail]: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. + Performs a DELETE request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - list[ProductPickingShippingDetail]: The parsed response data. """ - return self._parse_many( - ProductPickingShippingDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> list[ProductPickingShippingDetail]: """ - Performs a DELETE request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. + Performs a GET request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + list[ProductPickingShippingDetail]: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_many( + ProductPickingShippingDetail, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductPickingShippingDetail]: """ - Performs a PUT request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. + Performs a PATCH request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( list[ProductPickingShippingDetail]: The parsed response data. """ return self._parse_many( - ProductPickingShippingDetail, - super()._make_request("PUT", data=data, params=params).json(), + ProductPickingShippingDetail, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductPickingShippingDetail]: """ - Performs a PATCH request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. + Performs a PUT request against the /procurement/products/{id}/pickingShippingDetails/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( list[ProductPickingShippingDetail]: The parsed response data. """ return self._parse_many( - ProductPickingShippingDetail, - super()._make_request("PATCH", data=data, params=params).json(), + ProductPickingShippingDetail, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersCountEndpoint.py index c32ec8fe4..c2558b341 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseordersCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPurchaseordersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/purchaseorders/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/purchaseorders/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersEndpoint.py index 10efea50c..4f1de651c 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementPurchaseordersCountEndpoint import ( - ProcurementPurchaseordersCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementPurchaseordersIdEndpoint import ( - ProcurementPurchaseordersIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementPurchaseordersCountEndpoint import ProcurementPurchaseordersCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementPurchaseordersIdEndpoint import ProcurementPurchaseordersIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PurchaseOrder from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseordersEndpoint( @@ -24,36 +18,29 @@ class ProcurementPurchaseordersEndpoint( IPostable[PurchaseOrder, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrder, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "purchaseorders", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "purchaseorders", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PurchaseOrder]) IPostable.__init__(self, PurchaseOrder) IPaginateable.__init__(self, PurchaseOrder) - self.count = self._register_child_endpoint( - ProcurementPurchaseordersCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementPurchaseordersCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementPurchaseordersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementPurchaseordersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPurchaseordersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPurchaseordersIdEndpoint: The initialized ProcurementPurchaseordersIdEndpoint object. """ child = ProcurementPurchaseordersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrder]: """ Performs a GET request against the /procurement/purchaseorders endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrder, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrder, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PurchaseOrder]: """ Performs a GET request against the /procurement/purchaseorders endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[PurchaseOrder]: The parsed response data. """ - return self._parse_many( - PurchaseOrder, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PurchaseOrder, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchaseOrder: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PurchaseOrder: """ Performs a POST request against the /procurement/purchaseorders endpoint. @@ -111,7 +85,4 @@ def post( Returns: PurchaseOrder: The parsed response data. """ - return self._parse_one( - PurchaseOrder, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrder, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdEndpoint.py index f4cf0417d..31d3686dc 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdEndpoint.py @@ -1,59 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseordersIdLineitemsEndpoint import ( ProcurementPurchaseordersIdLineitemsEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementPurchaseordersIdRebatchEndpoint import ( - ProcurementPurchaseordersIdRebatchEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementPurchaseordersIdUnbatchEndpoint import ( - ProcurementPurchaseordersIdUnbatchEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PurchaseOrder from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseordersIdEndpoint( ConnectWiseEndpoint, IGettable[PurchaseOrder, ConnectWiseManageRequestParams], - IPuttable[PurchaseOrder, ConnectWiseManageRequestParams], IPatchable[PurchaseOrder, ConnectWiseManageRequestParams], + IPuttable[PurchaseOrder, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrder, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PurchaseOrder) - IPuttable.__init__(self, PurchaseOrder) IPatchable.__init__(self, PurchaseOrder) + IPuttable.__init__(self, PurchaseOrder) IPaginateable.__init__(self, PurchaseOrder) - self.rebatch = self._register_child_endpoint( - ProcurementPurchaseordersIdRebatchEndpoint(client, parent_endpoint=self) - ) self.lineitems = self._register_child_endpoint( ProcurementPurchaseordersIdLineitemsEndpoint(client, parent_endpoint=self) ) - self.unbatch = self._register_child_endpoint( - ProcurementPurchaseordersIdUnbatchEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrder]: """ Performs a GET request against the /procurement/purchaseorders/{id} endpoint and returns an initialized PaginatedResponse object. @@ -71,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrder, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrder, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchaseOrder: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/purchaseorders/{id} endpoint. + Performs a DELETE request against the /procurement/purchaseorders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PurchaseOrder: The parsed response data. """ - return self._parse_one( - PurchaseOrder, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PurchaseOrder: """ - Performs a DELETE request against the /procurement/purchaseorders/{id} endpoint. + Performs a GET request against the /procurement/purchaseorders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PurchaseOrder: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PurchaseOrder, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchaseOrder: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PurchaseOrder: """ - Performs a PUT request against the /procurement/purchaseorders/{id} endpoint. + Performs a PATCH request against the /procurement/purchaseorders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +85,11 @@ def put( Returns: PurchaseOrder: The parsed response data. """ - return self._parse_one( - PurchaseOrder, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(PurchaseOrder, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchaseOrder: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PurchaseOrder: """ - Performs a PATCH request against the /procurement/purchaseorders/{id} endpoint. + Performs a PUT request against the /procurement/purchaseorders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,7 +97,4 @@ def patch( Returns: PurchaseOrder: The parsed response data. """ - return self._parse_one( - PurchaseOrder, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrder, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsBulkEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsBulkEndpoint.py index 1f67eb4fa..e2b5475c3 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsBulkEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsBulkEndpoint.py @@ -1,37 +1,29 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IDeleteable, - IPostable, - IPuttable, -) +from pyconnectwise.interfaces import IDeleteable, IPostable, IPuttable from pyconnectwise.models.manage import BulkResult -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseordersIdLineitemsBulkEndpoint( ConnectWiseEndpoint, - IPostable[BulkResult, ConnectWiseManageRequestParams], IDeleteable[ConnectWiseManageRequestParams], + IPostable[BulkResult, ConnectWiseManageRequestParams], IPuttable[BulkResult, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "bulk", parent_endpoint=parent_endpoint - ) - IPostable.__init__(self, BulkResult) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "bulk", parent_endpoint=parent_endpoint) IDeleteable.__init__(self, None) + IPostable.__init__(self, BulkResult) IPuttable.__init__(self, BulkResult) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BulkResult: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BulkResult: """ - Performs a POST request against the /procurement/purchaseorders/{id}/lineitems/bulk endpoint. + Performs a DELETE request against the /procurement/purchaseorders/{id}/lineitems/bulk endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -39,17 +31,11 @@ def post( Returns: BulkResult: The parsed response data. """ - return self._parse_one( - BulkResult, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BulkResult, super()._make_request("DELETE", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BulkResult: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BulkResult: """ - Performs a DELETE request against the /procurement/purchaseorders/{id}/lineitems/bulk endpoint. + Performs a POST request against the /procurement/purchaseorders/{id}/lineitems/bulk endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -57,15 +43,9 @@ def delete( Returns: BulkResult: The parsed response data. """ - return self._parse_one( - BulkResult, super()._make_request("DELETE", data=data, params=params).json() - ) + return self._parse_one(BulkResult, super()._make_request("POST", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BulkResult: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BulkResult: """ Performs a PUT request against the /procurement/purchaseorders/{id}/lineitems/bulk endpoint. @@ -75,6 +55,4 @@ def put( Returns: BulkResult: The parsed response data. """ - return self._parse_one( - BulkResult, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BulkResult, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsCountEndpoint.py index 860b1acb5..2d4dd6050 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseordersIdLineitemsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPurchaseordersIdLineitemsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/purchaseorders/{id}/lineitems/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/purchaseorders/{id}/lineitems/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsEndpoint.py index 16cad19c2..405793e95 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseordersIdLineitemsBulkEndpoint import ( ProcurementPurchaseordersIdLineitemsBulkEndpoint, @@ -8,17 +10,13 @@ from pyconnectwise.endpoints.manage.ProcurementPurchaseordersIdLineitemsIdEndpoint import ( ProcurementPurchaseordersIdLineitemsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PurchaseOrderLineItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseordersIdLineitemsEndpoint( @@ -27,47 +25,34 @@ class ProcurementPurchaseordersIdLineitemsEndpoint( IPostable[PurchaseOrderLineItem, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrderLineItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "lineitems", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "lineitems", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PurchaseOrderLineItem]) IPostable.__init__(self, PurchaseOrderLineItem) IPaginateable.__init__(self, PurchaseOrderLineItem) - self.count = self._register_child_endpoint( - ProcurementPurchaseordersIdLineitemsCountEndpoint( - client, parent_endpoint=self - ) - ) self.bulk = self._register_child_endpoint( - ProcurementPurchaseordersIdLineitemsBulkEndpoint( - client, parent_endpoint=self - ) + ProcurementPurchaseordersIdLineitemsBulkEndpoint(client, parent_endpoint=self) + ) + self.count = self._register_child_endpoint( + ProcurementPurchaseordersIdLineitemsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementPurchaseordersIdLineitemsIdEndpoint: + def id(self, _id: int) -> ProcurementPurchaseordersIdLineitemsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPurchaseordersIdLineitemsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPurchaseordersIdLineitemsIdEndpoint: The initialized ProcurementPurchaseordersIdLineitemsIdEndpoint object. """ - child = ProcurementPurchaseordersIdLineitemsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementPurchaseordersIdLineitemsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrderLineItem]: """ Performs a GET request against the /procurement/purchaseorders/{id}/lineitems endpoint and returns an initialized PaginatedResponse object. @@ -85,18 +70,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrderLineItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrderLineItem, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PurchaseOrderLineItem]: """ Performs a GET request against the /procurement/purchaseorders/{id}/lineitems endpoint. @@ -107,15 +85,10 @@ def get( Returns: list[PurchaseOrderLineItem]: The parsed response data. """ - return self._parse_many( - PurchaseOrderLineItem, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PurchaseOrderLineItem, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderLineItem: """ Performs a POST request against the /procurement/purchaseorders/{id}/lineitems endpoint. @@ -126,21 +99,4 @@ def post( Returns: PurchaseOrderLineItem: The parsed response data. """ - return self._parse_one( - PurchaseOrderLineItem, - super()._make_request("POST", data=data, params=params).json(), - ) - - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: - """ - Performs a DELETE request against the /procurement/purchaseorders/{id}/lineitems endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PurchaseOrderLineItem, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsIdEndpoint.py index d813724c4..e8e139126 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdLineitemsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PurchaseOrderLineItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseordersIdLineitemsIdEndpoint( ConnectWiseEndpoint, IGettable[PurchaseOrderLineItem, ConnectWiseManageRequestParams], - IPuttable[PurchaseOrderLineItem, ConnectWiseManageRequestParams], IPatchable[PurchaseOrderLineItem, ConnectWiseManageRequestParams], + IPuttable[PurchaseOrderLineItem, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrderLineItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PurchaseOrderLineItem) - IPuttable.__init__(self, PurchaseOrderLineItem) IPatchable.__init__(self, PurchaseOrderLineItem) + IPuttable.__init__(self, PurchaseOrderLineItem) IPaginateable.__init__(self, PurchaseOrderLineItem) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrderLineItem]: """ Performs a GET request against the /procurement/purchaseorders/{id}/lineitems/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,21 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrderLineItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrderLineItem, self, page, page_size, params ) + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: + """ + Performs a DELETE request against the /procurement/purchaseorders/{id}/lineitems/{id} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + """ + super()._make_request("DELETE", data=data, params=params) + def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderLineItem: """ Performs a GET request against the /procurement/purchaseorders/{id}/lineitems/{id} endpoint. @@ -74,18 +68,13 @@ def get( Returns: PurchaseOrderLineItem: The parsed response data. """ - return self._parse_one( - PurchaseOrderLineItem, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrderLineItem, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderLineItem: """ - Performs a PUT request against the /procurement/purchaseorders/{id}/lineitems/{id} endpoint. + Performs a PATCH request against the /procurement/purchaseorders/{id}/lineitems/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +82,13 @@ def put( Returns: PurchaseOrderLineItem: The parsed response data. """ - return self._parse_one( - PurchaseOrderLineItem, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrderLineItem, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderLineItem: """ - Performs a PATCH request against the /procurement/purchaseorders/{id}/lineitems/{id} endpoint. + Performs a PUT request against the /procurement/purchaseorders/{id}/lineitems/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +96,4 @@ def patch( Returns: PurchaseOrderLineItem: The parsed response data. """ - return self._parse_one( - PurchaseOrderLineItem, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrderLineItem, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdRebatchEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdRebatchEndpoint.py index 765d09ef0..d5b63a3fc 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdRebatchEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdRebatchEndpoint.py @@ -13,9 +13,7 @@ class ProcurementPurchaseordersIdRebatchEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "rebatch", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "rebatch", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) def post( diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdUnbatchEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdUnbatchEndpoint.py index a079e2307..bd0774b87 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdUnbatchEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseordersIdUnbatchEndpoint.py @@ -13,9 +13,7 @@ class ProcurementPurchaseordersIdUnbatchEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "unbatch", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "unbatch", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) def post( diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesCountEndpoint.py index 22fa50fee..4050a0222 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPurchaseorderstatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/purchaseorderstatuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/purchaseorderstatuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesEndpoint.py index ff341cde8..b5c75fd29 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesCountEndpoint import ( ProcurementPurchaseorderstatusesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesIdEndpoint import ( ProcurementPurchaseorderstatusesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PurchaseOrderStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesEndpoint( @@ -24,10 +22,8 @@ class ProcurementPurchaseorderstatusesEndpoint( IPostable[PurchaseOrderStatus, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrderStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "purchaseorderstatuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "purchaseorderstatuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PurchaseOrderStatus]) IPostable.__init__(self, PurchaseOrderStatus) IPaginateable.__init__(self, PurchaseOrderStatus) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProcurementPurchaseorderstatusesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProcurementPurchaseorderstatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementPurchaseorderstatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPurchaseorderstatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPurchaseorderstatusesIdEndpoint: The initialized ProcurementPurchaseorderstatusesIdEndpoint object. """ - child = ProcurementPurchaseorderstatusesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementPurchaseorderstatusesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrderStatus]: """ Performs a GET request against the /procurement/purchaseorderstatuses endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrderStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrderStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PurchaseOrderStatus]: """ Performs a GET request against the /procurement/purchaseorderstatuses endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[PurchaseOrderStatus]: The parsed response data. """ - return self._parse_many( - PurchaseOrderStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PurchaseOrderStatus, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatus: """ Performs a POST request against the /procurement/purchaseorderstatuses endpoint. @@ -114,7 +93,4 @@ def post( Returns: PurchaseOrderStatus: The parsed response data. """ - return self._parse_one( - PurchaseOrderStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrderStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint.py index 79ad3190b..58a2e369c 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint.py index ea3e746ad..2b6f35d47 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint import ( ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint, @@ -6,32 +8,27 @@ ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailtemplates", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailtemplates", parent_endpoint=parent_endpoint) self.count = self._register_child_endpoint( - ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint( - client, parent_endpoint=self - ) + ProcurementPurchaseorderstatusesIdEmailtemplatesCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint: + def id(self, _id: int) -> ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint: The initialized ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint object. """ - child = ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint.py index 5315926af..e6c1fec47 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PurchaseOrderStatusEmailTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdEmailtemplatesIdEndpoint( ConnectWiseEndpoint, IGettable[PurchaseOrderStatusEmailTemplate, ConnectWiseManageRequestParams], - IPuttable[PurchaseOrderStatusEmailTemplate, ConnectWiseManageRequestParams], IPatchable[PurchaseOrderStatusEmailTemplate, ConnectWiseManageRequestParams], + IPuttable[PurchaseOrderStatusEmailTemplate, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrderStatusEmailTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PurchaseOrderStatusEmailTemplate) - IPuttable.__init__(self, PurchaseOrderStatusEmailTemplate) IPatchable.__init__(self, PurchaseOrderStatusEmailTemplate) + IPuttable.__init__(self, PurchaseOrderStatusEmailTemplate) IPaginateable.__init__(self, PurchaseOrderStatusEmailTemplate) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrderStatusEmailTemplate]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrderStatusEmailTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrderStatusEmailTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchaseOrderStatusEmailTemplate: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. + Performs a DELETE request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PurchaseOrderStatusEmailTemplate: The parsed response data. """ - return self._parse_one( - PurchaseOrderStatusEmailTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> PurchaseOrderStatusEmailTemplate: """ - Performs a DELETE request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. + Performs a GET request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PurchaseOrderStatusEmailTemplate: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + PurchaseOrderStatusEmailTemplate, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatusEmailTemplate: """ - Performs a PUT request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. + Performs a PATCH request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( PurchaseOrderStatusEmailTemplate: The parsed response data. """ return self._parse_one( - PurchaseOrderStatusEmailTemplate, - super()._make_request("PUT", data=data, params=params).json(), + PurchaseOrderStatusEmailTemplate, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatusEmailTemplate: """ - Performs a PATCH request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. + Performs a PUT request against the /procurement/purchaseorderstatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( PurchaseOrderStatusEmailTemplate: The parsed response data. """ return self._parse_one( - PurchaseOrderStatusEmailTemplate, - super()._make_request("PATCH", data=data, params=params).json(), + PurchaseOrderStatusEmailTemplate, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEndpoint.py index 4ba21648f..83f2e0f11 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint import ( ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint, @@ -8,19 +10,13 @@ from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesIdUsagesEndpoint import ( ProcurementPurchaseorderstatusesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PurchaseOrderStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdEndpoint( @@ -30,36 +26,25 @@ class ProcurementPurchaseorderstatusesIdEndpoint( IPuttable[PurchaseOrderStatus, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrderStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PurchaseOrderStatus) IPatchable.__init__(self, PurchaseOrderStatus) IPuttable.__init__(self, PurchaseOrderStatus) IPaginateable.__init__(self, PurchaseOrderStatus) - self.usages = self._register_child_endpoint( - ProcurementPurchaseorderstatusesIdUsagesEndpoint( - client, parent_endpoint=self - ) - ) self.emailtemplates = self._register_child_endpoint( - ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint( - client, parent_endpoint=self - ) + ProcurementPurchaseorderstatusesIdEmailtemplatesEndpoint(client, parent_endpoint=self) ) self.notifications = self._register_child_endpoint( - ProcurementPurchaseorderstatusesIdNotificationsEndpoint( - client, parent_endpoint=self - ) + ProcurementPurchaseorderstatusesIdNotificationsEndpoint(client, parent_endpoint=self) + ) + self.usages = self._register_child_endpoint( + ProcurementPurchaseorderstatusesIdUsagesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrderStatus]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -77,51 +62,35 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrderStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrderStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchaseOrderStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/purchaseorderstatuses/{id} endpoint. + Performs a DELETE request against the /procurement/purchaseorderstatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PurchaseOrderStatus: The parsed response data. """ - return self._parse_one( - PurchaseOrderStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> PurchaseOrderStatus: """ - Performs a DELETE request against the /procurement/purchaseorderstatuses/{id} endpoint. + Performs a GET request against the /procurement/purchaseorderstatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PurchaseOrderStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PurchaseOrderStatus, super()._make_request("GET", data=data, params=params).json()) def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatus: """ Performs a PATCH request against the /procurement/purchaseorderstatuses/{id} endpoint. @@ -132,15 +101,10 @@ def patch( Returns: PurchaseOrderStatus: The parsed response data. """ - return self._parse_one( - PurchaseOrderStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrderStatus, super()._make_request("PATCH", data=data, params=params).json()) def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatus: """ Performs a PUT request against the /procurement/purchaseorderstatuses/{id} endpoint. @@ -151,7 +115,4 @@ def put( Returns: PurchaseOrderStatus: The parsed response data. """ - return self._parse_one( - PurchaseOrderStatus, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(PurchaseOrderStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint.py index 961d165fa..fa5f7b762 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/notifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/notifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsEndpoint.py index 05e7976ce..2f419896f 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint import ( ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint import ( ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PurchaseOrderStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdNotificationsEndpoint( @@ -24,42 +22,31 @@ class ProcurementPurchaseorderstatusesIdNotificationsEndpoint( IPostable[PurchaseOrderStatusNotification, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrderStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PurchaseOrderStatusNotification]) IPostable.__init__(self, PurchaseOrderStatusNotification) IPaginateable.__init__(self, PurchaseOrderStatusNotification) self.count = self._register_child_endpoint( - ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint( - client, parent_endpoint=self - ) + ProcurementPurchaseorderstatusesIdNotificationsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint: + def id(self, _id: int) -> ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint: The initialized ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint object. """ - child = ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrderStatusNotification]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/notifications endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrderStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrderStatusNotification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PurchaseOrderStatusNotification]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/notifications endpoint. @@ -100,14 +80,11 @@ def get( list[PurchaseOrderStatusNotification]: The parsed response data. """ return self._parse_many( - PurchaseOrderStatusNotification, - super()._make_request("GET", data=data, params=params).json(), + PurchaseOrderStatusNotification, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatusNotification: """ Performs a POST request against the /procurement/purchaseorderstatuses/{id}/notifications endpoint. @@ -119,6 +96,5 @@ def post( PurchaseOrderStatusNotification: The parsed response data. """ return self._parse_one( - PurchaseOrderStatusNotification, - super()._make_request("POST", data=data, params=params).json(), + PurchaseOrderStatusNotification, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint.py index 3b84bd2f5..2cffd8f61 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PurchaseOrderStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdNotificationsIdEndpoint( ConnectWiseEndpoint, IGettable[PurchaseOrderStatusNotification, ConnectWiseManageRequestParams], - IPuttable[PurchaseOrderStatusNotification, ConnectWiseManageRequestParams], IPatchable[PurchaseOrderStatusNotification, ConnectWiseManageRequestParams], + IPuttable[PurchaseOrderStatusNotification, ConnectWiseManageRequestParams], IPaginateable[PurchaseOrderStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PurchaseOrderStatusNotification) - IPuttable.__init__(self, PurchaseOrderStatusNotification) IPatchable.__init__(self, PurchaseOrderStatusNotification) + IPuttable.__init__(self, PurchaseOrderStatusNotification) IPaginateable.__init__(self, PurchaseOrderStatusNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PurchaseOrderStatusNotification]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PurchaseOrderStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PurchaseOrderStatusNotification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchaseOrderStatusNotification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. + Performs a DELETE request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PurchaseOrderStatusNotification: The parsed response data. """ - return self._parse_one( - PurchaseOrderStatusNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> PurchaseOrderStatusNotification: """ - Performs a DELETE request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. + Performs a GET request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PurchaseOrderStatusNotification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + PurchaseOrderStatusNotification, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatusNotification: """ - Performs a PUT request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. + Performs a PATCH request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( PurchaseOrderStatusNotification: The parsed response data. """ return self._parse_one( - PurchaseOrderStatusNotification, - super()._make_request("PUT", data=data, params=params).json(), + PurchaseOrderStatusNotification, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> PurchaseOrderStatusNotification: """ - Performs a PATCH request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. + Performs a PUT request against the /procurement/purchaseorderstatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( PurchaseOrderStatusNotification: The parsed response data. """ return self._parse_one( - PurchaseOrderStatusNotification, - super()._make_request("PATCH", data=data, params=params).json(), + PurchaseOrderStatusNotification, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesEndpoint.py index 88b8b8e41..c50a11dc5 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementPurchaseorderstatusesIdUsagesListEndpoint import ( ProcurementPurchaseorderstatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdUsagesEndpoint( @@ -19,24 +18,17 @@ class ProcurementPurchaseorderstatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - ProcurementPurchaseorderstatusesIdUsagesListEndpoint( - client, parent_endpoint=self - ) + ProcurementPurchaseorderstatusesIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesListEndpoint.py index 78bb9f8e0..e83a0fe51 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchaseorderstatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchaseorderstatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProcurementPurchaseorderstatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/purchaseorderstatuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementPurchasingdemandsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementPurchasingdemandsEndpoint.py index e9993970a..c404c5749 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementPurchasingdemandsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementPurchasingdemandsEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import PurchasingDemand -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementPurchasingdemandsEndpoint( ConnectWiseEndpoint, IPostable[PurchasingDemand, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "purchasingDemands", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "purchasingDemands", parent_endpoint=parent_endpoint) IPostable.__init__(self, PurchasingDemand) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PurchasingDemand: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PurchasingDemand: """ Performs a POST request against the /procurement/purchasingDemands endpoint. @@ -32,7 +26,4 @@ def post( Returns: PurchasingDemand: The parsed response data. """ - return self._parse_one( - PurchasingDemand, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(PurchasingDemand, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsCountEndpoint.py index b42750bce..8abd20fa5 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmaactionsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmaactionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/rmaActions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/rmaActions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsEndpoint.py index d54e5ce28..7af00554c 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementRmaactionsCountEndpoint import ( - ProcurementRmaactionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmaactionsIdEndpoint import ( - ProcurementRmaactionsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmaactionsInfoEndpoint import ( - ProcurementRmaactionsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementRmaactionsCountEndpoint import ProcurementRmaactionsCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmaactionsIdEndpoint import ProcurementRmaactionsIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmaactionsInfoEndpoint import ProcurementRmaactionsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import RmaAction from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmaactionsEndpoint( @@ -27,39 +19,30 @@ class ProcurementRmaactionsEndpoint( IPostable[RmaAction, ConnectWiseManageRequestParams], IPaginateable[RmaAction, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "rmaActions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "rmaActions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaAction]) IPostable.__init__(self, RmaAction) IPaginateable.__init__(self, RmaAction) - self.count = self._register_child_endpoint( - ProcurementRmaactionsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementRmaactionsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementRmaactionsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementRmaactionsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementRmaactionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementRmaactionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementRmaactionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementRmaactionsIdEndpoint: The initialized ProcurementRmaactionsIdEndpoint object. """ child = ProcurementRmaactionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaAction]: """ Performs a GET request against the /procurement/rmaActions endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - RmaAction, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), RmaAction, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[RmaAction]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[RmaAction]: """ Performs a GET request against the /procurement/rmaActions endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[RmaAction]: The parsed response data. """ - return self._parse_many( - RmaAction, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(RmaAction, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaAction: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaAction: """ Performs a POST request against the /procurement/rmaActions endpoint. @@ -117,6 +83,4 @@ def post( Returns: RmaAction: The parsed response data. """ - return self._parse_one( - RmaAction, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(RmaAction, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdEndpoint.py index 0fb09184a..5c553d8a8 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementRmaactionsIdInfoEndpoint import ( - ProcurementRmaactionsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProcurementRmaactionsIdInfoEndpoint import ProcurementRmaactionsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import RmaAction from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmaactionsIdEndpoint( ConnectWiseEndpoint, IGettable[RmaAction, ConnectWiseManageRequestParams], - IPuttable[RmaAction, ConnectWiseManageRequestParams], IPatchable[RmaAction, ConnectWiseManageRequestParams], + IPuttable[RmaAction, ConnectWiseManageRequestParams], IPaginateable[RmaAction, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaAction) - IPuttable.__init__(self, RmaAction) IPatchable.__init__(self, RmaAction) + IPuttable.__init__(self, RmaAction) IPaginateable.__init__(self, RmaAction) - self.info = self._register_child_endpoint( - ProcurementRmaactionsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProcurementRmaactionsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaAction]: """ Performs a GET request against the /procurement/rmaActions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - RmaAction, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), RmaAction, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaAction: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/rmaActions/{id} endpoint. + Performs a DELETE request against the /procurement/rmaActions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - RmaAction: The parsed response data. """ - return self._parse_one( - RmaAction, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaAction: """ - Performs a DELETE request against the /procurement/rmaActions/{id} endpoint. + Performs a GET request against the /procurement/rmaActions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + RmaAction: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(RmaAction, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaAction: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> RmaAction: """ - Performs a PUT request against the /procurement/rmaActions/{id} endpoint. + Performs a PATCH request against the /procurement/rmaActions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: RmaAction: The parsed response data. """ - return self._parse_one( - RmaAction, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(RmaAction, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaAction: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaAction: """ - Performs a PATCH request against the /procurement/rmaActions/{id} endpoint. + Performs a PUT request against the /procurement/rmaActions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: RmaAction: The parsed response data. """ - return self._parse_one( - RmaAction, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(RmaAction, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdInfoEndpoint.py index 9f1372ece..8f88bd30f 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import RmaActionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmaactionsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmaactionsIdInfoEndpoint( IGettable[RmaActionInfo, ConnectWiseManageRequestParams], IPaginateable[RmaActionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaActionInfo) IPaginateable.__init__(self, RmaActionInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaActionInfo]: """ Performs a GET request against the /procurement/rmaActions/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaActionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaActionInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaActionInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaActionInfo: """ Performs a GET request against the /procurement/rmaActions/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: RmaActionInfo: The parsed response data. """ - return self._parse_one( - RmaActionInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(RmaActionInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoCountEndpoint.py index 346aa56a7..1d6c351ef 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmaactionsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmaactionsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/rmaActions/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/rmaActions/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoEndpoint.py index 289386a52..361f240ae 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmaactionsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementRmaactionsInfoCountEndpoint import ( - ProcurementRmaactionsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProcurementRmaactionsInfoCountEndpoint import ProcurementRmaactionsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import RmaActionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmaactionsInfoEndpoint( @@ -19,22 +16,15 @@ class ProcurementRmaactionsInfoEndpoint( IGettable[list[RmaActionInfo], ConnectWiseManageRequestParams], IPaginateable[RmaActionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaActionInfo]) IPaginateable.__init__(self, RmaActionInfo) - self.count = self._register_child_endpoint( - ProcurementRmaactionsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementRmaactionsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaActionInfo]: """ Performs a GET request against the /procurement/rmaActions/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaActionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaActionInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[RmaActionInfo]: """ Performs a GET request against the /procurement/rmaActions/info endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[RmaActionInfo]: The parsed response data. """ - return self._parse_many( - RmaActionInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(RmaActionInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsCountEndpoint.py index bb9869585..f26163de2 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmadispositionsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmadispositionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/RMADispositions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/RMADispositions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsEndpoint.py index 7c67c7e6f..35b5e3cc3 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsEndpoint.py @@ -1,24 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementRmadispositionsCountEndpoint import ( ProcurementRmadispositionsCountEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementRmadispositionsIdEndpoint import ( - ProcurementRmadispositionsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmadispositionsInfoEndpoint import ( - ProcurementRmadispositionsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementRmadispositionsIdEndpoint import ProcurementRmadispositionsIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmadispositionsInfoEndpoint import ProcurementRmadispositionsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import RmaDisposition from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmadispositionsEndpoint( @@ -27,10 +21,8 @@ class ProcurementRmadispositionsEndpoint( IPostable[RmaDisposition, ConnectWiseManageRequestParams], IPaginateable[RmaDisposition, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "RMADispositions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "RMADispositions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaDisposition]) IPostable.__init__(self, RmaDisposition) IPaginateable.__init__(self, RmaDisposition) @@ -38,28 +30,23 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 self.count = self._register_child_endpoint( ProcurementRmadispositionsCountEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ProcurementRmadispositionsInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProcurementRmadispositionsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementRmadispositionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementRmadispositionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementRmadispositionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementRmadispositionsIdEndpoint: The initialized ProcurementRmadispositionsIdEndpoint object. """ child = ProcurementRmadispositionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaDisposition]: """ Performs a GET request against the /procurement/RMADispositions endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaDisposition, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaDisposition, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[RmaDisposition]: """ Performs a GET request against the /procurement/RMADispositions endpoint. @@ -99,16 +79,9 @@ def get( Returns: list[RmaDisposition]: The parsed response data. """ - return self._parse_many( - RmaDisposition, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(RmaDisposition, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaDisposition: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaDisposition: """ Performs a POST request against the /procurement/RMADispositions endpoint. @@ -118,7 +91,4 @@ def post( Returns: RmaDisposition: The parsed response data. """ - return self._parse_one( - RmaDisposition, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(RmaDisposition, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdEndpoint.py index de04d610b..4ad3b369b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementRmadispositionsIdInfoEndpoint import ( ProcurementRmadispositionsIdInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import RmaDisposition from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmadispositionsIdEndpoint( ConnectWiseEndpoint, IGettable[RmaDisposition, ConnectWiseManageRequestParams], - IPuttable[RmaDisposition, ConnectWiseManageRequestParams], IPatchable[RmaDisposition, ConnectWiseManageRequestParams], + IPuttable[RmaDisposition, ConnectWiseManageRequestParams], IPaginateable[RmaDisposition, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaDisposition) - IPuttable.__init__(self, RmaDisposition) IPatchable.__init__(self, RmaDisposition) + IPuttable.__init__(self, RmaDisposition) IPaginateable.__init__(self, RmaDisposition) self.info = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaDisposition]: """ Performs a GET request against the /procurement/RMADispositions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaDisposition, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaDisposition, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaDisposition: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/RMADispositions/{id} endpoint. + Performs a DELETE request against the /procurement/RMADispositions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - RmaDisposition: The parsed response data. """ - return self._parse_one( - RmaDisposition, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaDisposition: """ - Performs a DELETE request against the /procurement/RMADispositions/{id} endpoint. + Performs a GET request against the /procurement/RMADispositions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + RmaDisposition: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(RmaDisposition, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaDisposition: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> RmaDisposition: """ - Performs a PUT request against the /procurement/RMADispositions/{id} endpoint. + Performs a PATCH request against the /procurement/RMADispositions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +85,11 @@ def put( Returns: RmaDisposition: The parsed response data. """ - return self._parse_one( - RmaDisposition, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(RmaDisposition, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaDisposition: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaDisposition: """ - Performs a PATCH request against the /procurement/RMADispositions/{id} endpoint. + Performs a PUT request against the /procurement/RMADispositions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +97,4 @@ def patch( Returns: RmaDisposition: The parsed response data. """ - return self._parse_one( - RmaDisposition, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(RmaDisposition, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdInfoEndpoint.py index 38a5bc09d..7f4afdc6b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import RmaDispositionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmadispositionsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmadispositionsIdInfoEndpoint( IGettable[RmaDispositionInfo, ConnectWiseManageRequestParams], IPaginateable[RmaDispositionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaDispositionInfo) IPaginateable.__init__(self, RmaDispositionInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaDispositionInfo]: """ Performs a GET request against the /procurement/RMADispositions/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaDispositionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaDispositionInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaDispositionInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaDispositionInfo: """ Performs a GET request against the /procurement/RMADispositions/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: RmaDispositionInfo: The parsed response data. """ - return self._parse_one( - RmaDispositionInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(RmaDispositionInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoCountEndpoint.py index da6cebb2f..16d44894e 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmadispositionsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmadispositionsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/RMADispositions/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/RMADispositions/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoEndpoint.py index dc2a9472e..1a1d69e7e 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmadispositionsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementRmadispositionsInfoCountEndpoint import ( ProcurementRmadispositionsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import RmaDispositionInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmadispositionsInfoEndpoint( @@ -19,10 +18,8 @@ class ProcurementRmadispositionsInfoEndpoint( IGettable[list[RmaDispositionInfo], ConnectWiseManageRequestParams], IPaginateable[RmaDispositionInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaDispositionInfo]) IPaginateable.__init__(self, RmaDispositionInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaDispositionInfo]: """ Performs a GET request against the /procurement/RMADispositions/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaDispositionInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaDispositionInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[RmaDispositionInfo]: """ Performs a GET request against the /procurement/RMADispositions/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[RmaDispositionInfo]: The parsed response data. """ - return self._parse_many( - RmaDispositionInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(RmaDispositionInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesCountEndpoint.py index b2352166b..2c3aeb7a9 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmastatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/rmaStatuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/rmaStatuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesEndpoint.py index dbf9f3457..a13966e28 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementRmastatusesCountEndpoint import ( - ProcurementRmastatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdEndpoint import ( - ProcurementRmastatusesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmastatusesInfoEndpoint import ( - ProcurementRmastatusesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementRmastatusesCountEndpoint import ProcurementRmastatusesCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdEndpoint import ProcurementRmastatusesIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmastatusesInfoEndpoint import ProcurementRmastatusesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import RmaStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesEndpoint( @@ -27,39 +19,30 @@ class ProcurementRmastatusesEndpoint( IPostable[RmaStatus, ConnectWiseManageRequestParams], IPaginateable[RmaStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "rmaStatuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "rmaStatuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaStatus]) IPostable.__init__(self, RmaStatus) IPaginateable.__init__(self, RmaStatus) - self.count = self._register_child_endpoint( - ProcurementRmastatusesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementRmastatusesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementRmastatusesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementRmastatusesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementRmastatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementRmastatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementRmastatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementRmastatusesIdEndpoint: The initialized ProcurementRmastatusesIdEndpoint object. """ child = ProcurementRmastatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaStatus]: """ Performs a GET request against the /procurement/rmaStatuses endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - RmaStatus, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), RmaStatus, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[RmaStatus]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[RmaStatus]: """ Performs a GET request against the /procurement/rmaStatuses endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[RmaStatus]: The parsed response data. """ - return self._parse_many( - RmaStatus, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(RmaStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaStatus: """ Performs a POST request against the /procurement/rmaStatuses endpoint. @@ -117,6 +83,4 @@ def post( Returns: RmaStatus: The parsed response data. """ - return self._parse_one( - RmaStatus, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(RmaStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesCountEndpoint.py index 7afca109c..8b224de55 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdEmailtemplatesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmastatusesIdEmailtemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/emailtemplates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/rmaStatuses/{id}/emailtemplates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesEndpoint.py index a669b8ab0..fbf0295da 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesEndpoint.py @@ -1,8 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdEmailtemplatesCountEndpoint import ( + ProcurementRmastatusesIdEmailtemplatesCountEndpoint, +) +from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdEmailtemplatesIdEndpoint import ( + ProcurementRmastatusesIdEmailtemplatesIdEndpoint, +) + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdEmailtemplatesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailTemplates", parent_endpoint=parent_endpoint + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailtemplates", parent_endpoint=parent_endpoint) + + self.count = self._register_child_endpoint( + ProcurementRmastatusesIdEmailtemplatesCountEndpoint(client, parent_endpoint=self) ) + + def id(self, _id: int) -> ProcurementRmastatusesIdEmailtemplatesIdEndpoint: + """ + Sets the ID for this endpoint and returns an initialized ProcurementRmastatusesIdEmailtemplatesIdEndpoint object to move down the chain. + + Parameters: + _id (int): The ID to set. + Returns: + ProcurementRmastatusesIdEmailtemplatesIdEndpoint: The initialized ProcurementRmastatusesIdEmailtemplatesIdEndpoint object. + """ + child = ProcurementRmastatusesIdEmailtemplatesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id + return child diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesIdEndpoint.py index 71e942631..b5973355d 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEmailtemplatesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import RmaStatusEmailTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdEmailtemplatesIdEndpoint( ConnectWiseEndpoint, IGettable[RmaStatusEmailTemplate, ConnectWiseManageRequestParams], - IPuttable[RmaStatusEmailTemplate, ConnectWiseManageRequestParams], IPatchable[RmaStatusEmailTemplate, ConnectWiseManageRequestParams], + IPuttable[RmaStatusEmailTemplate, ConnectWiseManageRequestParams], IPaginateable[RmaStatusEmailTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaStatusEmailTemplate) - IPuttable.__init__(self, RmaStatusEmailTemplate) IPatchable.__init__(self, RmaStatusEmailTemplate) + IPuttable.__init__(self, RmaStatusEmailTemplate) IPaginateable.__init__(self, RmaStatusEmailTemplate) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaStatusEmailTemplate]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaStatusEmailTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaStatusEmailTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaStatusEmailTemplate: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. + Performs a DELETE request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - RmaStatusEmailTemplate: The parsed response data. """ - return self._parse_one( - RmaStatusEmailTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> RmaStatusEmailTemplate: """ - Performs a DELETE request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. + Performs a GET request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + RmaStatusEmailTemplate: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(RmaStatusEmailTemplate, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> RmaStatusEmailTemplate: """ - Performs a PUT request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. + Performs a PATCH request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: RmaStatusEmailTemplate: The parsed response data. """ - return self._parse_one( - RmaStatusEmailTemplate, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(RmaStatusEmailTemplate, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> RmaStatusEmailTemplate: """ - Performs a PATCH request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. + Performs a PUT request against the /procurement/rmaStatuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: RmaStatusEmailTemplate: The parsed response data. """ - return self._parse_one( - RmaStatusEmailTemplate, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(RmaStatusEmailTemplate, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEndpoint.py index 94a6e8524..203bee740 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdEndpoint.py @@ -1,68 +1,53 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdEmailtemplatesEndpoint import ( ProcurementRmastatusesIdEmailtemplatesEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdInfoEndpoint import ( - ProcurementRmastatusesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdInfoEndpoint import ProcurementRmastatusesIdInfoEndpoint from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdNotificationsEndpoint import ( ProcurementRmastatusesIdNotificationsEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdUsagesEndpoint import ( - ProcurementRmastatusesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdUsagesEndpoint import ProcurementRmastatusesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import RmaStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdEndpoint( ConnectWiseEndpoint, IGettable[RmaStatus, ConnectWiseManageRequestParams], - IPuttable[RmaStatus, ConnectWiseManageRequestParams], IPatchable[RmaStatus, ConnectWiseManageRequestParams], + IPuttable[RmaStatus, ConnectWiseManageRequestParams], IPaginateable[RmaStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaStatus) - IPuttable.__init__(self, RmaStatus) IPatchable.__init__(self, RmaStatus) + IPuttable.__init__(self, RmaStatus) IPaginateable.__init__(self, RmaStatus) - self.emailtemplates = self._register_child_endpoint( + self.email_templates = self._register_child_endpoint( ProcurementRmastatusesIdEmailtemplatesEndpoint(client, parent_endpoint=self) ) - self.email_templates = self._register_child_endpoint( + self.emailtemplates = self._register_child_endpoint( ProcurementRmastatusesIdEmailtemplatesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ProcurementRmastatusesIdInfoEndpoint(client, parent_endpoint=self) + self.info = self._register_child_endpoint(ProcurementRmastatusesIdInfoEndpoint(client, parent_endpoint=self)) + self.notifications = self._register_child_endpoint( + ProcurementRmastatusesIdNotificationsEndpoint(client, parent_endpoint=self) ) self.usages = self._register_child_endpoint( ProcurementRmastatusesIdUsagesEndpoint(client, parent_endpoint=self) ) - self.notifications = self._register_child_endpoint( - ProcurementRmastatusesIdNotificationsEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaStatus]: """ Performs a GET request against the /procurement/rmaStatuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -79,54 +64,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - RmaStatus, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), RmaStatus, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/rmaStatuses/{id} endpoint. + Performs a DELETE request against the /procurement/rmaStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - RmaStatus: The parsed response data. """ - return self._parse_one( - RmaStatus, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaStatus: """ - Performs a DELETE request against the /procurement/rmaStatuses/{id} endpoint. + Performs a GET request against the /procurement/rmaStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + RmaStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(RmaStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> RmaStatus: """ - Performs a PUT request against the /procurement/rmaStatuses/{id} endpoint. + Performs a PATCH request against the /procurement/rmaStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -134,17 +98,11 @@ def put( Returns: RmaStatus: The parsed response data. """ - return self._parse_one( - RmaStatus, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(RmaStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaStatus: """ - Performs a PATCH request against the /procurement/rmaStatuses/{id} endpoint. + Performs a PUT request against the /procurement/rmaStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -152,6 +110,4 @@ def patch( Returns: RmaStatus: The parsed response data. """ - return self._parse_one( - RmaStatus, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(RmaStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdInfoEndpoint.py index 025660737..51faecbbb 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import RmaStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmastatusesIdInfoEndpoint( IGettable[RmaStatusInfo, ConnectWiseManageRequestParams], IPaginateable[RmaStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaStatusInfo) IPaginateable.__init__(self, RmaStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaStatusInfo]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaStatusInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaStatusInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaStatusInfo: """ Performs a GET request against the /procurement/rmaStatuses/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: RmaStatusInfo: The parsed response data. """ - return self._parse_one( - RmaStatusInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(RmaStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsCountEndpoint.py index db70d33bd..4ed9f1842 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdNotificationsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmastatusesIdNotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/notifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/rmaStatuses/{id}/notifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsEndpoint.py index bd9c68447..242a485db 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdNotificationsCountEndpoint import ( ProcurementRmastatusesIdNotificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdNotificationsIdEndpoint import ( ProcurementRmastatusesIdNotificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import RmaStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdNotificationsEndpoint( @@ -24,42 +22,31 @@ class ProcurementRmastatusesIdNotificationsEndpoint( IPostable[RmaStatusNotification, ConnectWiseManageRequestParams], IPaginateable[RmaStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaStatusNotification]) IPostable.__init__(self, RmaStatusNotification) IPaginateable.__init__(self, RmaStatusNotification) self.count = self._register_child_endpoint( - ProcurementRmastatusesIdNotificationsCountEndpoint( - client, parent_endpoint=self - ) + ProcurementRmastatusesIdNotificationsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementRmastatusesIdNotificationsIdEndpoint: + def id(self, _id: int) -> ProcurementRmastatusesIdNotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementRmastatusesIdNotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementRmastatusesIdNotificationsIdEndpoint: The initialized ProcurementRmastatusesIdNotificationsIdEndpoint object. """ - child = ProcurementRmastatusesIdNotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementRmastatusesIdNotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaStatusNotification]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/notifications endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaStatusNotification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[RmaStatusNotification]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/notifications endpoint. @@ -99,15 +79,10 @@ def get( Returns: list[RmaStatusNotification]: The parsed response data. """ - return self._parse_many( - RmaStatusNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(RmaStatusNotification, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> RmaStatusNotification: """ Performs a POST request against the /procurement/rmaStatuses/{id}/notifications endpoint. @@ -118,7 +93,4 @@ def post( Returns: RmaStatusNotification: The parsed response data. """ - return self._parse_one( - RmaStatusNotification, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(RmaStatusNotification, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsIdEndpoint.py index afe852659..a0d37008b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdNotificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import RmaStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdNotificationsIdEndpoint( ConnectWiseEndpoint, IGettable[RmaStatusNotification, ConnectWiseManageRequestParams], - IPuttable[RmaStatusNotification, ConnectWiseManageRequestParams], IPatchable[RmaStatusNotification, ConnectWiseManageRequestParams], + IPuttable[RmaStatusNotification, ConnectWiseManageRequestParams], IPaginateable[RmaStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaStatusNotification) - IPuttable.__init__(self, RmaStatusNotification) IPatchable.__init__(self, RmaStatusNotification) + IPuttable.__init__(self, RmaStatusNotification) IPaginateable.__init__(self, RmaStatusNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaStatusNotification]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaStatusNotification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaStatusNotification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. + Performs a DELETE request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - RmaStatusNotification: The parsed response data. """ - return self._parse_one( - RmaStatusNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> RmaStatusNotification: """ - Performs a DELETE request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. + Performs a GET request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + RmaStatusNotification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(RmaStatusNotification, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> RmaStatusNotification: """ - Performs a PUT request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. + Performs a PATCH request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: RmaStatusNotification: The parsed response data. """ - return self._parse_one( - RmaStatusNotification, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(RmaStatusNotification, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> RmaStatusNotification: """ - Performs a PATCH request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. + Performs a PUT request against the /procurement/rmaStatuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: RmaStatusNotification: The parsed response data. """ - return self._parse_one( - RmaStatusNotification, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(RmaStatusNotification, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesEndpoint.py index e14916557..ff8ade9a8 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementRmastatusesIdUsagesListEndpoint import ( ProcurementRmastatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ProcurementRmastatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesListEndpoint.py index e949a2a06..c407fd5aa 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmastatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/rmaStatuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoCountEndpoint.py index 27a33e871..d2cff9260 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmastatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/rmaStatuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/rmaStatuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoEndpoint.py index 407f0cf87..f2030cca5 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmastatusesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementRmastatusesInfoCountEndpoint import ( ProcurementRmastatusesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import RmaStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmastatusesInfoEndpoint( @@ -19,10 +18,8 @@ class ProcurementRmastatusesInfoEndpoint( IGettable[list[RmaStatusInfo], ConnectWiseManageRequestParams], IPaginateable[RmaStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaStatusInfo]) IPaginateable.__init__(self, RmaStatusInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaStatusInfo]: """ Performs a GET request against the /procurement/rmaStatuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - RmaStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), RmaStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[RmaStatusInfo]: """ Performs a GET request against the /procurement/rmaStatuses/info endpoint. @@ -74,6 +61,4 @@ def get( Returns: list[RmaStatusInfo]: The parsed response data. """ - return self._parse_many( - RmaStatusInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(RmaStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsCountEndpoint.py index cde3ac15c..527a523ee 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmatagsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmatagsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/rmaTags/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/rmaTags/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsDefaultEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsDefaultEndpoint.py index 51b9483ab..a757e31a6 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsDefaultEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsDefaultEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import RmaTag from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmatagsDefaultEndpoint( @@ -16,18 +15,13 @@ class ProcurementRmatagsDefaultEndpoint( IGettable[RmaTag, ConnectWiseManageRequestParams], IPaginateable[RmaTag, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "default", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "default", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaTag) IPaginateable.__init__(self, RmaTag) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaTag]: """ Performs a GET request against the /procurement/rmaTags/default endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - RmaTag, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), RmaTag, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaTag: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaTag: """ Performs a GET request against the /procurement/rmaTags/default endpoint. @@ -67,6 +50,4 @@ def get( Returns: RmaTag: The parsed response data. """ - return self._parse_one( - RmaTag, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(RmaTag, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsEndpoint.py index 2b75509d4..eef5f61ef 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementRmatagsCountEndpoint import ( - ProcurementRmatagsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmatagsDefaultEndpoint import ( - ProcurementRmatagsDefaultEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementRmatagsIdEndpoint import ( - ProcurementRmatagsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementRmatagsCountEndpoint import ProcurementRmatagsCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmatagsDefaultEndpoint import ProcurementRmatagsDefaultEndpoint +from pyconnectwise.endpoints.manage.ProcurementRmatagsIdEndpoint import ProcurementRmatagsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import RmaTag from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmatagsEndpoint( @@ -27,39 +19,30 @@ class ProcurementRmatagsEndpoint( IPostable[RmaTag, ConnectWiseManageRequestParams], IPaginateable[RmaTag, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "rmaTags", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "rmaTags", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[RmaTag]) IPostable.__init__(self, RmaTag) IPaginateable.__init__(self, RmaTag) - self.default = self._register_child_endpoint( - ProcurementRmatagsDefaultEndpoint(client, parent_endpoint=self) - ) - self.count = self._register_child_endpoint( - ProcurementRmatagsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementRmatagsCountEndpoint(client, parent_endpoint=self)) + self.default = self._register_child_endpoint(ProcurementRmatagsDefaultEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementRmatagsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementRmatagsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementRmatagsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementRmatagsIdEndpoint: The initialized ProcurementRmatagsIdEndpoint object. """ child = ProcurementRmatagsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaTag]: """ Performs a GET request against the /procurement/rmaTags endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - RmaTag, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), RmaTag, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[RmaTag]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[RmaTag]: """ Performs a GET request against the /procurement/rmaTags endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[RmaTag]: The parsed response data. """ - return self._parse_many( - RmaTag, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(RmaTag, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaTag: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaTag: """ Performs a POST request against the /procurement/rmaTags endpoint. @@ -117,6 +83,4 @@ def post( Returns: RmaTag: The parsed response data. """ - return self._parse_one( - RmaTag, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(RmaTag, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsIdEndpoint.py index 758e5df32..09d5b7f5b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementRmatagsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementRmatagsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import RmaTag from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementRmatagsIdEndpoint( ConnectWiseEndpoint, IGettable[RmaTag, ConnectWiseManageRequestParams], - IPuttable[RmaTag, ConnectWiseManageRequestParams], IPatchable[RmaTag, ConnectWiseManageRequestParams], + IPuttable[RmaTag, ConnectWiseManageRequestParams], IPaginateable[RmaTag, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, RmaTag) - IPuttable.__init__(self, RmaTag) IPatchable.__init__(self, RmaTag) + IPuttable.__init__(self, RmaTag) IPaginateable.__init__(self, RmaTag) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[RmaTag]: """ Performs a GET request against the /procurement/rmaTags/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - RmaTag, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), RmaTag, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaTag: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/rmaTags/{id} endpoint. + Performs a DELETE request against the /procurement/rmaTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - RmaTag: The parsed response data. """ - return self._parse_one( - RmaTag, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaTag: """ - Performs a DELETE request against the /procurement/rmaTags/{id} endpoint. + Performs a GET request against the /procurement/rmaTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + RmaTag: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(RmaTag, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaTag: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> RmaTag: """ - Performs a PUT request against the /procurement/rmaTags/{id} endpoint. + Performs a PATCH request against the /procurement/rmaTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: RmaTag: The parsed response data. """ - return self._parse_one( - RmaTag, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(RmaTag, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> RmaTag: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> RmaTag: """ - Performs a PATCH request against the /procurement/rmaTags/{id} endpoint. + Performs a PUT request against the /procurement/rmaTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: RmaTag: The parsed response data. """ - return self._parse_one( - RmaTag, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(RmaTag, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSettingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSettingsCountEndpoint.py index e1e72f94d..06d433110 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSettingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSettingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSettingsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementSettingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/settings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/settings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSettingsEndpoint.py index 3db312cfa..e563ffa5b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSettingsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementSettingsCountEndpoint import ( - ProcurementSettingsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementSettingsIdEndpoint import ( - ProcurementSettingsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProcurementSettingsCountEndpoint import ProcurementSettingsCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementSettingsIdEndpoint import ProcurementSettingsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProcurementSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSettingsEndpoint( @@ -22,35 +17,28 @@ class ProcurementSettingsEndpoint( IGettable[list[ProcurementSetting], ConnectWiseManageRequestParams], IPaginateable[ProcurementSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "settings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "settings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProcurementSetting]) IPaginateable.__init__(self, ProcurementSetting) - self.count = self._register_child_endpoint( - ProcurementSettingsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementSettingsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementSettingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementSettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementSettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementSettingsIdEndpoint: The initialized ProcurementSettingsIdEndpoint object. """ child = ProcurementSettingsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProcurementSetting]: """ Performs a GET request against the /procurement/settings endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProcurementSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProcurementSetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProcurementSetting]: """ Performs a GET request against the /procurement/settings endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ProcurementSetting]: The parsed response data. """ - return self._parse_many( - ProcurementSetting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProcurementSetting, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSettingsIdEndpoint.py index c4097c0d9..f657d34e9 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSettingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProcurementSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSettingsIdEndpoint( ConnectWiseEndpoint, IGettable[ProcurementSetting, ConnectWiseManageRequestParams], - IPuttable[ProcurementSetting, ConnectWiseManageRequestParams], IPatchable[ProcurementSetting, ConnectWiseManageRequestParams], + IPuttable[ProcurementSetting, ConnectWiseManageRequestParams], IPaginateable[ProcurementSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProcurementSetting) - IPuttable.__init__(self, ProcurementSetting) IPatchable.__init__(self, ProcurementSetting) + IPuttable.__init__(self, ProcurementSetting) IPaginateable.__init__(self, ProcurementSetting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProcurementSetting]: """ Performs a GET request against the /procurement/settings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProcurementSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProcurementSetting, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProcurementSetting: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProcurementSetting: """ Performs a GET request against the /procurement/settings/{id} endpoint. @@ -74,18 +56,11 @@ def get( Returns: ProcurementSetting: The parsed response data. """ - return self._parse_one( - ProcurementSetting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ProcurementSetting, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProcurementSetting: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProcurementSetting: """ - Performs a PUT request against the /procurement/settings/{id} endpoint. + Performs a PATCH request against the /procurement/settings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +68,11 @@ def put( Returns: ProcurementSetting: The parsed response data. """ - return self._parse_one( - ProcurementSetting, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ProcurementSetting, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProcurementSetting: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProcurementSetting: """ - Performs a PATCH request against the /procurement/settings/{id} endpoint. + Performs a PUT request against the /procurement/settings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +80,4 @@ def patch( Returns: ProcurementSetting: The parsed response data. """ - return self._parse_one( - ProcurementSetting, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProcurementSetting, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsCountEndpoint.py index b6612329a..cab9b1dd5 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementShipmentmethodsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/shipmentmethods/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/shipmentmethods/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsEndpoint.py index c6b2b2ed3..1685ebe0a 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsEndpoint.py @@ -1,24 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsCountEndpoint import ( ProcurementShipmentmethodsCountEndpoint, ) -from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsIdEndpoint import ( - ProcurementShipmentmethodsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsInfoEndpoint import ( - ProcurementShipmentmethodsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsIdEndpoint import ProcurementShipmentmethodsIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsInfoEndpoint import ProcurementShipmentmethodsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ShipmentMethod from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsEndpoint( @@ -27,10 +21,8 @@ class ProcurementShipmentmethodsEndpoint( IPostable[ShipmentMethod, ConnectWiseManageRequestParams], IPaginateable[ShipmentMethod, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "shipmentmethods", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "shipmentmethods", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ShipmentMethod]) IPostable.__init__(self, ShipmentMethod) IPaginateable.__init__(self, ShipmentMethod) @@ -38,28 +30,23 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 self.count = self._register_child_endpoint( ProcurementShipmentmethodsCountEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ProcurementShipmentmethodsInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProcurementShipmentmethodsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementShipmentmethodsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementShipmentmethodsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementShipmentmethodsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementShipmentmethodsIdEndpoint: The initialized ProcurementShipmentmethodsIdEndpoint object. """ child = ProcurementShipmentmethodsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ShipmentMethod]: """ Performs a GET request against the /procurement/shipmentmethods endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ShipmentMethod, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ShipmentMethod, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ShipmentMethod]: """ Performs a GET request against the /procurement/shipmentmethods endpoint. @@ -99,16 +79,9 @@ def get( Returns: list[ShipmentMethod]: The parsed response data. """ - return self._parse_many( - ShipmentMethod, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ShipmentMethod, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ShipmentMethod: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ShipmentMethod: """ Performs a POST request against the /procurement/shipmentmethods endpoint. @@ -118,7 +91,4 @@ def post( Returns: ShipmentMethod: The parsed response data. """ - return self._parse_one( - ShipmentMethod, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ShipmentMethod, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdEndpoint.py index f24c683db..32e3bdd9b 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsIdInfoEndpoint import ( ProcurementShipmentmethodsIdInfoEndpoint, @@ -5,49 +7,38 @@ from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsIdUsagesEndpoint import ( ProcurementShipmentmethodsIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ShipmentMethod from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsIdEndpoint( ConnectWiseEndpoint, IGettable[ShipmentMethod, ConnectWiseManageRequestParams], - IPuttable[ShipmentMethod, ConnectWiseManageRequestParams], IPatchable[ShipmentMethod, ConnectWiseManageRequestParams], + IPuttable[ShipmentMethod, ConnectWiseManageRequestParams], IPaginateable[ShipmentMethod, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ShipmentMethod) - IPuttable.__init__(self, ShipmentMethod) IPatchable.__init__(self, ShipmentMethod) + IPuttable.__init__(self, ShipmentMethod) IPaginateable.__init__(self, ShipmentMethod) - self.usages = self._register_child_endpoint( - ProcurementShipmentmethodsIdUsagesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( ProcurementShipmentmethodsIdInfoEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint( + ProcurementShipmentmethodsIdUsagesEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ShipmentMethod]: """ Performs a GET request against the /procurement/shipmentmethods/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +56,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ShipmentMethod, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ShipmentMethod, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ShipmentMethod: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/shipmentmethods/{id} endpoint. + Performs a DELETE request against the /procurement/shipmentmethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ShipmentMethod: The parsed response data. """ - return self._parse_one( - ShipmentMethod, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ShipmentMethod: """ - Performs a DELETE request against the /procurement/shipmentmethods/{id} endpoint. + Performs a GET request against the /procurement/shipmentmethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ShipmentMethod: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ShipmentMethod, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ShipmentMethod: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ShipmentMethod: """ - Performs a PUT request against the /procurement/shipmentmethods/{id} endpoint. + Performs a PATCH request against the /procurement/shipmentmethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +91,11 @@ def put( Returns: ShipmentMethod: The parsed response data. """ - return self._parse_one( - ShipmentMethod, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ShipmentMethod, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ShipmentMethod: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ShipmentMethod: """ - Performs a PATCH request against the /procurement/shipmentmethods/{id} endpoint. + Performs a PUT request against the /procurement/shipmentmethods/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +103,4 @@ def patch( Returns: ShipmentMethod: The parsed response data. """ - return self._parse_one( - ShipmentMethod, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ShipmentMethod, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdInfoEndpoint.py index c8ff1cb13..3adbacabd 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ShipmentMethodInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementShipmentmethodsIdInfoEndpoint( IGettable[ShipmentMethodInfo, ConnectWiseManageRequestParams], IPaginateable[ShipmentMethodInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ShipmentMethodInfo) IPaginateable.__init__(self, ShipmentMethodInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ShipmentMethodInfo]: """ Performs a GET request against the /procurement/shipmentmethods/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ShipmentMethodInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ShipmentMethodInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ShipmentMethodInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ShipmentMethodInfo: """ Performs a GET request against the /procurement/shipmentmethods/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ShipmentMethodInfo: The parsed response data. """ - return self._parse_one( - ShipmentMethodInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ShipmentMethodInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesEndpoint.py index bf2597891..090e60faf 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsIdUsagesListEndpoint import ( ProcurementShipmentmethodsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ProcurementShipmentmethodsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/shipmentmethods/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/shipmentmethods/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesListEndpoint.py index f3d84f3e8..136b4f6f9 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProcurementShipmentmethodsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/shipmentmethods/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/shipmentmethods/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoCountEndpoint.py index a812c31bb..a3160575c 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementShipmentmethodsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/shipmentmethods/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/shipmentmethods/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoEndpoint.py index 5cdff14ec..c6fd57af8 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementShipmentmethodsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementShipmentmethodsInfoCountEndpoint import ( ProcurementShipmentmethodsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ShipmentMethodInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementShipmentmethodsInfoEndpoint( @@ -19,10 +18,8 @@ class ProcurementShipmentmethodsInfoEndpoint( IGettable[list[ShipmentMethodInfo], ConnectWiseManageRequestParams], IPaginateable[ShipmentMethodInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ShipmentMethodInfo]) IPaginateable.__init__(self, ShipmentMethodInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ShipmentMethodInfo]: """ Performs a GET request against the /procurement/shipmentmethods/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ShipmentMethodInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ShipmentMethodInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ShipmentMethodInfo]: """ Performs a GET request against the /procurement/shipmentmethods/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ShipmentMethodInfo]: The parsed response data. """ - return self._parse_many( - ShipmentMethodInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ShipmentMethodInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesCountEndpoint.py index 73078afb2..123b05010 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSubcategoriesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementSubcategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/subcategories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/subcategories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesEndpoint.py index 49794c8d8..0dddf428e 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesEndpoint.py @@ -1,37 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementSubcategoriesCountEndpoint import ( - ProcurementSubcategoriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementSubcategoriesIdEndpoint import ( - ProcurementSubcategoriesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementSubcategoriesInfoEndpoint import ( - ProcurementSubcategoriesInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementSubcategoriesCountEndpoint import ProcurementSubcategoriesCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementSubcategoriesIdEndpoint import ProcurementSubcategoriesIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementSubcategoriesInfoEndpoint import ProcurementSubcategoriesInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSubcategoriesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "subcategories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "subcategories", parent_endpoint=parent_endpoint) - self.count = self._register_child_endpoint( - ProcurementSubcategoriesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementSubcategoriesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementSubcategoriesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementSubcategoriesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementSubcategoriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementSubcategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementSubcategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementSubcategoriesIdEndpoint: The initialized ProcurementSubcategoriesIdEndpoint object. """ child = ProcurementSubcategoriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdEndpoint.py index 09550e2ab..329883f31 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdEndpoint.py @@ -1,53 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementSubcategoriesIdInfoEndpoint import ( - ProcurementSubcategoriesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementSubcategoriesIdInfoEndpoint import ProcurementSubcategoriesIdInfoEndpoint from pyconnectwise.endpoints.manage.ProcurementSubcategoriesIdUsagesEndpoint import ( ProcurementSubcategoriesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SubCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSubcategoriesIdEndpoint( ConnectWiseEndpoint, IGettable[SubCategory, ConnectWiseManageRequestParams], - IPuttable[SubCategory, ConnectWiseManageRequestParams], IPatchable[SubCategory, ConnectWiseManageRequestParams], + IPuttable[SubCategory, ConnectWiseManageRequestParams], IPaginateable[SubCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SubCategory) - IPuttable.__init__(self, SubCategory) IPatchable.__init__(self, SubCategory) + IPuttable.__init__(self, SubCategory) IPaginateable.__init__(self, SubCategory) + self.info = self._register_child_endpoint(ProcurementSubcategoriesIdInfoEndpoint(client, parent_endpoint=self)) self.usages = self._register_child_endpoint( ProcurementSubcategoriesIdUsagesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ProcurementSubcategoriesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SubCategory]: """ Performs a GET request against the /procurement/subcategories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +52,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SubCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SubCategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SubCategory: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/subcategories/{id} endpoint. + Performs a DELETE request against the /procurement/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SubCategory: The parsed response data. """ - return self._parse_one( - SubCategory, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SubCategory: """ - Performs a DELETE request against the /procurement/subcategories/{id} endpoint. + Performs a GET request against the /procurement/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SubCategory: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SubCategory, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SubCategory: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SubCategory: """ - Performs a PUT request against the /procurement/subcategories/{id} endpoint. + Performs a PATCH request against the /procurement/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +87,11 @@ def put( Returns: SubCategory: The parsed response data. """ - return self._parse_one( - SubCategory, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SubCategory, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SubCategory: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SubCategory: """ - Performs a PATCH request against the /procurement/subcategories/{id} endpoint. + Performs a PUT request against the /procurement/subcategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +99,4 @@ def patch( Returns: SubCategory: The parsed response data. """ - return self._parse_one( - SubCategory, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(SubCategory, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdInfoEndpoint.py index fd1d922fe..414464a03 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SubCategoryInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSubcategoriesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementSubcategoriesIdInfoEndpoint( IGettable[SubCategoryInfo, ConnectWiseManageRequestParams], IPaginateable[SubCategoryInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SubCategoryInfo) IPaginateable.__init__(self, SubCategoryInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SubCategoryInfo]: """ Performs a GET request against the /procurement/subcategories/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SubCategoryInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SubCategoryInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SubCategoryInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SubCategoryInfo: """ Performs a GET request against the /procurement/subcategories/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: SubCategoryInfo: The parsed response data. """ - return self._parse_one( - SubCategoryInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SubCategoryInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesEndpoint.py index 712110cec..e73b931b7 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementSubcategoriesIdUsagesListEndpoint import ( ProcurementSubcategoriesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSubcategoriesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ProcurementSubcategoriesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/subcategories/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/subcategories/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesListEndpoint.py index 02449c8a9..f3dd68c0d 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSubcategoriesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProcurementSubcategoriesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/subcategories/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/subcategories/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoCountEndpoint.py index f28c2e531..e45a3d0a8 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementSubcategoriesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementSubcategoriesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/subcategories/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/subcategories/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoEndpoint.py index dd23b3462..962a14dcc 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementSubcategoriesInfoEndpoint.py @@ -1,14 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementSubcategoriesInfoCountEndpoint import ( ProcurementSubcategoriesInfoCountEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ProcurementSubcategoriesInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) self.count = self._register_child_endpoint( ProcurementSubcategoriesInfoCountEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesCountEndpoint.py index 1be4e2557..2cfb50e90 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesEndpoint.py index a0b41f854..712ef8529 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementTypesCountEndpoint import ( - ProcurementTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementTypesIdEndpoint import ( - ProcurementTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementTypesInfoEndpoint import ( - ProcurementTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementTypesCountEndpoint import ProcurementTypesCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementTypesIdEndpoint import ProcurementTypesIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementTypesInfoEndpoint import ProcurementTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProductType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesEndpoint( @@ -27,39 +19,30 @@ class ProcurementTypesEndpoint( IPostable[ProductType, ConnectWiseManageRequestParams], IPaginateable[ProductType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductType]) IPostable.__init__(self, ProductType) IPaginateable.__init__(self, ProductType) - self.count = self._register_child_endpoint( - ProcurementTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementTypesIdEndpoint: The initialized ProcurementTypesIdEndpoint object. """ child = ProcurementTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductType]: """ Performs a GET request against the /procurement/types endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ProductType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ProductType]: """ Performs a GET request against the /procurement/types endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[ProductType]: The parsed response data. """ - return self._parse_many( - ProductType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ProductType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductType: """ Performs a POST request against the /procurement/types endpoint. @@ -117,6 +85,4 @@ def post( Returns: ProductType: The parsed response data. """ - return self._parse_one( - ProductType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ProductType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdEndpoint.py index 8e12d6b09..3b98d1d47 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementTypesIdInfoEndpoint import ( - ProcurementTypesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementTypesIdUsagesEndpoint import ( - ProcurementTypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProcurementTypesIdInfoEndpoint import ProcurementTypesIdInfoEndpoint +from pyconnectwise.endpoints.manage.ProcurementTypesIdUsagesEndpoint import ProcurementTypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProductType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesIdEndpoint( ConnectWiseEndpoint, IGettable[ProductType, ConnectWiseManageRequestParams], - IPuttable[ProductType, ConnectWiseManageRequestParams], IPatchable[ProductType, ConnectWiseManageRequestParams], + IPuttable[ProductType, ConnectWiseManageRequestParams], IPaginateable[ProductType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProductType) - IPuttable.__init__(self, ProductType) IPatchable.__init__(self, ProductType) + IPuttable.__init__(self, ProductType) IPaginateable.__init__(self, ProductType) - self.usages = self._register_child_endpoint( - ProcurementTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementTypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProcurementTypesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ProcurementTypesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductType]: """ Performs a GET request against the /procurement/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/types/{id} endpoint. + Performs a DELETE request against the /procurement/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProductType: The parsed response data. """ - return self._parse_one( - ProductType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductType: """ - Performs a DELETE request against the /procurement/types/{id} endpoint. + Performs a GET request against the /procurement/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProductType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProductType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProductType: """ - Performs a PUT request against the /procurement/types/{id} endpoint. + Performs a PATCH request against the /procurement/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +83,11 @@ def put( Returns: ProductType: The parsed response data. """ - return self._parse_one( - ProductType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ProductType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductType: """ - Performs a PATCH request against the /procurement/types/{id} endpoint. + Performs a PUT request against the /procurement/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +95,4 @@ def patch( Returns: ProductType: The parsed response data. """ - return self._parse_one( - ProductType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ProductType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdInfoEndpoint.py index 66c28283d..f62d7862c 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProductTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementTypesIdInfoEndpoint( IGettable[ProductTypeInfo, ConnectWiseManageRequestParams], IPaginateable[ProductTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProductTypeInfo) IPaginateable.__init__(self, ProductTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductTypeInfo]: """ Performs a GET request against the /procurement/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProductTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProductTypeInfo: """ Performs a GET request against the /procurement/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ProductTypeInfo: The parsed response data. """ - return self._parse_one( - ProductTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ProductTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesEndpoint.py index 03906d4f2..10b3bc787 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementTypesIdUsagesListEndpoint import ( - ProcurementTypesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProcurementTypesIdUsagesListEndpoint import ProcurementTypesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ProcurementTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ProcurementTypesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ProcurementTypesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/types/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesListEndpoint.py index e6651f7a9..7781a2de6 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProcurementTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /procurement/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /procurement/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoCountEndpoint.py index 84e161afe..1c1e61561 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoEndpoint.py index 2efc56d89..d5d42d596 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementTypesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementTypesInfoCountEndpoint import ( - ProcurementTypesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProcurementTypesInfoCountEndpoint import ProcurementTypesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProductTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementTypesInfoEndpoint( @@ -19,22 +16,15 @@ class ProcurementTypesInfoEndpoint( IGettable[list[ProductTypeInfo], ConnectWiseManageRequestParams], IPaginateable[ProductTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductTypeInfo]) IPaginateable.__init__(self, ProductTypeInfo) - self.count = self._register_child_endpoint( - ProcurementTypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementTypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductTypeInfo]: """ Performs a GET request against the /procurement/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductTypeInfo]: """ Performs a GET request against the /procurement/types/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ProductTypeInfo]: The parsed response data. """ - return self._parse_many( - ProductTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProductTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresCountEndpoint.py index 7093e0582..d249344c1 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementUnitofmeasuresCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementUnitofmeasuresCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/unitOfMeasures/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/unitOfMeasures/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresEndpoint.py index 1929d5b91..393d8f350 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresCountEndpoint import ( - ProcurementUnitofmeasuresCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresIdEndpoint import ( - ProcurementUnitofmeasuresIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresCountEndpoint import ProcurementUnitofmeasuresCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresIdEndpoint import ProcurementUnitofmeasuresIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import UnitOfMeasure from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementUnitofmeasuresEndpoint( @@ -24,36 +18,29 @@ class ProcurementUnitofmeasuresEndpoint( IPostable[UnitOfMeasure, ConnectWiseManageRequestParams], IPaginateable[UnitOfMeasure, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "unitOfMeasures", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "unitOfMeasures", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UnitOfMeasure]) IPostable.__init__(self, UnitOfMeasure) IPaginateable.__init__(self, UnitOfMeasure) - self.count = self._register_child_endpoint( - ProcurementUnitofmeasuresCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementUnitofmeasuresCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementUnitofmeasuresIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementUnitofmeasuresIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementUnitofmeasuresIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementUnitofmeasuresIdEndpoint: The initialized ProcurementUnitofmeasuresIdEndpoint object. """ child = ProcurementUnitofmeasuresIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnitOfMeasure]: """ Performs a GET request against the /procurement/unitOfMeasures endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnitOfMeasure, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnitOfMeasure, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UnitOfMeasure]: """ Performs a GET request against the /procurement/unitOfMeasures endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[UnitOfMeasure]: The parsed response data. """ - return self._parse_many( - UnitOfMeasure, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(UnitOfMeasure, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UnitOfMeasure: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UnitOfMeasure: """ Performs a POST request against the /procurement/unitOfMeasures endpoint. @@ -111,7 +85,4 @@ def post( Returns: UnitOfMeasure: The parsed response data. """ - return self._parse_one( - UnitOfMeasure, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(UnitOfMeasure, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsCountEndpoint.py index 743f97e67..591f53a03 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementUnitofmeasuresIdConversionsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementUnitofmeasuresIdConversionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/unitOfMeasures/{id}/conversions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/unitOfMeasures/{id}/conversions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsEndpoint.py index 4f05c0396..d1a42ca42 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresIdConversionsCountEndpoint import ( ProcurementUnitofmeasuresIdConversionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresIdConversionsIdEndpoint import ( ProcurementUnitofmeasuresIdConversionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Conversion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementUnitofmeasuresIdConversionsEndpoint( @@ -24,42 +22,31 @@ class ProcurementUnitofmeasuresIdConversionsEndpoint( IPostable[Conversion, ConnectWiseManageRequestParams], IPaginateable[Conversion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "conversions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "conversions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Conversion]) IPostable.__init__(self, Conversion) IPaginateable.__init__(self, Conversion) self.count = self._register_child_endpoint( - ProcurementUnitofmeasuresIdConversionsCountEndpoint( - client, parent_endpoint=self - ) + ProcurementUnitofmeasuresIdConversionsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementUnitofmeasuresIdConversionsIdEndpoint: + def id(self, _id: int) -> ProcurementUnitofmeasuresIdConversionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementUnitofmeasuresIdConversionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementUnitofmeasuresIdConversionsIdEndpoint: The initialized ProcurementUnitofmeasuresIdConversionsIdEndpoint object. """ - child = ProcurementUnitofmeasuresIdConversionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementUnitofmeasuresIdConversionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Conversion]: """ Performs a GET request against the /procurement/unitOfMeasures/{id}/conversions endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +63,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Conversion, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Conversion, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Conversion]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Conversion]: """ Performs a GET request against the /procurement/unitOfMeasures/{id}/conversions endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[Conversion]: The parsed response data. """ - return self._parse_many( - Conversion, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Conversion, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Conversion: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Conversion: """ Performs a POST request against the /procurement/unitOfMeasures/{id}/conversions endpoint. @@ -117,6 +87,4 @@ def post( Returns: Conversion: The parsed response data. """ - return self._parse_one( - Conversion, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Conversion, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsIdEndpoint.py index 6d41c0f4b..790463fe6 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdConversionsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Conversion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementUnitofmeasuresIdConversionsIdEndpoint( ConnectWiseEndpoint, IGettable[Conversion, ConnectWiseManageRequestParams], - IPuttable[Conversion, ConnectWiseManageRequestParams], IPatchable[Conversion, ConnectWiseManageRequestParams], + IPuttable[Conversion, ConnectWiseManageRequestParams], IPaginateable[Conversion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Conversion) - IPuttable.__init__(self, Conversion) IPatchable.__init__(self, Conversion) + IPuttable.__init__(self, Conversion) IPaginateable.__init__(self, Conversion) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Conversion]: """ Performs a GET request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Conversion, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Conversion, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Conversion: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. + Performs a DELETE request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Conversion: The parsed response data. """ - return self._parse_one( - Conversion, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Conversion: """ - Performs a DELETE request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. + Performs a GET request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Conversion: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Conversion, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Conversion: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Conversion: """ - Performs a PUT request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. + Performs a PATCH request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Conversion: The parsed response data. """ - return self._parse_one( - Conversion, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Conversion, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Conversion: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Conversion: """ - Performs a PATCH request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. + Performs a PUT request against the /procurement/unitOfMeasures/{id}/conversions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Conversion: The parsed response data. """ - return self._parse_one( - Conversion, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Conversion, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdEndpoint.py index bf08c1386..3ae575e31 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementUnitofmeasuresIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementUnitofmeasuresIdConversionsEndpoint import ( ProcurementUnitofmeasuresIdConversionsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import UnitOfMeasure from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementUnitofmeasuresIdEndpoint( ConnectWiseEndpoint, IGettable[UnitOfMeasure, ConnectWiseManageRequestParams], - IPuttable[UnitOfMeasure, ConnectWiseManageRequestParams], IPatchable[UnitOfMeasure, ConnectWiseManageRequestParams], + IPuttable[UnitOfMeasure, ConnectWiseManageRequestParams], IPaginateable[UnitOfMeasure, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UnitOfMeasure) - IPuttable.__init__(self, UnitOfMeasure) IPatchable.__init__(self, UnitOfMeasure) + IPuttable.__init__(self, UnitOfMeasure) IPaginateable.__init__(self, UnitOfMeasure) self.conversions = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UnitOfMeasure]: """ Performs a GET request against the /procurement/unitOfMeasures/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UnitOfMeasure, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UnitOfMeasure, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UnitOfMeasure: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/unitOfMeasures/{id} endpoint. + Performs a DELETE request against the /procurement/unitOfMeasures/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - UnitOfMeasure: The parsed response data. """ - return self._parse_one( - UnitOfMeasure, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UnitOfMeasure: """ - Performs a DELETE request against the /procurement/unitOfMeasures/{id} endpoint. + Performs a GET request against the /procurement/unitOfMeasures/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + UnitOfMeasure: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(UnitOfMeasure, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UnitOfMeasure: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> UnitOfMeasure: """ - Performs a PUT request against the /procurement/unitOfMeasures/{id} endpoint. + Performs a PATCH request against the /procurement/unitOfMeasures/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +85,11 @@ def put( Returns: UnitOfMeasure: The parsed response data. """ - return self._parse_one( - UnitOfMeasure, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(UnitOfMeasure, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> UnitOfMeasure: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UnitOfMeasure: """ - Performs a PATCH request against the /procurement/unitOfMeasures/{id} endpoint. + Performs a PUT request against the /procurement/unitOfMeasures/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +97,4 @@ def patch( Returns: UnitOfMeasure: The parsed response data. """ - return self._parse_one( - UnitOfMeasure, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(UnitOfMeasure, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsCountEndpoint.py index 15ea1928a..df1911d6d 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousebinsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/warehouseBins/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/warehouseBins/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsEndpoint.py index 1edcb9e60..22a2347a2 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementWarehousebinsCountEndpoint import ( - ProcurementWarehousebinsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementWarehousebinsIdEndpoint import ( - ProcurementWarehousebinsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementWarehousebinsInfoEndpoint import ( - ProcurementWarehousebinsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementWarehousebinsCountEndpoint import ProcurementWarehousebinsCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementWarehousebinsIdEndpoint import ProcurementWarehousebinsIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementWarehousebinsInfoEndpoint import ProcurementWarehousebinsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WarehouseBin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsEndpoint( @@ -27,39 +19,30 @@ class ProcurementWarehousebinsEndpoint( IPostable[WarehouseBin, ConnectWiseManageRequestParams], IPaginateable[WarehouseBin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "warehouseBins", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "warehouseBins", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WarehouseBin]) IPostable.__init__(self, WarehouseBin) IPaginateable.__init__(self, WarehouseBin) - self.count = self._register_child_endpoint( - ProcurementWarehousebinsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementWarehousebinsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementWarehousebinsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementWarehousebinsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementWarehousebinsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementWarehousebinsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementWarehousebinsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementWarehousebinsIdEndpoint: The initialized ProcurementWarehousebinsIdEndpoint object. """ child = ProcurementWarehousebinsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WarehouseBin]: """ Performs a GET request against the /procurement/warehouseBins endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WarehouseBin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WarehouseBin, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[WarehouseBin]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[WarehouseBin]: """ Performs a GET request against the /procurement/warehouseBins endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[WarehouseBin]: The parsed response data. """ - return self._parse_many( - WarehouseBin, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(WarehouseBin, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WarehouseBin: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WarehouseBin: """ Performs a POST request against the /procurement/warehouseBins endpoint. @@ -117,6 +85,4 @@ def post( Returns: WarehouseBin: The parsed response data. """ - return self._parse_one( - WarehouseBin, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(WarehouseBin, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdEndpoint.py index 44f1cbd33..da24d9937 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdEndpoint.py @@ -1,55 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementWarehousebinsIdInfoEndpoint import ( - ProcurementWarehousebinsIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ProcurementWarehousebinsIdInfoEndpoint import ProcurementWarehousebinsIdInfoEndpoint from pyconnectwise.endpoints.manage.ProcurementWarehousebinsIdInventoryonhandEndpoint import ( ProcurementWarehousebinsIdInventoryonhandEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WarehouseBin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsIdEndpoint( ConnectWiseEndpoint, IGettable[WarehouseBin, ConnectWiseManageRequestParams], - IPuttable[WarehouseBin, ConnectWiseManageRequestParams], IPatchable[WarehouseBin, ConnectWiseManageRequestParams], + IPuttable[WarehouseBin, ConnectWiseManageRequestParams], IPaginateable[WarehouseBin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WarehouseBin) - IPuttable.__init__(self, WarehouseBin) IPatchable.__init__(self, WarehouseBin) + IPuttable.__init__(self, WarehouseBin) IPaginateable.__init__(self, WarehouseBin) + self.info = self._register_child_endpoint(ProcurementWarehousebinsIdInfoEndpoint(client, parent_endpoint=self)) self.inventory_on_hand = self._register_child_endpoint( - ProcurementWarehousebinsIdInventoryonhandEndpoint( - client, parent_endpoint=self - ) - ) - self.info = self._register_child_endpoint( - ProcurementWarehousebinsIdInfoEndpoint(client, parent_endpoint=self) + ProcurementWarehousebinsIdInventoryonhandEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WarehouseBin]: """ Performs a GET request against the /procurement/warehouseBins/{id} endpoint and returns an initialized PaginatedResponse object. @@ -67,53 +52,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WarehouseBin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WarehouseBin, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WarehouseBin: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/warehouseBins/{id} endpoint. + Performs a DELETE request against the /procurement/warehouseBins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WarehouseBin: The parsed response data. """ - return self._parse_one( - WarehouseBin, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WarehouseBin: """ - Performs a DELETE request against the /procurement/warehouseBins/{id} endpoint. + Performs a GET request against the /procurement/warehouseBins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WarehouseBin: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(WarehouseBin, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WarehouseBin: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> WarehouseBin: """ - Performs a PUT request against the /procurement/warehouseBins/{id} endpoint. + Performs a PATCH request against the /procurement/warehouseBins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -121,17 +87,11 @@ def put( Returns: WarehouseBin: The parsed response data. """ - return self._parse_one( - WarehouseBin, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(WarehouseBin, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> WarehouseBin: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WarehouseBin: """ - Performs a PATCH request against the /procurement/warehouseBins/{id} endpoint. + Performs a PUT request against the /procurement/warehouseBins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +99,4 @@ def patch( Returns: WarehouseBin: The parsed response data. """ - return self._parse_one( - WarehouseBin, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(WarehouseBin, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInfoEndpoint.py index c8c9d9f8c..b5228a9cb 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WarehouseBinInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousebinsIdInfoEndpoint( IGettable[WarehouseBinInfo, ConnectWiseManageRequestParams], IPaginateable[WarehouseBinInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, WarehouseBinInfo) IPaginateable.__init__(self, WarehouseBinInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WarehouseBinInfo]: """ Performs a GET request against the /procurement/warehouseBins/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WarehouseBinInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WarehouseBinInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WarehouseBinInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WarehouseBinInfo: """ Performs a GET request against the /procurement/warehouseBins/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: WarehouseBinInfo: The parsed response data. """ - return self._parse_one( - WarehouseBinInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(WarehouseBinInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandCountEndpoint.py index 30cc2b600..e3545c9ef 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsIdInventoryonhandCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousebinsIdInventoryonhandCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/warehouseBins/{id}/inventoryOnHand/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/warehouseBins/{id}/inventoryOnHand/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandEndpoint.py index a023d97ee..8396511ff 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementWarehousebinsIdInventoryonhandCountEndpoint import ( ProcurementWarehousebinsIdInventoryonhandCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.ProcurementWarehousebinsIdInventoryonhandIdEndpoint import ( ProcurementWarehousebinsIdInventoryonhandIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InventoryOnHand from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsIdInventoryonhandEndpoint( @@ -22,41 +21,30 @@ class ProcurementWarehousebinsIdInventoryonhandEndpoint( IGettable[list[InventoryOnHand], ConnectWiseManageRequestParams], IPaginateable[InventoryOnHand, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "inventoryOnHand", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "inventoryOnHand", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InventoryOnHand]) IPaginateable.__init__(self, InventoryOnHand) self.count = self._register_child_endpoint( - ProcurementWarehousebinsIdInventoryonhandCountEndpoint( - client, parent_endpoint=self - ) + ProcurementWarehousebinsIdInventoryonhandCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProcurementWarehousebinsIdInventoryonhandIdEndpoint: + def id(self, _id: int) -> ProcurementWarehousebinsIdInventoryonhandIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementWarehousebinsIdInventoryonhandIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementWarehousebinsIdInventoryonhandIdEndpoint: The initialized ProcurementWarehousebinsIdInventoryonhandIdEndpoint object. """ - child = ProcurementWarehousebinsIdInventoryonhandIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProcurementWarehousebinsIdInventoryonhandIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InventoryOnHand]: """ Performs a GET request against the /procurement/warehouseBins/{id}/inventoryOnHand endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InventoryOnHand, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InventoryOnHand, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[InventoryOnHand]: """ Performs a GET request against the /procurement/warehouseBins/{id}/inventoryOnHand endpoint. @@ -96,7 +77,4 @@ def get( Returns: list[InventoryOnHand]: The parsed response data. """ - return self._parse_many( - InventoryOnHand, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(InventoryOnHand, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandIdEndpoint.py index 383ec0494..8d6fec9e3 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsIdInventoryonhandIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InventoryOnHand from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsIdInventoryonhandIdEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousebinsIdInventoryonhandIdEndpoint( IGettable[InventoryOnHand, ConnectWiseManageRequestParams], IPaginateable[InventoryOnHand, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, InventoryOnHand) IPaginateable.__init__(self, InventoryOnHand) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InventoryOnHand]: """ Performs a GET request against the /procurement/warehouseBins/{id}/inventoryOnHand/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InventoryOnHand, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InventoryOnHand, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InventoryOnHand: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InventoryOnHand: """ Performs a GET request against the /procurement/warehouseBins/{id}/inventoryOnHand/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: InventoryOnHand: The parsed response data. """ - return self._parse_one( - InventoryOnHand, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(InventoryOnHand, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoCountEndpoint.py index 4d77e23eb..cd9931404 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousebinsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/warehouseBins/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/warehouseBins/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoEndpoint.py index 7a2769d4e..702392fcc 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousebinsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProcurementWarehousebinsInfoCountEndpoint import ( ProcurementWarehousebinsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WarehouseBinInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousebinsInfoEndpoint( @@ -19,10 +18,8 @@ class ProcurementWarehousebinsInfoEndpoint( IGettable[list[WarehouseBinInfo], ConnectWiseManageRequestParams], IPaginateable[WarehouseBinInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WarehouseBinInfo]) IPaginateable.__init__(self, WarehouseBinInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WarehouseBinInfo]: """ Performs a GET request against the /procurement/warehouseBins/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WarehouseBinInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WarehouseBinInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WarehouseBinInfo]: """ Performs a GET request against the /procurement/warehouseBins/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[WarehouseBinInfo]: The parsed response data. """ - return self._parse_many( - WarehouseBinInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WarehouseBinInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesCountEndpoint.py index f36f666a1..c27a561f2 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousesCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/warehouses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/warehouses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesEndpoint.py index 581669866..6f0a9fce6 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementWarehousesCountEndpoint import ( - ProcurementWarehousesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementWarehousesIdEndpoint import ( - ProcurementWarehousesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProcurementWarehousesInfoEndpoint import ( - ProcurementWarehousesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProcurementWarehousesCountEndpoint import ProcurementWarehousesCountEndpoint +from pyconnectwise.endpoints.manage.ProcurementWarehousesIdEndpoint import ProcurementWarehousesIdEndpoint +from pyconnectwise.endpoints.manage.ProcurementWarehousesInfoEndpoint import ProcurementWarehousesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Warehouse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousesEndpoint( @@ -27,39 +19,30 @@ class ProcurementWarehousesEndpoint( IPostable[Warehouse, ConnectWiseManageRequestParams], IPaginateable[Warehouse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "warehouses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "warehouses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Warehouse]) IPostable.__init__(self, Warehouse) IPaginateable.__init__(self, Warehouse) - self.count = self._register_child_endpoint( - ProcurementWarehousesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProcurementWarehousesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementWarehousesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProcurementWarehousesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProcurementWarehousesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProcurementWarehousesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProcurementWarehousesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProcurementWarehousesIdEndpoint: The initialized ProcurementWarehousesIdEndpoint object. """ child = ProcurementWarehousesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Warehouse]: """ Performs a GET request against the /procurement/warehouses endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Warehouse, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Warehouse, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Warehouse]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Warehouse]: """ Performs a GET request against the /procurement/warehouses endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Warehouse]: The parsed response data. """ - return self._parse_many( - Warehouse, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Warehouse, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Warehouse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Warehouse: """ Performs a POST request against the /procurement/warehouses endpoint. @@ -117,6 +83,4 @@ def post( Returns: Warehouse: The parsed response data. """ - return self._parse_one( - Warehouse, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Warehouse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdEndpoint.py index 2e0bcc91f..88b8364fb 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementWarehousesIdInfoEndpoint import ( - ProcurementWarehousesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProcurementWarehousesIdInfoEndpoint import ProcurementWarehousesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Warehouse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousesIdEndpoint( ConnectWiseEndpoint, IGettable[Warehouse, ConnectWiseManageRequestParams], - IPuttable[Warehouse, ConnectWiseManageRequestParams], IPatchable[Warehouse, ConnectWiseManageRequestParams], + IPuttable[Warehouse, ConnectWiseManageRequestParams], IPaginateable[Warehouse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Warehouse) - IPuttable.__init__(self, Warehouse) IPatchable.__init__(self, Warehouse) + IPuttable.__init__(self, Warehouse) IPaginateable.__init__(self, Warehouse) - self.info = self._register_child_endpoint( - ProcurementWarehousesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProcurementWarehousesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Warehouse]: """ Performs a GET request against the /procurement/warehouses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Warehouse, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Warehouse, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Warehouse: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /procurement/warehouses/{id} endpoint. + Performs a DELETE request against the /procurement/warehouses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Warehouse: The parsed response data. """ - return self._parse_one( - Warehouse, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Warehouse: """ - Performs a DELETE request against the /procurement/warehouses/{id} endpoint. + Performs a GET request against the /procurement/warehouses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Warehouse: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Warehouse, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Warehouse: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Warehouse: """ - Performs a PUT request against the /procurement/warehouses/{id} endpoint. + Performs a PATCH request against the /procurement/warehouses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: Warehouse: The parsed response data. """ - return self._parse_one( - Warehouse, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Warehouse, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Warehouse: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Warehouse: """ - Performs a PATCH request against the /procurement/warehouses/{id} endpoint. + Performs a PUT request against the /procurement/warehouses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: Warehouse: The parsed response data. """ - return self._parse_one( - Warehouse, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Warehouse, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdInfoEndpoint.py index 6babe4d64..51b731ddb 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WarehouseInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousesIdInfoEndpoint( IGettable[WarehouseInfo, ConnectWiseManageRequestParams], IPaginateable[WarehouseInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, WarehouseInfo) IPaginateable.__init__(self, WarehouseInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WarehouseInfo]: """ Performs a GET request against the /procurement/warehouses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WarehouseInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WarehouseInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WarehouseInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WarehouseInfo: """ Performs a GET request against the /procurement/warehouses/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: WarehouseInfo: The parsed response data. """ - return self._parse_one( - WarehouseInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(WarehouseInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoCountEndpoint.py index 2347a51b2..b1ae7d888 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProcurementWarehousesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /procurement/warehouses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /procurement/warehouses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoEndpoint.py index 92c0541e1..f1ea738a1 100644 --- a/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProcurementWarehousesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProcurementWarehousesInfoCountEndpoint import ( - ProcurementWarehousesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProcurementWarehousesInfoCountEndpoint import ProcurementWarehousesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WarehouseInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProcurementWarehousesInfoEndpoint( @@ -19,22 +16,15 @@ class ProcurementWarehousesInfoEndpoint( IGettable[list[WarehouseInfo], ConnectWiseManageRequestParams], IPaginateable[WarehouseInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WarehouseInfo]) IPaginateable.__init__(self, WarehouseInfo) - self.count = self._register_child_endpoint( - ProcurementWarehousesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProcurementWarehousesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WarehouseInfo]: """ Performs a GET request against the /procurement/warehouses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WarehouseInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WarehouseInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WarehouseInfo]: """ Performs a GET request against the /procurement/warehouses/info endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[WarehouseInfo]: The parsed response data. """ - return self._parse_many( - WarehouseInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(WarehouseInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBillingratesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBillingratesEndpoint.py index 75abc47e4..63cfa08f7 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBillingratesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBillingratesEndpoint.py @@ -6,9 +6,7 @@ class ProjectBillingratesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingRates", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "billingRates", parent_endpoint=parent_endpoint) def id(self, id: int) -> ProjectBillingratesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesEndpoint.py index d70a1e1b7..4adabae1c 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesEndpoint.py @@ -6,9 +6,7 @@ class ProjectBillingratesIdBillingratesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingRates", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "billingRates", parent_endpoint=parent_endpoint) def id(self, id: int) -> ProjectBillingratesIdBillingratesIdEndpoint: # noqa: A002 """ @@ -19,8 +17,6 @@ def id(self, id: int) -> ProjectBillingratesIdBillingratesIdEndpoint: # noqa: A Returns: ProjectBillingratesIdBillingratesIdEndpoint: The initialized ProjectBillingratesIdBillingratesIdEndpoint object. """ - child = ProjectBillingratesIdBillingratesIdEndpoint( - self.client, parent_endpoint=self - ) + child = ProjectBillingratesIdBillingratesIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesIdEndpoint.py index 02ba3993d..c090773ac 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdBillingratesIdEndpoint.py @@ -13,9 +13,7 @@ class ProjectBillingratesIdBillingratesIdEndpoint( ConnectWiseEndpoint, IPatchable[ProjectBillingRate, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPatchable.__init__(self, ProjectBillingRate) def patch( diff --git a/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdEndpoint.py index 393bb8ca6..89720c1f9 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBillingratesIdEndpoint.py @@ -6,9 +6,7 @@ class ProjectBillingratesIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.billing_rates = self._register_child_endpoint( ProjectBillingratesIdBillingratesEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsEndpoint.py index 4d995317f..3efd39d24 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectBoardsIdEndpoint import ( - ProjectBoardsIdEndpoint, -) +from pyconnectwise.endpoints.manage.ProjectBoardsIdEndpoint import ProjectBoardsIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "boards", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "boards", parent_endpoint=parent_endpoint) - def id(self, id: int) -> ProjectBoardsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectBoardsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectBoardsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectBoardsIdEndpoint: The initialized ProjectBoardsIdEndpoint object. """ child = ProjectBoardsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdEndpoint.py index 684f2b565..31606b415 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsEndpoint import ( - ProjectBoardsIdTeamsEndpoint, -) +from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsEndpoint import ProjectBoardsIdTeamsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - - self.teams = self._register_child_endpoint( - ProjectBoardsIdTeamsEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + + self.teams = self._register_child_endpoint(ProjectBoardsIdTeamsEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsCountEndpoint.py index 28b0ace3d..f52d61659 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectBoardsIdTeamsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/boards/{id}/teams/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/boards/{id}/teams/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsEndpoint.py index c6aa6dcab..8545479e7 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsCountEndpoint import ( - ProjectBoardsIdTeamsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdEndpoint import ( - ProjectBoardsIdTeamsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsInfoEndpoint import ( - ProjectBoardsIdTeamsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsCountEndpoint import ProjectBoardsIdTeamsCountEndpoint +from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdEndpoint import ProjectBoardsIdTeamsIdEndpoint +from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsInfoEndpoint import ProjectBoardsIdTeamsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectBoardTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsEndpoint( @@ -27,39 +19,30 @@ class ProjectBoardsIdTeamsEndpoint( IPostable[ProjectBoardTeam, ConnectWiseManageRequestParams], IPaginateable[ProjectBoardTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "teams", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "teams", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectBoardTeam]) IPostable.__init__(self, ProjectBoardTeam) IPaginateable.__init__(self, ProjectBoardTeam) - self.count = self._register_child_endpoint( - ProjectBoardsIdTeamsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProjectBoardsIdTeamsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectBoardsIdTeamsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProjectBoardsIdTeamsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectBoardsIdTeamsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectBoardsIdTeamsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectBoardsIdTeamsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectBoardsIdTeamsIdEndpoint: The initialized ProjectBoardsIdTeamsIdEndpoint object. """ child = ProjectBoardsIdTeamsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectBoardTeam]: """ Performs a GET request against the /project/boards/{id}/teams endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectBoardTeam, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectBoardTeam, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectBoardTeam]: """ Performs a GET request against the /project/boards/{id}/teams endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[ProjectBoardTeam]: The parsed response data. """ - return self._parse_many( - ProjectBoardTeam, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectBoardTeam, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectBoardTeam: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectBoardTeam: """ Performs a POST request against the /project/boards/{id}/teams endpoint. @@ -118,7 +87,4 @@ def post( Returns: ProjectBoardTeam: The parsed response data. """ - return self._parse_one( - ProjectBoardTeam, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProjectBoardTeam, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdEndpoint.py index 2cb849a5e..7ee8be6a6 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdEndpoint.py @@ -1,53 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdInfoEndpoint import ( - ProjectBoardsIdTeamsIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdMembersEndpoint import ( - ProjectBoardsIdTeamsIdMembersEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdInfoEndpoint import ProjectBoardsIdTeamsIdInfoEndpoint +from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdMembersEndpoint import ProjectBoardsIdTeamsIdMembersEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectBoardTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectBoardTeam, ConnectWiseManageRequestParams], - IPuttable[ProjectBoardTeam, ConnectWiseManageRequestParams], IPatchable[ProjectBoardTeam, ConnectWiseManageRequestParams], + IPuttable[ProjectBoardTeam, ConnectWiseManageRequestParams], IPaginateable[ProjectBoardTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectBoardTeam) - IPuttable.__init__(self, ProjectBoardTeam) IPatchable.__init__(self, ProjectBoardTeam) + IPuttable.__init__(self, ProjectBoardTeam) IPaginateable.__init__(self, ProjectBoardTeam) + self.info = self._register_child_endpoint(ProjectBoardsIdTeamsIdInfoEndpoint(client, parent_endpoint=self)) self.members = self._register_child_endpoint( ProjectBoardsIdTeamsIdMembersEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ProjectBoardsIdTeamsIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectBoardTeam]: """ Performs a GET request against the /project/boards/{id}/teams/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectBoardTeam, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectBoardTeam, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectBoardTeam: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/boards/{id}/teams/{id} endpoint. + Performs a DELETE request against the /project/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectBoardTeam: The parsed response data. """ - return self._parse_one( - ProjectBoardTeam, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectBoardTeam: """ - Performs a DELETE request against the /project/boards/{id}/teams/{id} endpoint. + Performs a GET request against the /project/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectBoardTeam: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectBoardTeam, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectBoardTeam: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProjectBoardTeam: """ - Performs a PUT request against the /project/boards/{id}/teams/{id} endpoint. + Performs a PATCH request against the /project/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +85,11 @@ def put( Returns: ProjectBoardTeam: The parsed response data. """ - return self._parse_one( - ProjectBoardTeam, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ProjectBoardTeam, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectBoardTeam: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectBoardTeam: """ - Performs a PATCH request against the /project/boards/{id}/teams/{id} endpoint. + Performs a PUT request against the /project/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +97,4 @@ def patch( Returns: ProjectBoardTeam: The parsed response data. """ - return self._parse_one( - ProjectBoardTeam, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProjectBoardTeam, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoCountEndpoint.py index 5dc6b4058..2de1e83ae 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsIdInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProjectBoardsIdTeamsIdInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/boards/{id}/teams/{id}/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/boards/{id}/teams/{id}/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoEndpoint.py index 64039db4d..2782e067e 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdInfoCountEndpoint import ( ProjectBoardsIdTeamsIdInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectBoardTeamInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsIdInfoEndpoint( @@ -19,10 +18,8 @@ class ProjectBoardsIdTeamsIdInfoEndpoint( IGettable[ProjectBoardTeamInfo, ConnectWiseManageRequestParams], IPaginateable[ProjectBoardTeamInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectBoardTeamInfo) IPaginateable.__init__(self, ProjectBoardTeamInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectBoardTeamInfo]: """ Performs a GET request against the /project/boards/{id}/teams/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectBoardTeamInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectBoardTeamInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProjectBoardTeamInfo: """ Performs a GET request against the /project/boards/{id}/teams/{id}/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: ProjectBoardTeamInfo: The parsed response data. """ - return self._parse_one( - ProjectBoardTeamInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ProjectBoardTeamInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersEndpoint.py index 1fb5a86b0..1b8e5c08a 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersEndpoint.py @@ -1,18 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectBoardsIdTeamsIdMembersIdEndpoint import ( ProjectBoardsIdTeamsIdMembersIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectBoardTeamMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsIdMembersEndpoint( @@ -21,34 +19,27 @@ class ProjectBoardsIdTeamsIdMembersEndpoint( IPostable[ProjectBoardTeamMember, ConnectWiseManageRequestParams], IPaginateable[ProjectBoardTeamMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "members", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "members", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectBoardTeamMember]) IPostable.__init__(self, ProjectBoardTeamMember) IPaginateable.__init__(self, ProjectBoardTeamMember) - def id(self, id: int) -> ProjectBoardsIdTeamsIdMembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectBoardsIdTeamsIdMembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectBoardsIdTeamsIdMembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectBoardsIdTeamsIdMembersIdEndpoint: The initialized ProjectBoardsIdTeamsIdMembersIdEndpoint object. """ - child = ProjectBoardsIdTeamsIdMembersIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProjectBoardsIdTeamsIdMembersIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectBoardTeamMember]: """ Performs a GET request against the /project/boards/{id}/teams/{id}/members endpoint and returns an initialized PaginatedResponse object. @@ -66,18 +57,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectBoardTeamMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectBoardTeamMember, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectBoardTeamMember]: """ Performs a GET request against the /project/boards/{id}/teams/{id}/members endpoint. @@ -88,15 +72,10 @@ def get( Returns: list[ProjectBoardTeamMember]: The parsed response data. """ - return self._parse_many( - ProjectBoardTeamMember, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectBoardTeamMember, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProjectBoardTeamMember: """ Performs a POST request against the /project/boards/{id}/teams/{id}/members endpoint. @@ -107,7 +86,4 @@ def post( Returns: ProjectBoardTeamMember: The parsed response data. """ - return self._parse_one( - ProjectBoardTeamMember, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProjectBoardTeamMember, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersIdEndpoint.py index 89c4ff5d5..167b185be 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsIdMembersIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectBoardTeamMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsIdMembersIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectBoardTeamMember, ConnectWiseManageRequestParams], - IPuttable[ProjectBoardTeamMember, ConnectWiseManageRequestParams], IPatchable[ProjectBoardTeamMember, ConnectWiseManageRequestParams], + IPuttable[ProjectBoardTeamMember, ConnectWiseManageRequestParams], IPaginateable[ProjectBoardTeamMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectBoardTeamMember) - IPuttable.__init__(self, ProjectBoardTeamMember) IPatchable.__init__(self, ProjectBoardTeamMember) + IPuttable.__init__(self, ProjectBoardTeamMember) IPaginateable.__init__(self, ProjectBoardTeamMember) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectBoardTeamMember]: """ Performs a GET request against the /project/boards/{id}/teams/{id}/members/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectBoardTeamMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectBoardTeamMember, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectBoardTeamMember: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. + Performs a DELETE request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectBoardTeamMember: The parsed response data. """ - return self._parse_one( - ProjectBoardTeamMember, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ProjectBoardTeamMember: """ - Performs a DELETE request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. + Performs a GET request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectBoardTeamMember: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectBoardTeamMember, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ProjectBoardTeamMember: """ - Performs a PUT request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. + Performs a PATCH request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: ProjectBoardTeamMember: The parsed response data. """ - return self._parse_one( - ProjectBoardTeamMember, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ProjectBoardTeamMember, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProjectBoardTeamMember: """ - Performs a PATCH request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. + Performs a PUT request against the /project/boards/{id}/teams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: ProjectBoardTeamMember: The parsed response data. """ - return self._parse_one( - ProjectBoardTeamMember, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProjectBoardTeamMember, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsInfoEndpoint.py index 46a1a6464..b45dd9170 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectBoardsIdTeamsInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectBoardTeamInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectBoardsIdTeamsInfoEndpoint( @@ -16,18 +15,13 @@ class ProjectBoardsIdTeamsInfoEndpoint( IGettable[list[ProjectBoardTeamInfo], ConnectWiseManageRequestParams], IPaginateable[ProjectBoardTeamInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectBoardTeamInfo]) IPaginateable.__init__(self, ProjectBoardTeamInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectBoardTeamInfo]: """ Performs a GET request against the /project/boards/{id}/teams/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectBoardTeamInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectBoardTeamInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectBoardTeamInfo]: """ Performs a GET request against the /project/boards/{id}/teams/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[ProjectBoardTeamInfo]: The parsed response data. """ - return self._parse_many( - ProjectBoardTeamInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectBoardTeamInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectEndpoint.py index 132d0afda..5666c3ff3 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectEndpoint.py @@ -1,85 +1,32 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectBillingratesEndpoint import ( - ProjectBillingratesEndpoint, -) from pyconnectwise.endpoints.manage.ProjectBoardsEndpoint import ProjectBoardsEndpoint -from pyconnectwise.endpoints.manage.ProjectIdEndpoint import ProjectIdEndpoint -from pyconnectwise.endpoints.manage.ProjectPhasestatusesEndpoint import ( - ProjectPhasestatusesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsEndpoint import ( - ProjectProjectsEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjecttemplatesEndpoint import ( - ProjectProjecttemplatesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjecttypesEndpoint import ( - ProjectProjecttypesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectSecurityrolesEndpoint import ( - ProjectSecurityrolesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectStatusesEndpoint import ( - ProjectStatusesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectStatusindicatorsEndpoint import ( - ProjectStatusindicatorsEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketnoteEndpoint import ( - ProjectTicketnoteEndpoint, -) +from pyconnectwise.endpoints.manage.ProjectPhasestatusesEndpoint import ProjectPhasestatusesEndpoint +from pyconnectwise.endpoints.manage.ProjectProjectsEndpoint import ProjectProjectsEndpoint +from pyconnectwise.endpoints.manage.ProjectProjecttypesEndpoint import ProjectProjecttypesEndpoint +from pyconnectwise.endpoints.manage.ProjectSecurityrolesEndpoint import ProjectSecurityrolesEndpoint +from pyconnectwise.endpoints.manage.ProjectStatusesEndpoint import ProjectStatusesEndpoint +from pyconnectwise.endpoints.manage.ProjectStatusindicatorsEndpoint import ProjectStatusindicatorsEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketnoteEndpoint import ProjectTicketnoteEndpoint from pyconnectwise.endpoints.manage.ProjectTicketsEndpoint import ProjectTicketsEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ProjectEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "project", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "project", parent_endpoint=parent_endpoint) - self.phase_statuses = self._register_child_endpoint( - ProjectPhasestatusesEndpoint(client, parent_endpoint=self) - ) - self.security_roles = self._register_child_endpoint( - ProjectSecurityrolesEndpoint(client, parent_endpoint=self) - ) - self.billing_rates = self._register_child_endpoint( - ProjectBillingratesEndpoint(client, parent_endpoint=self) - ) - self.statuses = self._register_child_endpoint( - ProjectStatusesEndpoint(client, parent_endpoint=self) - ) - self.ticket_note = self._register_child_endpoint( - ProjectTicketnoteEndpoint(client, parent_endpoint=self) - ) + self.boards = self._register_child_endpoint(ProjectBoardsEndpoint(client, parent_endpoint=self)) + self.phase_statuses = self._register_child_endpoint(ProjectPhasestatusesEndpoint(client, parent_endpoint=self)) + self.project_types = self._register_child_endpoint(ProjectProjecttypesEndpoint(client, parent_endpoint=self)) + self.projects = self._register_child_endpoint(ProjectProjectsEndpoint(client, parent_endpoint=self)) + self.security_roles = self._register_child_endpoint(ProjectSecurityrolesEndpoint(client, parent_endpoint=self)) self.status_indicators = self._register_child_endpoint( ProjectStatusindicatorsEndpoint(client, parent_endpoint=self) ) - self.project_types = self._register_child_endpoint( - ProjectProjecttypesEndpoint(client, parent_endpoint=self) - ) - self.boards = self._register_child_endpoint( - ProjectBoardsEndpoint(client, parent_endpoint=self) - ) - self.project_templates = self._register_child_endpoint( - ProjectProjecttemplatesEndpoint(client, parent_endpoint=self) - ) - self.projects = self._register_child_endpoint( - ProjectProjectsEndpoint(client, parent_endpoint=self) - ) - self.tickets = self._register_child_endpoint( - ProjectTicketsEndpoint(client, parent_endpoint=self) - ) - - def id(self, id: int) -> ProjectIdEndpoint: # noqa: A002 - """ - Sets the ID for this endpoint and returns an initialized ProjectIdEndpoint object to move down the chain. - - Parameters: - id (int): The ID to set. - Returns: - ProjectIdEndpoint: The initialized ProjectIdEndpoint object. - """ - child = ProjectIdEndpoint(self.client, parent_endpoint=self) - child._id = id - return child + self.statuses = self._register_child_endpoint(ProjectStatusesEndpoint(client, parent_endpoint=self)) + self.ticket_note = self._register_child_endpoint(ProjectTicketnoteEndpoint(client, parent_endpoint=self)) + self.tickets = self._register_child_endpoint(ProjectTicketsEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesCountEndpoint.py index bab936e11..76c72ef75 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesCountEndpoint.py @@ -17,9 +17,7 @@ class ProjectIdBillingratesCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesEndpoint.py index de7e5bd07..a1d8406f9 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesEndpoint.py @@ -25,16 +25,12 @@ class ProjectIdBillingratesEndpoint( IPaginateable[ProjectBillingRate, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "billingRates", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "billingRates", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectBillingRate]) IPostable.__init__(self, ProjectBillingRate) IPaginateable.__init__(self, ProjectBillingRate) - self.count = self._register_child_endpoint( - ProjectIdBillingratesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectIdBillingratesCountEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> ProjectIdBillingratesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesIdEndpoint.py index 8eb6cbac8..d3eec6c3f 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectIdBillingratesIdEndpoint.py @@ -19,9 +19,7 @@ class ProjectIdBillingratesIdEndpoint( IPaginateable[ProjectBillingRate, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectBillingRate) IPuttable.__init__(self, ProjectBillingRate) IPaginateable.__init__(self, ProjectBillingRate) diff --git a/src/pyconnectwise/endpoints/manage/ProjectIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectIdEndpoint.py index 940a84b4f..5bf0b766d 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectIdEndpoint.py @@ -6,10 +6,6 @@ class ProjectIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.billing_rates = self._register_child_endpoint( - ProjectIdBillingratesEndpoint(client, parent_endpoint=self) - ) + self.billing_rates = self._register_child_endpoint(ProjectIdBillingratesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesCountEndpoint.py index da2cd8e68..b16f030d0 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectPhasestatusesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectPhasestatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/phaseStatuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/phaseStatuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesEndpoint.py index b93936aee..2aaa0b363 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectPhasestatusesCountEndpoint import ( - ProjectPhasestatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectPhasestatusesIdEndpoint import ( - ProjectPhasestatusesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectPhasestatusesCountEndpoint import ProjectPhasestatusesCountEndpoint +from pyconnectwise.endpoints.manage.ProjectPhasestatusesIdEndpoint import ProjectPhasestatusesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PhaseStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectPhasestatusesEndpoint( @@ -24,36 +18,29 @@ class ProjectPhasestatusesEndpoint( IPostable[PhaseStatus, ConnectWiseManageRequestParams], IPaginateable[PhaseStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "phaseStatuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "phaseStatuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PhaseStatus]) IPostable.__init__(self, PhaseStatus) IPaginateable.__init__(self, PhaseStatus) - self.count = self._register_child_endpoint( - ProjectPhasestatusesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectPhasestatusesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectPhasestatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectPhasestatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectPhasestatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectPhasestatusesIdEndpoint: The initialized ProjectPhasestatusesIdEndpoint object. """ child = ProjectPhasestatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PhaseStatus]: """ Performs a GET request against the /project/phaseStatuses endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PhaseStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PhaseStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[PhaseStatus]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[PhaseStatus]: """ Performs a GET request against the /project/phaseStatuses endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[PhaseStatus]: The parsed response data. """ - return self._parse_many( - PhaseStatus, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PhaseStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PhaseStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PhaseStatus: """ Performs a POST request against the /project/phaseStatuses endpoint. @@ -111,6 +83,4 @@ def post( Returns: PhaseStatus: The parsed response data. """ - return self._parse_one( - PhaseStatus, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(PhaseStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdEndpoint.py index 8c2194256..d59ab8662 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectPhasestatusesIdUsagesEndpoint import ( - ProjectPhasestatusesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProjectPhasestatusesIdUsagesEndpoint import ProjectPhasestatusesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PhaseStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectPhasestatusesIdEndpoint( ConnectWiseEndpoint, IGettable[PhaseStatus, ConnectWiseManageRequestParams], - IPuttable[PhaseStatus, ConnectWiseManageRequestParams], IPatchable[PhaseStatus, ConnectWiseManageRequestParams], + IPuttable[PhaseStatus, ConnectWiseManageRequestParams], IPaginateable[PhaseStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PhaseStatus) - IPuttable.__init__(self, PhaseStatus) IPatchable.__init__(self, PhaseStatus) + IPuttable.__init__(self, PhaseStatus) IPaginateable.__init__(self, PhaseStatus) - self.usages = self._register_child_endpoint( - ProjectPhasestatusesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(ProjectPhasestatusesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PhaseStatus]: """ Performs a GET request against the /project/phaseStatuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PhaseStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PhaseStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PhaseStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/phaseStatuses/{id} endpoint. + Performs a DELETE request against the /project/phaseStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PhaseStatus: The parsed response data. """ - return self._parse_one( - PhaseStatus, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PhaseStatus: """ - Performs a DELETE request against the /project/phaseStatuses/{id} endpoint. + Performs a GET request against the /project/phaseStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PhaseStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PhaseStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PhaseStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PhaseStatus: """ - Performs a PUT request against the /project/phaseStatuses/{id} endpoint. + Performs a PATCH request against the /project/phaseStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: PhaseStatus: The parsed response data. """ - return self._parse_one( - PhaseStatus, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(PhaseStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PhaseStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PhaseStatus: """ - Performs a PATCH request against the /project/phaseStatuses/{id} endpoint. + Performs a PUT request against the /project/phaseStatuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +93,4 @@ def patch( Returns: PhaseStatus: The parsed response data. """ - return self._parse_one( - PhaseStatus, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(PhaseStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesEndpoint.py index 00442ba9f..7cf4ce83d 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectPhasestatusesIdUsagesListEndpoint import ( ProjectPhasestatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectPhasestatusesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ProjectPhasestatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /project/phaseStatuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /project/phaseStatuses/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesListEndpoint.py index 5748da05d..c9af38242 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectPhasestatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectPhasestatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProjectPhasestatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /project/phaseStatuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /project/phaseStatuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsCountEndpoint.py index 8522a4c10..c6748f4f6 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectProjectsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/projects/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/projects/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsEndpoint.py index 0c36e11a9..6ce561723 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjectsCountEndpoint import ( - ProjectProjectsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsIdEndpoint import ( - ProjectProjectsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectProjectsCountEndpoint import ProjectProjectsCountEndpoint +from pyconnectwise.endpoints.manage.ProjectProjectsIdEndpoint import ProjectProjectsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Project from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsEndpoint( @@ -24,36 +18,29 @@ class ProjectProjectsEndpoint( IPostable[Project, ConnectWiseManageRequestParams], IPaginateable[Project, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "projects", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "projects", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Project]) IPostable.__init__(self, Project) IPaginateable.__init__(self, Project) - self.count = self._register_child_endpoint( - ProjectProjectsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectProjectsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectProjectsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectProjectsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectProjectsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectProjectsIdEndpoint: The initialized ProjectProjectsIdEndpoint object. """ child = ProjectProjectsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Project]: """ Performs a GET request against the /project/projects endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Project, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Project, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Project]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Project]: """ Performs a GET request against the /project/projects endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Project]: The parsed response data. """ - return self._parse_many( - Project, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Project, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Project: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Project: """ Performs a POST request against the /project/projects endpoint. @@ -111,6 +81,4 @@ def post( Returns: Project: The parsed response data. """ - return self._parse_one( - Project, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Project, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsEndpoint.py index fe08756a2..204f60912 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsEndpoint.py @@ -1,18 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjectsIdContactsIdEndpoint import ( - ProjectProjectsIdContactsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectProjectsIdContactsIdEndpoint import ProjectProjectsIdContactsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectContact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdContactsEndpoint( @@ -21,32 +17,27 @@ class ProjectProjectsIdContactsEndpoint( IPostable[ProjectContact, ConnectWiseManageRequestParams], IPaginateable[ProjectContact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contacts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "contacts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectContact]) IPostable.__init__(self, ProjectContact) IPaginateable.__init__(self, ProjectContact) - def id(self, id: int) -> ProjectProjectsIdContactsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectProjectsIdContactsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectProjectsIdContactsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectProjectsIdContactsIdEndpoint: The initialized ProjectProjectsIdContactsIdEndpoint object. """ child = ProjectProjectsIdContactsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectContact]: """ Performs a GET request against the /project/projects/{id}/contacts endpoint and returns an initialized PaginatedResponse object. @@ -64,18 +55,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectContact, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectContact, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectContact]: """ Performs a GET request against the /project/projects/{id}/contacts endpoint. @@ -86,16 +70,9 @@ def get( Returns: list[ProjectContact]: The parsed response data. """ - return self._parse_many( - ProjectContact, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectContact, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectContact: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectContact: """ Performs a POST request against the /project/projects/{id}/contacts endpoint. @@ -105,7 +82,4 @@ def post( Returns: ProjectContact: The parsed response data. """ - return self._parse_one( - ProjectContact, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProjectContact, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsIdEndpoint.py index f0c79a8c2..0f916f0a8 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdContactsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectContact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdContactsIdEndpoint( @@ -16,18 +15,13 @@ class ProjectProjectsIdContactsIdEndpoint( IGettable[ProjectContact, ConnectWiseManageRequestParams], IPaginateable[ProjectContact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectContact) IPaginateable.__init__(self, ProjectContact) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectContact]: """ Performs a GET request against the /project/projects/{id}/contacts/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,27 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectContact, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectContact, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectContact: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/projects/{id}/contacts/{id} endpoint. + Performs a DELETE request against the /project/projects/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectContact: The parsed response data. """ - return self._parse_one( - ProjectContact, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectContact: """ - Performs a DELETE request against the /project/projects/{id}/contacts/{id} endpoint. + Performs a GET request against the /project/projects/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectContact: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectContact, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdEndpoint.py index b53930129..5f8a83979 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdEndpoint.py @@ -1,71 +1,42 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjectsIdContactsEndpoint import ( - ProjectProjectsIdContactsEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsIdNotesEndpoint import ( - ProjectProjectsIdNotesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsIdPhasesEndpoint import ( - ProjectProjectsIdPhasesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsIdProjectworkplanEndpoint import ( - ProjectProjectsIdProjectworkplanEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsIdTeammembersEndpoint import ( - ProjectProjectsIdTeammembersEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProjectProjectsIdContactsEndpoint import ProjectProjectsIdContactsEndpoint +from pyconnectwise.endpoints.manage.ProjectProjectsIdNotesEndpoint import ProjectProjectsIdNotesEndpoint +from pyconnectwise.endpoints.manage.ProjectProjectsIdPhasesEndpoint import ProjectProjectsIdPhasesEndpoint +from pyconnectwise.endpoints.manage.ProjectProjectsIdTeammembersEndpoint import ProjectProjectsIdTeammembersEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Project from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdEndpoint( ConnectWiseEndpoint, IGettable[Project, ConnectWiseManageRequestParams], - IPuttable[Project, ConnectWiseManageRequestParams], IPatchable[Project, ConnectWiseManageRequestParams], + IPuttable[Project, ConnectWiseManageRequestParams], IPaginateable[Project, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Project) - IPuttable.__init__(self, Project) IPatchable.__init__(self, Project) + IPuttable.__init__(self, Project) IPaginateable.__init__(self, Project) - self.phases = self._register_child_endpoint( - ProjectProjectsIdPhasesEndpoint(client, parent_endpoint=self) - ) - self.contacts = self._register_child_endpoint( - ProjectProjectsIdContactsEndpoint(client, parent_endpoint=self) - ) + self.contacts = self._register_child_endpoint(ProjectProjectsIdContactsEndpoint(client, parent_endpoint=self)) + self.notes = self._register_child_endpoint(ProjectProjectsIdNotesEndpoint(client, parent_endpoint=self)) + self.phases = self._register_child_endpoint(ProjectProjectsIdPhasesEndpoint(client, parent_endpoint=self)) self.team_members = self._register_child_endpoint( ProjectProjectsIdTeammembersEndpoint(client, parent_endpoint=self) ) - self.notes = self._register_child_endpoint( - ProjectProjectsIdNotesEndpoint(client, parent_endpoint=self) - ) - self.project_workplan = self._register_child_endpoint( - ProjectProjectsIdProjectworkplanEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Project]: """ Performs a GET request against the /project/projects/{id} endpoint and returns an initialized PaginatedResponse object. @@ -82,54 +53,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Project, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Project, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Project: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/projects/{id} endpoint. + Performs a DELETE request against the /project/projects/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Project: The parsed response data. """ - return self._parse_one( - Project, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Project: """ - Performs a DELETE request against the /project/projects/{id} endpoint. + Performs a GET request against the /project/projects/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Project: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Project, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Project: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Project: """ - Performs a PUT request against the /project/projects/{id} endpoint. + Performs a PATCH request against the /project/projects/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,17 +87,11 @@ def put( Returns: Project: The parsed response data. """ - return self._parse_one( - Project, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Project, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Project: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Project: """ - Performs a PATCH request against the /project/projects/{id} endpoint. + Performs a PUT request against the /project/projects/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -155,6 +99,4 @@ def patch( Returns: Project: The parsed response data. """ - return self._parse_one( - Project, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Project, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesCountEndpoint.py index 68f863731..9f98cbb5d 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdNotesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectProjectsIdNotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/projects/{id}/notes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/projects/{id}/notes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesEndpoint.py index 373686821..21e11d06b 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjectsIdNotesCountEndpoint import ( - ProjectProjectsIdNotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsIdNotesIdEndpoint import ( - ProjectProjectsIdNotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectProjectsIdNotesCountEndpoint import ProjectProjectsIdNotesCountEndpoint +from pyconnectwise.endpoints.manage.ProjectProjectsIdNotesIdEndpoint import ProjectProjectsIdNotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdNotesEndpoint( @@ -24,36 +18,29 @@ class ProjectProjectsIdNotesEndpoint( IPostable[ProjectNote, ConnectWiseManageRequestParams], IPaginateable[ProjectNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectNote]) IPostable.__init__(self, ProjectNote) IPaginateable.__init__(self, ProjectNote) - self.count = self._register_child_endpoint( - ProjectProjectsIdNotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectProjectsIdNotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectProjectsIdNotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectProjectsIdNotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectProjectsIdNotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectProjectsIdNotesIdEndpoint: The initialized ProjectProjectsIdNotesIdEndpoint object. """ child = ProjectProjectsIdNotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectNote]: """ Performs a GET request against the /project/projects/{id}/notes endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ProjectNote]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ProjectNote]: """ Performs a GET request against the /project/projects/{id}/notes endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ProjectNote]: The parsed response data. """ - return self._parse_many( - ProjectNote, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ProjectNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectNote: """ Performs a POST request against the /project/projects/{id}/notes endpoint. @@ -111,6 +83,4 @@ def post( Returns: ProjectNote: The parsed response data. """ - return self._parse_one( - ProjectNote, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ProjectNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesIdEndpoint.py index 86d2b752a..a7e844d84 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdNotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdNotesIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectNote, ConnectWiseManageRequestParams], - IPuttable[ProjectNote, ConnectWiseManageRequestParams], IPatchable[ProjectNote, ConnectWiseManageRequestParams], + IPuttable[ProjectNote, ConnectWiseManageRequestParams], IPaginateable[ProjectNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectNote) - IPuttable.__init__(self, ProjectNote) IPatchable.__init__(self, ProjectNote) + IPuttable.__init__(self, ProjectNote) IPaginateable.__init__(self, ProjectNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectNote]: """ Performs a GET request against the /project/projects/{id}/notes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/projects/{id}/notes/{id} endpoint. + Performs a DELETE request against the /project/projects/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectNote: The parsed response data. """ - return self._parse_one( - ProjectNote, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectNote: """ - Performs a DELETE request against the /project/projects/{id}/notes/{id} endpoint. + Performs a GET request against the /project/projects/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProjectNote: """ - Performs a PUT request against the /project/projects/{id}/notes/{id} endpoint. + Performs a PATCH request against the /project/projects/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: ProjectNote: The parsed response data. """ - return self._parse_one( - ProjectNote, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ProjectNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectNote: """ - Performs a PATCH request against the /project/projects/{id}/notes/{id} endpoint. + Performs a PUT request against the /project/projects/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: ProjectNote: The parsed response data. """ - return self._parse_one( - ProjectNote, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ProjectNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesCountEndpoint.py index 1a3f0b1a5..5c6fe0f4b 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdPhasesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectProjectsIdPhasesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/projects/{id}/phases/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/projects/{id}/phases/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesEndpoint.py index 5989aef6c..ad38f8292 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjectsIdPhasesCountEndpoint import ( - ProjectProjectsIdPhasesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjectsIdPhasesIdEndpoint import ( - ProjectProjectsIdPhasesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectProjectsIdPhasesCountEndpoint import ProjectProjectsIdPhasesCountEndpoint +from pyconnectwise.endpoints.manage.ProjectProjectsIdPhasesIdEndpoint import ProjectProjectsIdPhasesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectPhase from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdPhasesEndpoint( @@ -24,36 +18,29 @@ class ProjectProjectsIdPhasesEndpoint( IPostable[ProjectPhase, ConnectWiseManageRequestParams], IPaginateable[ProjectPhase, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "phases", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "phases", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectPhase]) IPostable.__init__(self, ProjectPhase) IPaginateable.__init__(self, ProjectPhase) - self.count = self._register_child_endpoint( - ProjectProjectsIdPhasesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectProjectsIdPhasesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectProjectsIdPhasesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectProjectsIdPhasesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectProjectsIdPhasesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectProjectsIdPhasesIdEndpoint: The initialized ProjectProjectsIdPhasesIdEndpoint object. """ child = ProjectProjectsIdPhasesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectPhase]: """ Performs a GET request against the /project/projects/{id}/phases endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectPhase, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectPhase, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ProjectPhase]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ProjectPhase]: """ Performs a GET request against the /project/projects/{id}/phases endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ProjectPhase]: The parsed response data. """ - return self._parse_many( - ProjectPhase, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ProjectPhase, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectPhase: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectPhase: """ Performs a POST request against the /project/projects/{id}/phases endpoint. @@ -111,6 +83,4 @@ def post( Returns: ProjectPhase: The parsed response data. """ - return self._parse_one( - ProjectPhase, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ProjectPhase, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesIdEndpoint.py index 5a813f994..fc4a62c0f 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdPhasesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectPhase from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdPhasesIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectPhase, ConnectWiseManageRequestParams], - IPuttable[ProjectPhase, ConnectWiseManageRequestParams], IPatchable[ProjectPhase, ConnectWiseManageRequestParams], + IPuttable[ProjectPhase, ConnectWiseManageRequestParams], IPaginateable[ProjectPhase, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectPhase) - IPuttable.__init__(self, ProjectPhase) IPatchable.__init__(self, ProjectPhase) + IPuttable.__init__(self, ProjectPhase) IPaginateable.__init__(self, ProjectPhase) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectPhase]: """ Performs a GET request against the /project/projects/{id}/phases/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectPhase, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectPhase, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectPhase: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/projects/{id}/phases/{id} endpoint. + Performs a DELETE request against the /project/projects/{id}/phases/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectPhase: The parsed response data. """ - return self._parse_one( - ProjectPhase, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectPhase: """ - Performs a DELETE request against the /project/projects/{id}/phases/{id} endpoint. + Performs a GET request against the /project/projects/{id}/phases/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectPhase: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectPhase, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectPhase: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProjectPhase: """ - Performs a PUT request against the /project/projects/{id}/phases/{id} endpoint. + Performs a PATCH request against the /project/projects/{id}/phases/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: ProjectPhase: The parsed response data. """ - return self._parse_one( - ProjectPhase, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ProjectPhase, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectPhase: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectPhase: """ - Performs a PATCH request against the /project/projects/{id}/phases/{id} endpoint. + Performs a PUT request against the /project/projects/{id}/phases/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: ProjectPhase: The parsed response data. """ - return self._parse_one( - ProjectPhase, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProjectPhase, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanCountEndpoint.py index 80ce16985..91bf775d4 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanCountEndpoint.py @@ -17,9 +17,7 @@ class ProjectProjectsIdProjectworkplanCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanEndpoint.py index 62738c8db..bfa35ea90 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanEndpoint.py @@ -23,9 +23,7 @@ class ProjectProjectsIdProjectworkplanEndpoint( IPaginateable[ProjectWorkplan, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "projectWorkplan", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "projectWorkplan", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectWorkplan]) IPaginateable.__init__(self, ProjectWorkplan) @@ -42,9 +40,7 @@ def id(self, id: int) -> ProjectProjectsIdProjectworkplanIdEndpoint: # noqa: A0 Returns: ProjectProjectsIdProjectworkplanIdEndpoint: The initialized ProjectProjectsIdProjectworkplanIdEndpoint object. """ - child = ProjectProjectsIdProjectworkplanIdEndpoint( - self.client, parent_endpoint=self - ) + child = ProjectProjectsIdProjectworkplanIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanIdEndpoint.py index 2e54eb98d..4d51aeeb0 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdProjectworkplanIdEndpoint.py @@ -17,9 +17,7 @@ class ProjectProjectsIdProjectworkplanIdEndpoint( IPaginateable[ProjectWorkplan, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectWorkplan) IPaginateable.__init__(self, ProjectWorkplan) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersCountEndpoint.py index 50165883d..db652cc7c 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdTeammembersCountEndpoint( @@ -16,18 +15,13 @@ class ProjectProjectsIdTeammembersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/projects/{id}/teamMembers/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/projects/{id}/teamMembers/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersEndpoint.py index 3458d066f..0d623d3a7 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectProjectsIdTeammembersCountEndpoint import ( ProjectProjectsIdTeammembersCountEndpoint, ) -from pyconnectwise.endpoints.manage.ProjectProjectsIdTeammembersIdEndpoint import ( - ProjectProjectsIdTeammembersIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectProjectsIdTeammembersIdEndpoint import ProjectProjectsIdTeammembersIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectTeamMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdTeammembersEndpoint( @@ -24,10 +20,8 @@ class ProjectProjectsIdTeammembersEndpoint( IPostable[ProjectTeamMember, ConnectWiseManageRequestParams], IPaginateable[ProjectTeamMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "teamMembers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "teamMembers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectTeamMember]) IPostable.__init__(self, ProjectTeamMember) IPaginateable.__init__(self, ProjectTeamMember) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProjectProjectsIdTeammembersCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProjectProjectsIdTeammembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectProjectsIdTeammembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectProjectsIdTeammembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectProjectsIdTeammembersIdEndpoint: The initialized ProjectProjectsIdTeammembersIdEndpoint object. """ - child = ProjectProjectsIdTeammembersIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProjectProjectsIdTeammembersIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectTeamMember]: """ Performs a GET request against the /project/projects/{id}/teamMembers endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectTeamMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectTeamMember, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectTeamMember]: """ Performs a GET request against the /project/projects/{id}/teamMembers endpoint. @@ -95,16 +77,9 @@ def get( Returns: list[ProjectTeamMember]: The parsed response data. """ - return self._parse_many( - ProjectTeamMember, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectTeamMember, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTeamMember: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectTeamMember: """ Performs a POST request against the /project/projects/{id}/teamMembers endpoint. @@ -114,7 +89,4 @@ def post( Returns: ProjectTeamMember: The parsed response data. """ - return self._parse_one( - ProjectTeamMember, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProjectTeamMember, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersIdEndpoint.py index 267b01159..84426156c 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjectsIdTeammembersIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectTeamMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjectsIdTeammembersIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectTeamMember, ConnectWiseManageRequestParams], - IPuttable[ProjectTeamMember, ConnectWiseManageRequestParams], IPatchable[ProjectTeamMember, ConnectWiseManageRequestParams], + IPuttable[ProjectTeamMember, ConnectWiseManageRequestParams], IPaginateable[ProjectTeamMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectTeamMember) - IPuttable.__init__(self, ProjectTeamMember) IPatchable.__init__(self, ProjectTeamMember) + IPuttable.__init__(self, ProjectTeamMember) IPaginateable.__init__(self, ProjectTeamMember) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectTeamMember]: """ Performs a GET request against the /project/projects/{id}/teamMembers/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectTeamMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectTeamMember, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTeamMember: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/projects/{id}/teamMembers/{id} endpoint. + Performs a DELETE request against the /project/projects/{id}/teamMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectTeamMember: The parsed response data. """ - return self._parse_one( - ProjectTeamMember, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectTeamMember: """ - Performs a DELETE request against the /project/projects/{id}/teamMembers/{id} endpoint. + Performs a GET request against the /project/projects/{id}/teamMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectTeamMember: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectTeamMember, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTeamMember: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProjectTeamMember: """ - Performs a PUT request against the /project/projects/{id}/teamMembers/{id} endpoint. + Performs a PATCH request against the /project/projects/{id}/teamMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: ProjectTeamMember: The parsed response data. """ - return self._parse_one( - ProjectTeamMember, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ProjectTeamMember, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTeamMember: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectTeamMember: """ - Performs a PATCH request against the /project/projects/{id}/teamMembers/{id} endpoint. + Performs a PUT request against the /project/projects/{id}/teamMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: ProjectTeamMember: The parsed response data. """ - return self._parse_one( - ProjectTeamMember, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProjectTeamMember, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesCountEndpoint.py index 776ea2641..09e908b1f 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesCountEndpoint.py @@ -17,9 +17,7 @@ class ProjectProjecttemplatesCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesEndpoint.py index f0630919a..af496701e 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesEndpoint.py @@ -9,13 +9,9 @@ class ProjectProjecttemplatesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "projectTemplates", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "projectTemplates", parent_endpoint=parent_endpoint) - self.count = self._register_child_endpoint( - ProjectProjecttemplatesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectProjecttemplatesCountEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> ProjectProjecttemplatesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdEndpoint.py index 985f014e0..11edb39d2 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdEndpoint.py @@ -28,18 +28,14 @@ class ProjectProjecttemplatesIdEndpoint( IPaginateable[ProjectTemplate, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectTemplate) IPuttable.__init__(self, ProjectTemplate) IPatchable.__init__(self, ProjectTemplate) IPaginateable.__init__(self, ProjectTemplate) self.project_template_tickets = self._register_child_endpoint( - ProjectProjecttemplatesIdProjecttemplateticketsEndpoint( - client, parent_endpoint=self - ) + ProjectProjecttemplatesIdProjecttemplateticketsEndpoint(client, parent_endpoint=self) ) self.workplan = self._register_child_endpoint( ProjectProjecttemplatesIdWorkplanEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsCountEndpoint.py index e55c52953..9a773773d 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsCountEndpoint.py @@ -17,9 +17,7 @@ class ProjectProjecttemplatesIdProjecttemplateticketsCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsEndpoint.py index 252bc46cb..7d04441ca 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsEndpoint.py @@ -25,22 +25,16 @@ class ProjectProjecttemplatesIdProjecttemplateticketsEndpoint( IPaginateable[ProjectTemplateTicket, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "projectTemplateTickets", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "projectTemplateTickets", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectTemplateTicket]) IPostable.__init__(self, ProjectTemplateTicket) IPaginateable.__init__(self, ProjectTemplateTicket) self.count = self._register_child_endpoint( - ProjectProjecttemplatesIdProjecttemplateticketsCountEndpoint( - client, parent_endpoint=self - ) + ProjectProjecttemplatesIdProjecttemplateticketsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint: + def id(self, id: int) -> ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint: # noqa: A002 """ Sets the ID for this endpoint and returns an initialized ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint object to move down the chain. @@ -49,9 +43,7 @@ def id( Returns: ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint: The initialized ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint object. """ - child = ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint( - self.client, parent_endpoint=self - ) + child = ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint.py index 8fbb59c75..f6cd6bbf9 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint.py @@ -25,18 +25,14 @@ class ProjectProjecttemplatesIdProjecttemplateticketsIdEndpoint( IPaginateable[ProjectTemplateTicket, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectTemplateTicket) IPuttable.__init__(self, ProjectTemplateTicket) IPatchable.__init__(self, ProjectTemplateTicket) IPaginateable.__init__(self, ProjectTemplateTicket) self.tasks = self._register_child_endpoint( - ProjectProjecttemplatesIdProjecttemplateticketsIdTasksEndpoint( - client, parent_endpoint=self - ) + ProjectProjecttemplatesIdProjecttemplateticketsIdTasksEndpoint(client, parent_endpoint=self) ) def paginated( diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksCountEndpoint.py index 095b8aac1..890584b22 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksCountEndpoint.py @@ -17,9 +17,7 @@ class ProjectProjecttemplatesIdProjecttemplateticketsIdTasksCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksEndpoint.py index c746e9d93..eec031e61 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksEndpoint.py @@ -25,22 +25,16 @@ class ProjectProjecttemplatesIdProjecttemplateticketsIdTasksEndpoint( IPaginateable[ProjectTemplateTask, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tasks", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "tasks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectTemplateTask]) IPostable.__init__(self, ProjectTemplateTask) IPaginateable.__init__(self, ProjectTemplateTask) self.count = self._register_child_endpoint( - ProjectProjecttemplatesIdProjecttemplateticketsIdTasksCountEndpoint( - client, parent_endpoint=self - ) + ProjectProjecttemplatesIdProjecttemplateticketsIdTasksCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint: + def id(self, id: int) -> ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint: # noqa: A002 """ Sets the ID for this endpoint and returns an initialized ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint object to move down the chain. @@ -49,9 +43,7 @@ def id( Returns: ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint: The initialized ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint object. """ - child = ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint( - self.client, parent_endpoint=self - ) + child = ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint.py index 28a00d364..4e7514c01 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint.py @@ -22,9 +22,7 @@ class ProjectProjecttemplatesIdProjecttemplateticketsIdTasksIdEndpoint( IPaginateable[ProjectTemplateTask, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectTemplateTask) IPuttable.__init__(self, ProjectTemplateTask) IPatchable.__init__(self, ProjectTemplateTask) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdWorkplanEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdWorkplanEndpoint.py index bd99fc576..e9bda94b4 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdWorkplanEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttemplatesIdWorkplanEndpoint.py @@ -17,9 +17,7 @@ class ProjectProjecttemplatesIdWorkplanEndpoint( IPaginateable[ProjectTemplateWorkPlan, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workplan", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "workplan", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectTemplateWorkPlan]) IPaginateable.__init__(self, ProjectTemplateWorkPlan) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesCountEndpoint.py index c0fff1ed4..f2123f598 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectProjecttypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/projectTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/projectTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesEndpoint.py index 1ebab37cc..20c0ab6b4 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjecttypesCountEndpoint import ( - ProjectProjecttypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjecttypesIdEndpoint import ( - ProjectProjecttypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjecttypesInfoEndpoint import ( - ProjectProjecttypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectProjecttypesCountEndpoint import ProjectProjecttypesCountEndpoint +from pyconnectwise.endpoints.manage.ProjectProjecttypesIdEndpoint import ProjectProjecttypesIdEndpoint +from pyconnectwise.endpoints.manage.ProjectProjecttypesInfoEndpoint import ProjectProjecttypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesEndpoint( @@ -27,39 +19,30 @@ class ProjectProjecttypesEndpoint( IPostable[ProjectType, ConnectWiseManageRequestParams], IPaginateable[ProjectType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "projectTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "projectTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectType]) IPostable.__init__(self, ProjectType) IPaginateable.__init__(self, ProjectType) - self.count = self._register_child_endpoint( - ProjectProjecttypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProjectProjecttypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectProjecttypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProjectProjecttypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectProjecttypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectProjecttypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectProjecttypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectProjecttypesIdEndpoint: The initialized ProjectProjecttypesIdEndpoint object. """ child = ProjectProjecttypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectType]: """ Performs a GET request against the /project/projectTypes endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ProjectType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ProjectType]: """ Performs a GET request against the /project/projectTypes endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[ProjectType]: The parsed response data. """ - return self._parse_many( - ProjectType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ProjectType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectType: """ Performs a POST request against the /project/projectTypes endpoint. @@ -117,6 +85,4 @@ def post( Returns: ProjectType: The parsed response data. """ - return self._parse_one( - ProjectType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ProjectType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdEndpoint.py index 2b073461f..64f4f7f75 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjecttypesIdInfoEndpoint import ( - ProjectProjecttypesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectProjecttypesIdUsagesEndpoint import ( - ProjectProjecttypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProjectProjecttypesIdInfoEndpoint import ProjectProjecttypesIdInfoEndpoint +from pyconnectwise.endpoints.manage.ProjectProjecttypesIdUsagesEndpoint import ProjectProjecttypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectType, ConnectWiseManageRequestParams], - IPuttable[ProjectType, ConnectWiseManageRequestParams], IPatchable[ProjectType, ConnectWiseManageRequestParams], + IPuttable[ProjectType, ConnectWiseManageRequestParams], IPaginateable[ProjectType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectType) - IPuttable.__init__(self, ProjectType) IPatchable.__init__(self, ProjectType) + IPuttable.__init__(self, ProjectType) IPaginateable.__init__(self, ProjectType) - self.usages = self._register_child_endpoint( - ProjectProjecttypesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProjectProjecttypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProjectProjecttypesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ProjectProjecttypesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectType]: """ Performs a GET request against the /project/projectTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/projectTypes/{id} endpoint. + Performs a DELETE request against the /project/projectTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectType: The parsed response data. """ - return self._parse_one( - ProjectType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectType: """ - Performs a DELETE request against the /project/projectTypes/{id} endpoint. + Performs a GET request against the /project/projectTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProjectType: """ - Performs a PUT request against the /project/projectTypes/{id} endpoint. + Performs a PATCH request against the /project/projectTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +83,11 @@ def put( Returns: ProjectType: The parsed response data. """ - return self._parse_one( - ProjectType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ProjectType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectType: """ - Performs a PATCH request against the /project/projectTypes/{id} endpoint. + Performs a PUT request against the /project/projectTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +95,4 @@ def patch( Returns: ProjectType: The parsed response data. """ - return self._parse_one( - ProjectType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ProjectType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdInfoEndpoint.py index 80755f530..0be08d309 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProjectProjecttypesIdInfoEndpoint( IGettable[ProjectTypeInfo, ConnectWiseManageRequestParams], IPaginateable[ProjectTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectTypeInfo) IPaginateable.__init__(self, ProjectTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectTypeInfo]: """ Performs a GET request against the /project/projectTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectTypeInfo: """ Performs a GET request against the /project/projectTypes/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ProjectTypeInfo: The parsed response data. """ - return self._parse_one( - ProjectTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ProjectTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesEndpoint.py index 7e039bd53..3880b2ce0 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectProjecttypesIdUsagesListEndpoint import ( ProjectProjecttypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesIdUsagesEndpoint( @@ -19,22 +18,15 @@ class ProjectProjecttypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ProjectProjecttypesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ProjectProjecttypesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /project/projectTypes/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +43,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /project/projectTypes/{id}/usages endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesListEndpoint.py index 0e96345ce..2c8ce4417 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProjectProjecttypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /project/projectTypes/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /project/projectTypes/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoCountEndpoint.py index 73a400799..745379b43 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProjectProjecttypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/projectTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/projectTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoEndpoint.py index 542fb39f3..2a2615a0b 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectProjecttypesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectProjecttypesInfoCountEndpoint import ( - ProjectProjecttypesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProjectProjecttypesInfoCountEndpoint import ProjectProjecttypesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectProjecttypesInfoEndpoint( @@ -19,22 +16,15 @@ class ProjectProjecttypesInfoEndpoint( IGettable[list[ProjectTypeInfo], ConnectWiseManageRequestParams], IPaginateable[ProjectTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectTypeInfo]) IPaginateable.__init__(self, ProjectTypeInfo) - self.count = self._register_child_endpoint( - ProjectProjecttypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectProjecttypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectTypeInfo]: """ Performs a GET request against the /project/projectTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectTypeInfo]: """ Performs a GET request against the /project/projectTypes/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ProjectTypeInfo]: The parsed response data. """ - return self._parse_many( - ProjectTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesCountEndpoint.py index 438d15f4d..ff553518a 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectSecurityrolesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectSecurityrolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/securityRoles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/securityRoles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesEndpoint.py index d81c69125..5761e6bec 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectSecurityrolesCountEndpoint import ( - ProjectSecurityrolesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectSecurityrolesIdEndpoint import ( - ProjectSecurityrolesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectSecurityrolesCountEndpoint import ProjectSecurityrolesCountEndpoint +from pyconnectwise.endpoints.manage.ProjectSecurityrolesIdEndpoint import ProjectSecurityrolesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectSecurityRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectSecurityrolesEndpoint( @@ -24,36 +18,29 @@ class ProjectSecurityrolesEndpoint( IPostable[ProjectSecurityRole, ConnectWiseManageRequestParams], IPaginateable[ProjectSecurityRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "securityRoles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "securityRoles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectSecurityRole]) IPostable.__init__(self, ProjectSecurityRole) IPaginateable.__init__(self, ProjectSecurityRole) - self.count = self._register_child_endpoint( - ProjectSecurityrolesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectSecurityrolesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectSecurityrolesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectSecurityrolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectSecurityrolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectSecurityrolesIdEndpoint: The initialized ProjectSecurityrolesIdEndpoint object. """ child = ProjectSecurityrolesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectSecurityRole]: """ Performs a GET request against the /project/securityRoles endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectSecurityRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectSecurityRole, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectSecurityRole]: """ Performs a GET request against the /project/securityRoles endpoint. @@ -93,15 +73,10 @@ def get( Returns: list[ProjectSecurityRole]: The parsed response data. """ - return self._parse_many( - ProjectSecurityRole, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectSecurityRole, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProjectSecurityRole: """ Performs a POST request against the /project/securityRoles endpoint. @@ -112,7 +87,4 @@ def post( Returns: ProjectSecurityRole: The parsed response data. """ - return self._parse_one( - ProjectSecurityRole, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProjectSecurityRole, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdEndpoint.py index 15e58d429..7ba462f90 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdEndpoint.py @@ -1,36 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectSecurityrolesIdSettingsEndpoint import ( - ProjectSecurityrolesIdSettingsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProjectSecurityrolesIdSettingsEndpoint import ProjectSecurityrolesIdSettingsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectSecurityRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectSecurityrolesIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectSecurityRole, ConnectWiseManageRequestParams], - IPuttable[ProjectSecurityRole, ConnectWiseManageRequestParams], IPatchable[ProjectSecurityRole, ConnectWiseManageRequestParams], + IPuttable[ProjectSecurityRole, ConnectWiseManageRequestParams], IPaginateable[ProjectSecurityRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectSecurityRole) - IPuttable.__init__(self, ProjectSecurityRole) IPatchable.__init__(self, ProjectSecurityRole) + IPuttable.__init__(self, ProjectSecurityRole) IPaginateable.__init__(self, ProjectSecurityRole) self.settings = self._register_child_endpoint( @@ -38,10 +30,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectSecurityRole]: """ Performs a GET request against the /project/securityRoles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +48,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectSecurityRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectSecurityRole, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectSecurityRole: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/securityRoles/{id} endpoint. + Performs a DELETE request against the /project/securityRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectSecurityRole: The parsed response data. """ - return self._parse_one( - ProjectSecurityRole, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ProjectSecurityRole: """ - Performs a DELETE request against the /project/securityRoles/{id} endpoint. + Performs a GET request against the /project/securityRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectSecurityRole: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectSecurityRole, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ProjectSecurityRole: """ - Performs a PUT request against the /project/securityRoles/{id} endpoint. + Performs a PATCH request against the /project/securityRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +87,13 @@ def put( Returns: ProjectSecurityRole: The parsed response data. """ - return self._parse_one( - ProjectSecurityRole, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ProjectSecurityRole, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProjectSecurityRole: """ - Performs a PATCH request against the /project/securityRoles/{id} endpoint. + Performs a PUT request against the /project/securityRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +101,4 @@ def patch( Returns: ProjectSecurityRole: The parsed response data. """ - return self._parse_one( - ProjectSecurityRole, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProjectSecurityRole, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsCountEndpoint.py index 07bdedd59..b7a8e5e69 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectSecurityrolesIdSettingsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectSecurityrolesIdSettingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/securityRoles/{id}/settings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/securityRoles/{id}/settings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsEndpoint.py index f06d5db1d..a71542dd4 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectSecurityrolesIdSettingsCountEndpoint import ( ProjectSecurityrolesIdSettingsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.ProjectSecurityrolesIdSettingsIdEndpoint import ( ProjectSecurityrolesIdSettingsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectSecurityRoleSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectSecurityrolesIdSettingsEndpoint( @@ -22,10 +21,8 @@ class ProjectSecurityrolesIdSettingsEndpoint( IGettable[list[ProjectSecurityRoleSetting], ConnectWiseManageRequestParams], IPaginateable[ProjectSecurityRoleSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "settings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "settings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectSecurityRoleSetting]) IPaginateable.__init__(self, ProjectSecurityRoleSetting) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProjectSecurityrolesIdSettingsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProjectSecurityrolesIdSettingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectSecurityrolesIdSettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectSecurityrolesIdSettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectSecurityrolesIdSettingsIdEndpoint: The initialized ProjectSecurityrolesIdSettingsIdEndpoint object. """ - child = ProjectSecurityrolesIdSettingsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProjectSecurityrolesIdSettingsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectSecurityRoleSetting]: """ Performs a GET request against the /project/securityRoles/{id}/settings endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectSecurityRoleSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectSecurityRoleSetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectSecurityRoleSetting]: """ Performs a GET request against the /project/securityRoles/{id}/settings endpoint. @@ -93,6 +78,5 @@ def get( list[ProjectSecurityRoleSetting]: The parsed response data. """ return self._parse_many( - ProjectSecurityRoleSetting, - super()._make_request("GET", data=data, params=params).json(), + ProjectSecurityRoleSetting, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsIdEndpoint.py index 88a6b70ba..acc63f56e 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectSecurityrolesIdSettingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectSecurityRoleSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectSecurityrolesIdSettingsIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectSecurityRoleSetting, ConnectWiseManageRequestParams], - IPuttable[ProjectSecurityRoleSetting, ConnectWiseManageRequestParams], IPatchable[ProjectSecurityRoleSetting, ConnectWiseManageRequestParams], + IPuttable[ProjectSecurityRoleSetting, ConnectWiseManageRequestParams], IPaginateable[ProjectSecurityRoleSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectSecurityRoleSetting) - IPuttable.__init__(self, ProjectSecurityRoleSetting) IPatchable.__init__(self, ProjectSecurityRoleSetting) + IPuttable.__init__(self, ProjectSecurityRoleSetting) IPaginateable.__init__(self, ProjectSecurityRoleSetting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectSecurityRoleSetting]: """ Performs a GET request against the /project/securityRoles/{id}/settings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectSecurityRoleSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectSecurityRoleSetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProjectSecurityRoleSetting: """ Performs a GET request against the /project/securityRoles/{id}/settings/{id} endpoint. @@ -75,17 +59,14 @@ def get( ProjectSecurityRoleSetting: The parsed response data. """ return self._parse_one( - ProjectSecurityRoleSetting, - super()._make_request("GET", data=data, params=params).json(), + ProjectSecurityRoleSetting, super()._make_request("GET", data=data, params=params).json() ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ProjectSecurityRoleSetting: """ - Performs a PUT request against the /project/securityRoles/{id}/settings/{id} endpoint. + Performs a PATCH request against the /project/securityRoles/{id}/settings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -94,17 +75,14 @@ def put( ProjectSecurityRoleSetting: The parsed response data. """ return self._parse_one( - ProjectSecurityRoleSetting, - super()._make_request("PUT", data=data, params=params).json(), + ProjectSecurityRoleSetting, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ProjectSecurityRoleSetting: """ - Performs a PATCH request against the /project/securityRoles/{id}/settings/{id} endpoint. + Performs a PUT request against the /project/securityRoles/{id}/settings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,6 +91,5 @@ def patch( ProjectSecurityRoleSetting: The parsed response data. """ return self._parse_one( - ProjectSecurityRoleSetting, - super()._make_request("PATCH", data=data, params=params).json(), + ProjectSecurityRoleSetting, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesCountEndpoint.py index 5aa68206c..98ed0c7b4 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesEndpoint.py index a32cd6c67..e04572854 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectStatusesCountEndpoint import ( - ProjectStatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectStatusesIdEndpoint import ( - ProjectStatusesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectStatusesInfoEndpoint import ( - ProjectStatusesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectStatusesCountEndpoint import ProjectStatusesCountEndpoint +from pyconnectwise.endpoints.manage.ProjectStatusesIdEndpoint import ProjectStatusesIdEndpoint +from pyconnectwise.endpoints.manage.ProjectStatusesInfoEndpoint import ProjectStatusesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesEndpoint( @@ -27,39 +19,30 @@ class ProjectStatusesEndpoint( IPostable[ProjectStatus, ConnectWiseManageRequestParams], IPaginateable[ProjectStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectStatus]) IPostable.__init__(self, ProjectStatus) IPaginateable.__init__(self, ProjectStatus) - self.count = self._register_child_endpoint( - ProjectStatusesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProjectStatusesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectStatusesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ProjectStatusesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectStatusesIdEndpoint: The initialized ProjectStatusesIdEndpoint object. """ child = ProjectStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectStatus]: """ Performs a GET request against the /project/statuses endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectStatus]: """ Performs a GET request against the /project/statuses endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[ProjectStatus]: The parsed response data. """ - return self._parse_many( - ProjectStatus, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ProjectStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectStatus: """ Performs a POST request against the /project/statuses endpoint. @@ -117,7 +87,4 @@ def post( Returns: ProjectStatus: The parsed response data. """ - return self._parse_one( - ProjectStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProjectStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdEndpoint.py index 3dad6db92..9866a5b3e 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectStatusesIdInfoEndpoint import ( - ProjectStatusesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectStatusesIdUsagesEndpoint import ( - ProjectStatusesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProjectStatusesIdInfoEndpoint import ProjectStatusesIdInfoEndpoint +from pyconnectwise.endpoints.manage.ProjectStatusesIdUsagesEndpoint import ProjectStatusesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectStatus, ConnectWiseManageRequestParams], - IPuttable[ProjectStatus, ConnectWiseManageRequestParams], IPatchable[ProjectStatus, ConnectWiseManageRequestParams], + IPuttable[ProjectStatus, ConnectWiseManageRequestParams], IPaginateable[ProjectStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectStatus) - IPuttable.__init__(self, ProjectStatus) IPatchable.__init__(self, ProjectStatus) + IPuttable.__init__(self, ProjectStatus) IPaginateable.__init__(self, ProjectStatus) - self.usages = self._register_child_endpoint( - ProjectStatusesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ProjectStatusesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ProjectStatusesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ProjectStatusesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectStatus]: """ Performs a GET request against the /project/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/statuses/{id} endpoint. + Performs a DELETE request against the /project/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectStatus: The parsed response data. """ - return self._parse_one( - ProjectStatus, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectStatus: """ - Performs a DELETE request against the /project/statuses/{id} endpoint. + Performs a GET request against the /project/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProjectStatus: """ - Performs a PUT request against the /project/statuses/{id} endpoint. + Performs a PATCH request against the /project/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +83,11 @@ def put( Returns: ProjectStatus: The parsed response data. """ - return self._parse_one( - ProjectStatus, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ProjectStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectStatus: """ - Performs a PATCH request against the /project/statuses/{id} endpoint. + Performs a PUT request against the /project/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,7 +95,4 @@ def patch( Returns: ProjectStatus: The parsed response data. """ - return self._parse_one( - ProjectStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProjectStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdInfoEndpoint.py index e371a3c17..fadbc3afd 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ProjectStatusesIdInfoEndpoint( IGettable[ProjectStatusInfo, ConnectWiseManageRequestParams], IPaginateable[ProjectStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectStatusInfo) IPaginateable.__init__(self, ProjectStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectStatusInfo]: """ Performs a GET request against the /project/statuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectStatusInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectStatusInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectStatusInfo: """ Performs a GET request against the /project/statuses/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ProjectStatusInfo: The parsed response data. """ - return self._parse_one( - ProjectStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ProjectStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesEndpoint.py index a658e3392..52b344286 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectStatusesIdUsagesListEndpoint import ( - ProjectStatusesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProjectStatusesIdUsagesListEndpoint import ProjectStatusesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ProjectStatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ProjectStatusesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ProjectStatusesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /project/statuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /project/statuses/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesListEndpoint.py index e0de71db5..7d35814b5 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ProjectStatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /project/statuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /project/statuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoCountEndpoint.py index 42d6a9f34..dda88dd71 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ProjectStatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/statuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/statuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoEndpoint.py index 464eb5c28..f8fd965e0 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectStatusesInfoCountEndpoint import ( - ProjectStatusesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProjectStatusesInfoCountEndpoint import ProjectStatusesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusesInfoEndpoint( @@ -19,22 +16,15 @@ class ProjectStatusesInfoEndpoint( IGettable[list[ProjectStatusInfo], ConnectWiseManageRequestParams], IPaginateable[ProjectStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectStatusInfo]) IPaginateable.__init__(self, ProjectStatusInfo) - self.count = self._register_child_endpoint( - ProjectStatusesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectStatusesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectStatusInfo]: """ Performs a GET request against the /project/statuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectStatusInfo]: """ Performs a GET request against the /project/statuses/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ProjectStatusInfo]: The parsed response data. """ - return self._parse_many( - ProjectStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsCountEndpoint.py index 6d5a6b2ec..3655f407f 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusindicatorsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectStatusindicatorsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/statusIndicators/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/statusIndicators/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsEndpoint.py index b5141d8b3..b70207586 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectStatusindicatorsCountEndpoint import ( - ProjectStatusindicatorsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectStatusindicatorsIdEndpoint import ( - ProjectStatusindicatorsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProjectStatusindicatorsCountEndpoint import ProjectStatusindicatorsCountEndpoint +from pyconnectwise.endpoints.manage.ProjectStatusindicatorsIdEndpoint import ProjectStatusindicatorsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import StatusIndicator from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusindicatorsEndpoint( @@ -22,35 +17,28 @@ class ProjectStatusindicatorsEndpoint( IGettable[list[StatusIndicator], ConnectWiseManageRequestParams], IPaginateable[StatusIndicator, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statusIndicators", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statusIndicators", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[StatusIndicator]) IPaginateable.__init__(self, StatusIndicator) - self.count = self._register_child_endpoint( - ProjectStatusindicatorsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectStatusindicatorsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectStatusindicatorsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectStatusindicatorsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectStatusindicatorsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectStatusindicatorsIdEndpoint: The initialized ProjectStatusindicatorsIdEndpoint object. """ child = ProjectStatusindicatorsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StatusIndicator]: """ Performs a GET request against the /project/statusIndicators endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - StatusIndicator, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), StatusIndicator, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[StatusIndicator]: """ Performs a GET request against the /project/statusIndicators endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[StatusIndicator]: The parsed response data. """ - return self._parse_many( - StatusIndicator, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(StatusIndicator, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsIdEndpoint.py index 6b0613915..832fc3cbe 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectStatusindicatorsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import StatusIndicator from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectStatusindicatorsIdEndpoint( @@ -16,18 +15,13 @@ class ProjectStatusindicatorsIdEndpoint( IGettable[StatusIndicator, ConnectWiseManageRequestParams], IPaginateable[StatusIndicator, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, StatusIndicator) IPaginateable.__init__(self, StatusIndicator) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StatusIndicator]: """ Performs a GET request against the /project/statusIndicators/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - StatusIndicator, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), StatusIndicator, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> StatusIndicator: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> StatusIndicator: """ Performs a GET request against the /project/statusIndicators/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: StatusIndicator: The parsed response data. """ - return self._parse_one( - StatusIndicator, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(StatusIndicator, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketnoteEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketnoteEndpoint.py index cc790fa8b..f86cc4e33 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketnoteEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketnoteEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketnoteIdEndpoint import ( - ProjectTicketnoteIdEndpoint, -) +from pyconnectwise.endpoints.manage.ProjectTicketnoteIdEndpoint import ProjectTicketnoteIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketnoteEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ticketNote", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ticketNote", parent_endpoint=parent_endpoint) - def id(self, id: int) -> ProjectTicketnoteIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectTicketnoteIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectTicketnoteIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectTicketnoteIdEndpoint: The initialized ProjectTicketnoteIdEndpoint object. """ child = ProjectTicketnoteIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdEndpoint.py index e58f5a55a..589f77e7d 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketnoteIdMarkasEndpoint import ( - ProjectTicketnoteIdMarkasEndpoint, -) +from pyconnectwise.endpoints.manage.ProjectTicketnoteIdMarkasEndpoint import ProjectTicketnoteIdMarkasEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketnoteIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - - self.mark_as = self._register_child_endpoint( - ProjectTicketnoteIdMarkasEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + + self.mark_as = self._register_child_endpoint(ProjectTicketnoteIdMarkasEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdMarkasEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdMarkasEndpoint.py index b6e983c2c..c68b6d095 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdMarkasEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketnoteIdMarkasEndpoint.py @@ -1,8 +1,11 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ProjectTicketnoteIdMarkasEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "markAs", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "markAs", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsCountEndpoint.py index e09612a47..bafb7e71e 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsEndpoint.py index e98791d41..7642dd1de 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketsCountEndpoint import ( - ProjectTicketsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdEndpoint import ( - ProjectTicketsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsSearchEndpoint import ( - ProjectTicketsSearchEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectTicketsCountEndpoint import ProjectTicketsCountEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdEndpoint import ProjectTicketsIdEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsSearchEndpoint import ProjectTicketsSearchEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ProjectTicket from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsEndpoint( @@ -27,39 +19,30 @@ class ProjectTicketsEndpoint( IPostable[ProjectTicket, ConnectWiseManageRequestParams], IPaginateable[ProjectTicket, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tickets", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tickets", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectTicket]) IPostable.__init__(self, ProjectTicket) IPaginateable.__init__(self, ProjectTicket) - self.count = self._register_child_endpoint( - ProjectTicketsCountEndpoint(client, parent_endpoint=self) - ) - self.search = self._register_child_endpoint( - ProjectTicketsSearchEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectTicketsCountEndpoint(client, parent_endpoint=self)) + self.search = self._register_child_endpoint(ProjectTicketsSearchEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectTicketsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectTicketsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectTicketsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectTicketsIdEndpoint: The initialized ProjectTicketsIdEndpoint object. """ child = ProjectTicketsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectTicket]: """ Performs a GET request against the /project/tickets endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectTicket, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectTicket, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectTicket]: """ Performs a GET request against the /project/tickets endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[ProjectTicket]: The parsed response data. """ - return self._parse_many( - ProjectTicket, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ProjectTicket, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTicket: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectTicket: """ Performs a POST request against the /project/tickets endpoint. @@ -117,7 +87,4 @@ def post( Returns: ProjectTicket: The parsed response data. """ - return self._parse_one( - ProjectTicket, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ProjectTicket, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesCountEndpoint.py index ca2461f0f..15dfdb547 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdActivitiesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdActivitiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/activities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/activities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesEndpoint.py index 6fff8c7a0..94b155d63 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdActivitiesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectTicketsIdActivitiesCountEndpoint import ( ProjectTicketsIdActivitiesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ActivityReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdActivitiesEndpoint( @@ -19,10 +18,8 @@ class ProjectTicketsIdActivitiesEndpoint( IGettable[list[ActivityReference], ConnectWiseManageRequestParams], IPaginateable[ActivityReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "activities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "activities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ActivityReference]) IPaginateable.__init__(self, ActivityReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityReference]: """ Performs a GET request against the /project/tickets/{id}/activities endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ActivityReference]: """ Performs a GET request against the /project/tickets/{id}/activities endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ActivityReference]: The parsed response data. """ - return self._parse_many( - ActivityReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ActivityReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdAllnotesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdAllnotesEndpoint.py index e63601c9a..53aebe68e 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdAllnotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdAllnotesEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProjectTicketNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdAllnotesEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdAllnotesEndpoint( IGettable[list[ProjectTicketNote], ConnectWiseManageRequestParams], IPaginateable[ProjectTicketNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "allNotes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "allNotes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProjectTicketNote]) IPaginateable.__init__(self, ProjectTicketNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectTicketNote]: """ Performs a GET request against the /project/tickets/{id}/allNotes endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectTicketNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectTicketNote, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectTicketNote]: """ Performs a GET request against the /project/tickets/{id}/allNotes endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[ProjectTicketNote]: The parsed response data. """ - return self._parse_many( - ProjectTicketNote, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProjectTicketNote, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsCountEndpoint.py index c52b04fa3..6ab95d136 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdConfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdConfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/configurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/configurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsEndpoint.py index 6d34e1f69..50f7fb297 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectTicketsIdConfigurationsCountEndpoint import ( ProjectTicketsIdConfigurationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ProjectTicketsIdConfigurationsIdEndpoint import ( ProjectTicketsIdConfigurationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConfigurationReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdConfigurationsEndpoint( @@ -24,10 +22,8 @@ class ProjectTicketsIdConfigurationsEndpoint( IPostable[ConfigurationReference, ConnectWiseManageRequestParams], IPaginateable[ConfigurationReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "configurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "configurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationReference]) IPostable.__init__(self, ConfigurationReference) IPaginateable.__init__(self, ConfigurationReference) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ProjectTicketsIdConfigurationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ProjectTicketsIdConfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectTicketsIdConfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectTicketsIdConfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectTicketsIdConfigurationsIdEndpoint: The initialized ProjectTicketsIdConfigurationsIdEndpoint object. """ - child = ProjectTicketsIdConfigurationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ProjectTicketsIdConfigurationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationReference]: """ Performs a GET request against the /project/tickets/{id}/configurations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationReference]: """ Performs a GET request against the /project/tickets/{id}/configurations endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[ConfigurationReference]: The parsed response data. """ - return self._parse_many( - ConfigurationReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConfigurationReference, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationReference: """ Performs a POST request against the /project/tickets/{id}/configurations endpoint. @@ -114,7 +93,4 @@ def post( Returns: ConfigurationReference: The parsed response data. """ - return self._parse_one( - ConfigurationReference, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationReference, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsIdEndpoint.py index d4db599b4..2e789ceec 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConfigurationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdConfigurationsIdEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdConfigurationsIdEndpoint( IGettable[ConfigurationReference, ConnectWiseManageRequestParams], IPaginateable[ConfigurationReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationReference) IPaginateable.__init__(self, ConfigurationReference) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationReference]: """ Performs a GET request against the /project/tickets/{id}/configurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,29 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationReference, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationReference: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/tickets/{id}/configurations/{id} endpoint. + Performs a DELETE request against the /project/tickets/{id}/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConfigurationReference: The parsed response data. """ - return self._parse_one( - ConfigurationReference, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ConfigurationReference: """ - Performs a DELETE request against the /project/tickets/{id}/configurations/{id} endpoint. + Performs a GET request against the /project/tickets/{id}/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConfigurationReference: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ConfigurationReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConvertEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConvertEndpoint.py index 025713aa6..d409d1e5b 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConvertEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdConvertEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ProjectTicketsIdConvertEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "convert", parent_endpoint=parent_endpoint - ) +class ProjectTicketsIdConvertEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "convert", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /project/tickets/{id}/convert endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsCountEndpoint.py index fe7794271..d5f9a2ae7 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdDocumentsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdDocumentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/documents/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/documents/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsEndpoint.py index 984109f34..3e0610f43 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdDocumentsEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketsIdDocumentsCountEndpoint import ( - ProjectTicketsIdDocumentsCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProjectTicketsIdDocumentsCountEndpoint import ProjectTicketsIdDocumentsCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import DocumentReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdDocumentsEndpoint( @@ -19,22 +16,15 @@ class ProjectTicketsIdDocumentsEndpoint( IGettable[list[DocumentReference], ConnectWiseManageRequestParams], IPaginateable[DocumentReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "documents", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "documents", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DocumentReference]) IPaginateable.__init__(self, DocumentReference) - self.count = self._register_child_endpoint( - ProjectTicketsIdDocumentsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectTicketsIdDocumentsCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DocumentReference]: """ Performs a GET request against the /project/tickets/{id}/documents endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DocumentReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DocumentReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[DocumentReference]: """ Performs a GET request against the /project/tickets/{id}/documents endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[DocumentReference]: The parsed response data. """ - return self._parse_many( - DocumentReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(DocumentReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdEndpoint.py index 76e045b27..c0022323d 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdEndpoint.py @@ -1,101 +1,62 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketsIdActivitiesEndpoint import ( - ProjectTicketsIdActivitiesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdAllnotesEndpoint import ( - ProjectTicketsIdAllnotesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdConfigurationsEndpoint import ( - ProjectTicketsIdConfigurationsEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdConvertEndpoint import ( - ProjectTicketsIdConvertEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdDocumentsEndpoint import ( - ProjectTicketsIdDocumentsEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdNotesEndpoint import ( - ProjectTicketsIdNotesEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdProductsEndpoint import ( - ProjectTicketsIdProductsEndpoint, -) +from pyconnectwise.endpoints.manage.ProjectTicketsIdActivitiesEndpoint import ProjectTicketsIdActivitiesEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdAllnotesEndpoint import ProjectTicketsIdAllnotesEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdConfigurationsEndpoint import ProjectTicketsIdConfigurationsEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdConvertEndpoint import ProjectTicketsIdConvertEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdDocumentsEndpoint import ProjectTicketsIdDocumentsEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdNotesEndpoint import ProjectTicketsIdNotesEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdProductsEndpoint import ProjectTicketsIdProductsEndpoint from pyconnectwise.endpoints.manage.ProjectTicketsIdScheduleentriesEndpoint import ( ProjectTicketsIdScheduleentriesEndpoint, ) -from pyconnectwise.endpoints.manage.ProjectTicketsIdTasksEndpoint import ( - ProjectTicketsIdTasksEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdTimeentriesEndpoint import ( - ProjectTicketsIdTimeentriesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ProjectTicketsIdTasksEndpoint import ProjectTicketsIdTasksEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdTimeentriesEndpoint import ProjectTicketsIdTimeentriesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ProjectTicket from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdEndpoint( ConnectWiseEndpoint, IGettable[ProjectTicket, ConnectWiseManageRequestParams], - IPuttable[ProjectTicket, ConnectWiseManageRequestParams], IPatchable[ProjectTicket, ConnectWiseManageRequestParams], + IPuttable[ProjectTicket, ConnectWiseManageRequestParams], IPaginateable[ProjectTicket, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ProjectTicket) - IPuttable.__init__(self, ProjectTicket) IPatchable.__init__(self, ProjectTicket) + IPuttable.__init__(self, ProjectTicket) IPaginateable.__init__(self, ProjectTicket) + self.activities = self._register_child_endpoint( + ProjectTicketsIdActivitiesEndpoint(client, parent_endpoint=self) + ) + self.all_notes = self._register_child_endpoint(ProjectTicketsIdAllnotesEndpoint(client, parent_endpoint=self)) self.configurations = self._register_child_endpoint( ProjectTicketsIdConfigurationsEndpoint(client, parent_endpoint=self) ) - self.documents = self._register_child_endpoint( - ProjectTicketsIdDocumentsEndpoint(client, parent_endpoint=self) - ) - self.convert = self._register_child_endpoint( - ProjectTicketsIdConvertEndpoint(client, parent_endpoint=self) - ) - self.timeentries = self._register_child_endpoint( - ProjectTicketsIdTimeentriesEndpoint(client, parent_endpoint=self) - ) - self.products = self._register_child_endpoint( - ProjectTicketsIdProductsEndpoint(client, parent_endpoint=self) - ) + self.convert = self._register_child_endpoint(ProjectTicketsIdConvertEndpoint(client, parent_endpoint=self)) + self.documents = self._register_child_endpoint(ProjectTicketsIdDocumentsEndpoint(client, parent_endpoint=self)) + self.notes = self._register_child_endpoint(ProjectTicketsIdNotesEndpoint(client, parent_endpoint=self)) + self.products = self._register_child_endpoint(ProjectTicketsIdProductsEndpoint(client, parent_endpoint=self)) self.scheduleentries = self._register_child_endpoint( ProjectTicketsIdScheduleentriesEndpoint(client, parent_endpoint=self) ) - self.all_notes = self._register_child_endpoint( - ProjectTicketsIdAllnotesEndpoint(client, parent_endpoint=self) - ) - self.notes = self._register_child_endpoint( - ProjectTicketsIdNotesEndpoint(client, parent_endpoint=self) - ) - self.tasks = self._register_child_endpoint( - ProjectTicketsIdTasksEndpoint(client, parent_endpoint=self) - ) - self.activities = self._register_child_endpoint( - ProjectTicketsIdActivitiesEndpoint(client, parent_endpoint=self) + self.tasks = self._register_child_endpoint(ProjectTicketsIdTasksEndpoint(client, parent_endpoint=self)) + self.timeentries = self._register_child_endpoint( + ProjectTicketsIdTimeentriesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProjectTicket]: """ Performs a GET request against the /project/tickets/{id} endpoint and returns an initialized PaginatedResponse object. @@ -113,53 +74,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProjectTicket, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProjectTicket, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTicket: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/tickets/{id} endpoint. + Performs a DELETE request against the /project/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ProjectTicket: The parsed response data. """ - return self._parse_one( - ProjectTicket, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectTicket: """ - Performs a DELETE request against the /project/tickets/{id} endpoint. + Performs a GET request against the /project/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ProjectTicket: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ProjectTicket, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTicket: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ProjectTicket: """ - Performs a PUT request against the /project/tickets/{id} endpoint. + Performs a PATCH request against the /project/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -167,17 +109,11 @@ def put( Returns: ProjectTicket: The parsed response data. """ - return self._parse_one( - ProjectTicket, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ProjectTicket, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ProjectTicket: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ProjectTicket: """ - Performs a PATCH request against the /project/tickets/{id} endpoint. + Performs a PUT request against the /project/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -185,7 +121,4 @@ def patch( Returns: ProjectTicket: The parsed response data. """ - return self._parse_one( - ProjectTicket, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ProjectTicket, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesCountEndpoint.py index a276c81f8..a5875a244 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdNotesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdNotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/notes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/notes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesEndpoint.py index 22f0565cc..7fc535187 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketsIdNotesCountEndpoint import ( - ProjectTicketsIdNotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdNotesIdEndpoint import ( - ProjectTicketsIdNotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectTicketsIdNotesCountEndpoint import ProjectTicketsIdNotesCountEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdNotesIdEndpoint import ProjectTicketsIdNotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TicketNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdNotesEndpoint( @@ -24,36 +18,29 @@ class ProjectTicketsIdNotesEndpoint( IPostable[TicketNote, ConnectWiseManageRequestParams], IPaginateable[TicketNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TicketNote]) IPostable.__init__(self, TicketNote) IPaginateable.__init__(self, TicketNote) - self.count = self._register_child_endpoint( - ProjectTicketsIdNotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectTicketsIdNotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectTicketsIdNotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectTicketsIdNotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectTicketsIdNotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectTicketsIdNotesIdEndpoint: The initialized ProjectTicketsIdNotesIdEndpoint object. """ child = ProjectTicketsIdNotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketNote]: """ Performs a GET request against the /project/tickets/{id}/notes endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketNote, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketNote, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TicketNote]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TicketNote]: """ Performs a GET request against the /project/tickets/{id}/notes endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[TicketNote]: The parsed response data. """ - return self._parse_many( - TicketNote, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TicketNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketNote: """ Performs a POST request against the /project/tickets/{id}/notes endpoint. @@ -111,6 +81,4 @@ def post( Returns: TicketNote: The parsed response data. """ - return self._parse_one( - TicketNote, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TicketNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesIdEndpoint.py index e83c5b94a..a36f57b86 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdNotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TicketNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdNotesIdEndpoint( ConnectWiseEndpoint, IGettable[TicketNote, ConnectWiseManageRequestParams], - IPuttable[TicketNote, ConnectWiseManageRequestParams], IPatchable[TicketNote, ConnectWiseManageRequestParams], + IPuttable[TicketNote, ConnectWiseManageRequestParams], IPaginateable[TicketNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TicketNote) - IPuttable.__init__(self, TicketNote) IPatchable.__init__(self, TicketNote) + IPuttable.__init__(self, TicketNote) IPaginateable.__init__(self, TicketNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketNote]: """ Performs a GET request against the /project/tickets/{id}/notes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketNote, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketNote, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/tickets/{id}/notes/{id} endpoint. + Performs a DELETE request against the /project/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TicketNote: The parsed response data. """ - return self._parse_one( - TicketNote, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketNote: """ - Performs a DELETE request against the /project/tickets/{id}/notes/{id} endpoint. + Performs a GET request against the /project/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TicketNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TicketNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TicketNote: """ - Performs a PUT request against the /project/tickets/{id}/notes/{id} endpoint. + Performs a PATCH request against the /project/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: TicketNote: The parsed response data. """ - return self._parse_one( - TicketNote, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TicketNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketNote: """ - Performs a PATCH request against the /project/tickets/{id}/notes/{id} endpoint. + Performs a PUT request against the /project/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: TicketNote: The parsed response data. """ - return self._parse_one( - TicketNote, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TicketNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsCountEndpoint.py index 141475048..43816ddc4 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdProductsCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdProductsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/products/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/products/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsEndpoint.py index c0dc9b7af..338e5472a 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdProductsEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketsIdProductsCountEndpoint import ( - ProjectTicketsIdProductsCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ProjectTicketsIdProductsCountEndpoint import ProjectTicketsIdProductsCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProductReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdProductsEndpoint( @@ -19,22 +16,15 @@ class ProjectTicketsIdProductsEndpoint( IGettable[list[ProductReference], ConnectWiseManageRequestParams], IPaginateable[ProductReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "products", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "products", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductReference]) IPaginateable.__init__(self, ProductReference) - self.count = self._register_child_endpoint( - ProjectTicketsIdProductsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectTicketsIdProductsCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductReference]: """ Performs a GET request against the /project/tickets/{id}/products endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductReference]: """ Performs a GET request against the /project/tickets/{id}/products endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ProductReference]: The parsed response data. """ - return self._parse_many( - ProductReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProductReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesCountEndpoint.py index 9a4c698a8..031965d25 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdScheduleentriesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdScheduleentriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/scheduleentries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/scheduleentries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesEndpoint.py index e2dbbdb09..92c5c2020 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdScheduleentriesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectTicketsIdScheduleentriesCountEndpoint import ( ProjectTicketsIdScheduleentriesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleEntryReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdScheduleentriesEndpoint( @@ -19,10 +18,8 @@ class ProjectTicketsIdScheduleentriesEndpoint( IGettable[list[ScheduleEntryReference], ConnectWiseManageRequestParams], IPaginateable[ScheduleEntryReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "scheduleentries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "scheduleentries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleEntryReference]) IPaginateable.__init__(self, ScheduleEntryReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleEntryReference]: """ Performs a GET request against the /project/tickets/{id}/scheduleentries endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleEntryReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleEntryReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleEntryReference]: """ Performs a GET request against the /project/tickets/{id}/scheduleentries endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ScheduleEntryReference]: The parsed response data. """ - return self._parse_many( - ScheduleEntryReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleEntryReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksCountEndpoint.py index 5660ff768..e4b12a98a 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdTasksCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdTasksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/tasks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/tasks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksEndpoint.py index aed8a7ba6..a0ed3849e 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ProjectTicketsIdTasksCountEndpoint import ( - ProjectTicketsIdTasksCountEndpoint, -) -from pyconnectwise.endpoints.manage.ProjectTicketsIdTasksIdEndpoint import ( - ProjectTicketsIdTasksIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ProjectTicketsIdTasksCountEndpoint import ProjectTicketsIdTasksCountEndpoint +from pyconnectwise.endpoints.manage.ProjectTicketsIdTasksIdEndpoint import ProjectTicketsIdTasksIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TicketTask from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdTasksEndpoint( @@ -24,36 +18,29 @@ class ProjectTicketsIdTasksEndpoint( IPostable[TicketTask, ConnectWiseManageRequestParams], IPaginateable[TicketTask, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tasks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tasks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TicketTask]) IPostable.__init__(self, TicketTask) IPaginateable.__init__(self, TicketTask) - self.count = self._register_child_endpoint( - ProjectTicketsIdTasksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ProjectTicketsIdTasksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ProjectTicketsIdTasksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ProjectTicketsIdTasksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ProjectTicketsIdTasksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ProjectTicketsIdTasksIdEndpoint: The initialized ProjectTicketsIdTasksIdEndpoint object. """ child = ProjectTicketsIdTasksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketTask]: """ Performs a GET request against the /project/tickets/{id}/tasks endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketTask, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketTask, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TicketTask]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TicketTask]: """ Performs a GET request against the /project/tickets/{id}/tasks endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[TicketTask]: The parsed response data. """ - return self._parse_many( - TicketTask, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TicketTask, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketTask: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketTask: """ Performs a POST request against the /project/tickets/{id}/tasks endpoint. @@ -111,6 +81,4 @@ def post( Returns: TicketTask: The parsed response data. """ - return self._parse_one( - TicketTask, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TicketTask, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksIdEndpoint.py index 48d84c9d0..e258fc1f1 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTasksIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TicketTask from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdTasksIdEndpoint( ConnectWiseEndpoint, IGettable[TicketTask, ConnectWiseManageRequestParams], - IPuttable[TicketTask, ConnectWiseManageRequestParams], IPatchable[TicketTask, ConnectWiseManageRequestParams], + IPuttable[TicketTask, ConnectWiseManageRequestParams], IPaginateable[TicketTask, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TicketTask) - IPuttable.__init__(self, TicketTask) IPatchable.__init__(self, TicketTask) + IPuttable.__init__(self, TicketTask) IPaginateable.__init__(self, TicketTask) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketTask]: """ Performs a GET request against the /project/tickets/{id}/tasks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketTask, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketTask, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketTask: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /project/tickets/{id}/tasks/{id} endpoint. + Performs a DELETE request against the /project/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TicketTask: The parsed response data. """ - return self._parse_one( - TicketTask, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketTask: """ - Performs a DELETE request against the /project/tickets/{id}/tasks/{id} endpoint. + Performs a GET request against the /project/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TicketTask: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TicketTask, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketTask: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TicketTask: """ - Performs a PUT request against the /project/tickets/{id}/tasks/{id} endpoint. + Performs a PATCH request against the /project/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: TicketTask: The parsed response data. """ - return self._parse_one( - TicketTask, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TicketTask, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketTask: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketTask: """ - Performs a PATCH request against the /project/tickets/{id}/tasks/{id} endpoint. + Performs a PUT request against the /project/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: TicketTask: The parsed response data. """ - return self._parse_one( - TicketTask, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TicketTask, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesCountEndpoint.py index 3737d9bde..0bd6a4a2a 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdTimeentriesCountEndpoint( @@ -16,18 +15,13 @@ class ProjectTicketsIdTimeentriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /project/tickets/{id}/timeentries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /project/tickets/{id}/timeentries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesEndpoint.py index 747532f85..8dbdf9af6 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsIdTimeentriesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ProjectTicketsIdTimeentriesCountEndpoint import ( ProjectTicketsIdTimeentriesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeEntryReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ProjectTicketsIdTimeentriesEndpoint( @@ -19,10 +18,8 @@ class ProjectTicketsIdTimeentriesEndpoint( IGettable[list[TimeEntryReference], ConnectWiseManageRequestParams], IPaginateable[TimeEntryReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "timeentries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "timeentries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeEntryReference]) IPaginateable.__init__(self, TimeEntryReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeEntryReference]: """ Performs a GET request against the /project/tickets/{id}/timeentries endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeEntryReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeEntryReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimeEntryReference]: """ Performs a GET request against the /project/tickets/{id}/timeentries endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[TimeEntryReference]: The parsed response data. """ - return self._parse_many( - TimeEntryReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TimeEntryReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ProjectTicketsSearchEndpoint.py b/src/pyconnectwise/endpoints/manage/ProjectTicketsSearchEndpoint.py index 738f34815..2f5838928 100644 --- a/src/pyconnectwise/endpoints/manage/ProjectTicketsSearchEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ProjectTicketsSearchEndpoint.py @@ -1,27 +1,21 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ProjectTicket -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ProjectTicketsSearchEndpoint( - ConnectWiseEndpoint, IPostable[list[ProjectTicket], ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "search", parent_endpoint=parent_endpoint - ) +class ProjectTicketsSearchEndpoint(ConnectWiseEndpoint, IPostable[list[ProjectTicket], ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "search", parent_endpoint=parent_endpoint) IPostable.__init__(self, list[ProjectTicket]) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProjectTicket]: """ Performs a POST request against the /project/tickets/search endpoint. @@ -32,7 +26,4 @@ def post( Returns: list[ProjectTicket]: The parsed response data. """ - return self._parse_many( - ProjectTicket, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_many(ProjectTicket, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesCountEndpoint.py index 187dc6d39..bf74ea405 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesCountEndpoint( @@ -16,18 +15,13 @@ class SalesActivitiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/activities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/activities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesEndpoint.py index 615b88eea..fdfdede05 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesEndpoint.py @@ -1,27 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesActivitiesCountEndpoint import ( - SalesActivitiesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesActivitiesIdEndpoint import ( - SalesActivitiesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesActivitiesStatusesEndpoint import ( - SalesActivitiesStatusesEndpoint, -) -from pyconnectwise.endpoints.manage.SalesActivitiesTypesEndpoint import ( - SalesActivitiesTypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesActivitiesCountEndpoint import SalesActivitiesCountEndpoint +from pyconnectwise.endpoints.manage.SalesActivitiesIdEndpoint import SalesActivitiesIdEndpoint +from pyconnectwise.endpoints.manage.SalesActivitiesStatusesEndpoint import SalesActivitiesStatusesEndpoint +from pyconnectwise.endpoints.manage.SalesActivitiesTypesEndpoint import SalesActivitiesTypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Activity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesEndpoint( @@ -30,42 +20,31 @@ class SalesActivitiesEndpoint( IPostable[Activity, ConnectWiseManageRequestParams], IPaginateable[Activity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "activities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "activities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Activity]) IPostable.__init__(self, Activity) IPaginateable.__init__(self, Activity) - self.count = self._register_child_endpoint( - SalesActivitiesCountEndpoint(client, parent_endpoint=self) - ) - self.statuses = self._register_child_endpoint( - SalesActivitiesStatusesEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - SalesActivitiesTypesEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesActivitiesCountEndpoint(client, parent_endpoint=self)) + self.statuses = self._register_child_endpoint(SalesActivitiesStatusesEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(SalesActivitiesTypesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesActivitiesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesActivitiesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesActivitiesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesActivitiesIdEndpoint: The initialized SalesActivitiesIdEndpoint object. """ child = SalesActivitiesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Activity]: """ Performs a GET request against the /sales/activities endpoint and returns an initialized PaginatedResponse object. @@ -82,20 +61,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Activity, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Activity, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Activity]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Activity]: """ Performs a GET request against the /sales/activities endpoint. @@ -105,15 +73,9 @@ def get( Returns: list[Activity]: The parsed response data. """ - return self._parse_many( - Activity, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Activity, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Activity: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Activity: """ Performs a POST request against the /sales/activities endpoint. @@ -123,6 +85,4 @@ def post( Returns: Activity: The parsed response data. """ - return self._parse_one( - Activity, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Activity, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesIdEndpoint.py index ae6bb8f22..2ab10aa5a 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Activity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesIdEndpoint( ConnectWiseEndpoint, IGettable[Activity, ConnectWiseManageRequestParams], - IPuttable[Activity, ConnectWiseManageRequestParams], IPatchable[Activity, ConnectWiseManageRequestParams], + IPuttable[Activity, ConnectWiseManageRequestParams], IPaginateable[Activity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Activity) - IPuttable.__init__(self, Activity) IPatchable.__init__(self, Activity) + IPuttable.__init__(self, Activity) IPaginateable.__init__(self, Activity) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Activity]: """ Performs a GET request against the /sales/activities/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Activity, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Activity, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Activity: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/activities/{id} endpoint. + Performs a DELETE request against the /sales/activities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Activity: The parsed response data. """ - return self._parse_one( - Activity, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Activity: """ - Performs a DELETE request against the /sales/activities/{id} endpoint. + Performs a GET request against the /sales/activities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Activity: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Activity, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Activity: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Activity: """ - Performs a PUT request against the /sales/activities/{id} endpoint. + Performs a PATCH request against the /sales/activities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Activity: The parsed response data. """ - return self._parse_one( - Activity, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Activity, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Activity: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Activity: """ - Performs a PATCH request against the /sales/activities/{id} endpoint. + Performs a PUT request against the /sales/activities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Activity: The parsed response data. """ - return self._parse_one( - Activity, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Activity, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesCountEndpoint.py index c7ea422d5..f2a0b9e0c 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesStatusesCountEndpoint( @@ -16,18 +15,13 @@ class SalesActivitiesStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/activities/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/activities/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesEndpoint.py index 016014dec..7a21f6bcf 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesActivitiesStatusesCountEndpoint import ( - SalesActivitiesStatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesActivitiesStatusesIdEndpoint import ( - SalesActivitiesStatusesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesActivitiesStatusesInfoEndpoint import ( - SalesActivitiesStatusesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesActivitiesStatusesCountEndpoint import SalesActivitiesStatusesCountEndpoint +from pyconnectwise.endpoints.manage.SalesActivitiesStatusesIdEndpoint import SalesActivitiesStatusesIdEndpoint +from pyconnectwise.endpoints.manage.SalesActivitiesStatusesInfoEndpoint import SalesActivitiesStatusesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ActivityStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesStatusesEndpoint( @@ -27,39 +19,30 @@ class SalesActivitiesStatusesEndpoint( IPostable[ActivityStatus, ConnectWiseManageRequestParams], IPaginateable[ActivityStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ActivityStatus]) IPostable.__init__(self, ActivityStatus) IPaginateable.__init__(self, ActivityStatus) - self.count = self._register_child_endpoint( - SalesActivitiesStatusesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SalesActivitiesStatusesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesActivitiesStatusesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SalesActivitiesStatusesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesActivitiesStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesActivitiesStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesActivitiesStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesActivitiesStatusesIdEndpoint: The initialized SalesActivitiesStatusesIdEndpoint object. """ child = SalesActivitiesStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityStatus]: """ Performs a GET request against the /sales/activities/statuses endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ActivityStatus]: """ Performs a GET request against the /sales/activities/statuses endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[ActivityStatus]: The parsed response data. """ - return self._parse_many( - ActivityStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ActivityStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityStatus: """ Performs a POST request against the /sales/activities/statuses endpoint. @@ -118,7 +87,4 @@ def post( Returns: ActivityStatus: The parsed response data. """ - return self._parse_one( - ActivityStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ActivityStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdEndpoint.py index 637348f9c..56925fc8e 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesActivitiesStatusesIdInfoEndpoint import ( - SalesActivitiesStatusesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesActivitiesStatusesIdInfoEndpoint import SalesActivitiesStatusesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ActivityStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[ActivityStatus, ConnectWiseManageRequestParams], - IPuttable[ActivityStatus, ConnectWiseManageRequestParams], IPatchable[ActivityStatus, ConnectWiseManageRequestParams], + IPuttable[ActivityStatus, ConnectWiseManageRequestParams], IPaginateable[ActivityStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ActivityStatus) - IPuttable.__init__(self, ActivityStatus) IPatchable.__init__(self, ActivityStatus) + IPuttable.__init__(self, ActivityStatus) IPaginateable.__init__(self, ActivityStatus) - self.info = self._register_child_endpoint( - SalesActivitiesStatusesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SalesActivitiesStatusesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityStatus]: """ Performs a GET request against the /sales/activities/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/activities/statuses/{id} endpoint. + Performs a DELETE request against the /sales/activities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ActivityStatus: The parsed response data. """ - return self._parse_one( - ActivityStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityStatus: """ - Performs a DELETE request against the /sales/activities/statuses/{id} endpoint. + Performs a GET request against the /sales/activities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ActivityStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ActivityStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ActivityStatus: """ - Performs a PUT request against the /sales/activities/statuses/{id} endpoint. + Performs a PATCH request against the /sales/activities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +81,11 @@ def put( Returns: ActivityStatus: The parsed response data. """ - return self._parse_one( - ActivityStatus, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ActivityStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityStatus: """ - Performs a PATCH request against the /sales/activities/statuses/{id} endpoint. + Performs a PUT request against the /sales/activities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +93,4 @@ def patch( Returns: ActivityStatus: The parsed response data. """ - return self._parse_one( - ActivityStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ActivityStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdInfoEndpoint.py index bdca7f76c..93094a62f 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ActivityStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesStatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SalesActivitiesStatusesIdInfoEndpoint( IGettable[ActivityStatusInfo, ConnectWiseManageRequestParams], IPaginateable[ActivityStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ActivityStatusInfo) IPaginateable.__init__(self, ActivityStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityStatusInfo]: """ Performs a GET request against the /sales/activities/statuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityStatusInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStatusInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityStatusInfo: """ Performs a GET request against the /sales/activities/statuses/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ActivityStatusInfo: The parsed response data. """ - return self._parse_one( - ActivityStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ActivityStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoCountEndpoint.py index aa7f137c1..92449791b 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesStatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesActivitiesStatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/activities/statuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/activities/statuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoEndpoint.py index 1396eac76..730d65f08 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesStatusesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesActivitiesStatusesInfoCountEndpoint import ( SalesActivitiesStatusesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ActivityStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesStatusesInfoEndpoint( @@ -19,10 +18,8 @@ class SalesActivitiesStatusesInfoEndpoint( IGettable[list[ActivityStatusInfo], ConnectWiseManageRequestParams], IPaginateable[ActivityStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ActivityStatusInfo]) IPaginateable.__init__(self, ActivityStatusInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityStatusInfo]: """ Performs a GET request against the /sales/activities/statuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ActivityStatusInfo]: """ Performs a GET request against the /sales/activities/statuses/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ActivityStatusInfo]: The parsed response data. """ - return self._parse_many( - ActivityStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ActivityStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesCountEndpoint.py index 650166eb6..181098e24 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesTypesCountEndpoint( @@ -16,18 +15,13 @@ class SalesActivitiesTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/activities/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/activities/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesEndpoint.py index a5b547252..1783de82b 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesActivitiesTypesCountEndpoint import ( - SalesActivitiesTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesActivitiesTypesIdEndpoint import ( - SalesActivitiesTypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesActivitiesTypesCountEndpoint import SalesActivitiesTypesCountEndpoint +from pyconnectwise.endpoints.manage.SalesActivitiesTypesIdEndpoint import SalesActivitiesTypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ActivityType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesTypesEndpoint( @@ -24,36 +18,29 @@ class SalesActivitiesTypesEndpoint( IPostable[ActivityType, ConnectWiseManageRequestParams], IPaginateable[ActivityType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ActivityType]) IPostable.__init__(self, ActivityType) IPaginateable.__init__(self, ActivityType) - self.count = self._register_child_endpoint( - SalesActivitiesTypesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesActivitiesTypesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesActivitiesTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesActivitiesTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesActivitiesTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesActivitiesTypesIdEndpoint: The initialized SalesActivitiesTypesIdEndpoint object. """ child = SalesActivitiesTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityType]: """ Performs a GET request against the /sales/activities/types endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ActivityType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ActivityType]: """ Performs a GET request against the /sales/activities/types endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ActivityType]: The parsed response data. """ - return self._parse_many( - ActivityType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ActivityType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityType: """ Performs a POST request against the /sales/activities/types endpoint. @@ -111,6 +83,4 @@ def post( Returns: ActivityType: The parsed response data. """ - return self._parse_one( - ActivityType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ActivityType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdEndpoint.py index cfdcb2d7b..386583c4a 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesActivitiesTypesIdUsagesEndpoint import ( - SalesActivitiesTypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesActivitiesTypesIdUsagesEndpoint import SalesActivitiesTypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ActivityType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesTypesIdEndpoint( ConnectWiseEndpoint, IGettable[ActivityType, ConnectWiseManageRequestParams], - IPuttable[ActivityType, ConnectWiseManageRequestParams], IPatchable[ActivityType, ConnectWiseManageRequestParams], + IPuttable[ActivityType, ConnectWiseManageRequestParams], IPaginateable[ActivityType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ActivityType) - IPuttable.__init__(self, ActivityType) IPatchable.__init__(self, ActivityType) + IPuttable.__init__(self, ActivityType) IPaginateable.__init__(self, ActivityType) - self.usages = self._register_child_endpoint( - SalesActivitiesTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(SalesActivitiesTypesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityType]: """ Performs a GET request against the /sales/activities/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/activities/types/{id} endpoint. + Performs a DELETE request against the /sales/activities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ActivityType: The parsed response data. """ - return self._parse_one( - ActivityType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityType: """ - Performs a DELETE request against the /sales/activities/types/{id} endpoint. + Performs a GET request against the /sales/activities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ActivityType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ActivityType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ActivityType: """ - Performs a PUT request against the /sales/activities/types/{id} endpoint. + Performs a PATCH request against the /sales/activities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: ActivityType: The parsed response data. """ - return self._parse_one( - ActivityType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ActivityType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityType: """ - Performs a PATCH request against the /sales/activities/types/{id} endpoint. + Performs a PUT request against the /sales/activities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +93,4 @@ def patch( Returns: ActivityType: The parsed response data. """ - return self._parse_one( - ActivityType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ActivityType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesEndpoint.py index 67fbbb82c..4891e2fc8 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesActivitiesTypesIdUsagesListEndpoint import ( SalesActivitiesTypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesTypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class SalesActivitiesTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/activities/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/activities/types/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesListEndpoint.py index cb9dfed74..42b7c290d 100644 --- a/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesActivitiesTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesActivitiesTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SalesActivitiesTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/activities/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/activities/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesCommissionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesCommissionsCountEndpoint.py index e7fa6af51..5aab69251 100644 --- a/src/pyconnectwise/endpoints/manage/SalesCommissionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesCommissionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesCommissionsCountEndpoint( @@ -16,18 +15,13 @@ class SalesCommissionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/commissions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/commissions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesCommissionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesCommissionsEndpoint.py index 9b17f2d26..1babb90e7 100644 --- a/src/pyconnectwise/endpoints/manage/SalesCommissionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesCommissionsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesCommissionsCountEndpoint import ( - SalesCommissionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesCommissionsIdEndpoint import ( - SalesCommissionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesCommissionsCountEndpoint import SalesCommissionsCountEndpoint +from pyconnectwise.endpoints.manage.SalesCommissionsIdEndpoint import SalesCommissionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Commission from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesCommissionsEndpoint( @@ -24,36 +18,29 @@ class SalesCommissionsEndpoint( IPostable[Commission, ConnectWiseManageRequestParams], IPaginateable[Commission, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "commissions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "commissions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Commission]) IPostable.__init__(self, Commission) IPaginateable.__init__(self, Commission) - self.count = self._register_child_endpoint( - SalesCommissionsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesCommissionsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesCommissionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesCommissionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesCommissionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesCommissionsIdEndpoint: The initialized SalesCommissionsIdEndpoint object. """ child = SalesCommissionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Commission]: """ Performs a GET request against the /sales/commissions endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Commission, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Commission, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Commission]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Commission]: """ Performs a GET request against the /sales/commissions endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Commission]: The parsed response data. """ - return self._parse_many( - Commission, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Commission, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Commission: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Commission: """ Performs a POST request against the /sales/commissions endpoint. @@ -111,6 +81,4 @@ def post( Returns: Commission: The parsed response data. """ - return self._parse_one( - Commission, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Commission, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesCommissionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesCommissionsIdEndpoint.py index d0e4d1301..e75a599da 100644 --- a/src/pyconnectwise/endpoints/manage/SalesCommissionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesCommissionsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesCommissionsIdUsagesEndpoint import ( - SalesCommissionsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesCommissionsIdUsagesEndpoint import SalesCommissionsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Commission from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesCommissionsIdEndpoint( ConnectWiseEndpoint, IGettable[Commission, ConnectWiseManageRequestParams], - IPuttable[Commission, ConnectWiseManageRequestParams], IPatchable[Commission, ConnectWiseManageRequestParams], + IPuttable[Commission, ConnectWiseManageRequestParams], IPaginateable[Commission, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Commission) - IPuttable.__init__(self, Commission) IPatchable.__init__(self, Commission) + IPuttable.__init__(self, Commission) IPaginateable.__init__(self, Commission) - self.usages = self._register_child_endpoint( - SalesCommissionsIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(SalesCommissionsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Commission]: """ Performs a GET request against the /sales/commissions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Commission, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Commission, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Commission: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/commissions/{id} endpoint. + Performs a DELETE request against the /sales/commissions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Commission: The parsed response data. """ - return self._parse_one( - Commission, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Commission: """ - Performs a DELETE request against the /sales/commissions/{id} endpoint. + Performs a GET request against the /sales/commissions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Commission: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Commission, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Commission: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Commission: """ - Performs a PUT request against the /sales/commissions/{id} endpoint. + Performs a PATCH request against the /sales/commissions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: Commission: The parsed response data. """ - return self._parse_one( - Commission, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Commission, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Commission: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Commission: """ - Performs a PATCH request against the /sales/commissions/{id} endpoint. + Performs a PUT request against the /sales/commissions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: Commission: The parsed response data. """ - return self._parse_one( - Commission, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Commission, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesEndpoint.py index 3684bdbf2..3a05273b7 100644 --- a/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesCommissionsIdUsagesListEndpoint import ( - SalesCommissionsIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SalesCommissionsIdUsagesListEndpoint import SalesCommissionsIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesCommissionsIdUsagesEndpoint( @@ -19,22 +16,15 @@ class SalesCommissionsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - SalesCommissionsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(SalesCommissionsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/commissions/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/commissions/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesListEndpoint.py index 47317795a..9a23d61b4 100644 --- a/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesCommissionsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesCommissionsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SalesCommissionsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/commissions/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/commissions/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesEndpoint.py index 29f73a59a..7c36f7767 100644 --- a/src/pyconnectwise/endpoints/manage/SalesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesEndpoint.py @@ -1,63 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesActivitiesEndpoint import ( - SalesActivitiesEndpoint, -) -from pyconnectwise.endpoints.manage.SalesCommissionsEndpoint import ( - SalesCommissionsEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesEndpoint import ( - SalesOpportunitiesEndpoint, -) +from pyconnectwise.endpoints.manage.SalesActivitiesEndpoint import SalesActivitiesEndpoint +from pyconnectwise.endpoints.manage.SalesCommissionsEndpoint import SalesCommissionsEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesEndpoint import SalesOpportunitiesEndpoint from pyconnectwise.endpoints.manage.SalesOrdersEndpoint import SalesOrdersEndpoint -from pyconnectwise.endpoints.manage.SalesProbabilitiesEndpoint import ( - SalesProbabilitiesEndpoint, -) +from pyconnectwise.endpoints.manage.SalesProbabilitiesEndpoint import SalesProbabilitiesEndpoint from pyconnectwise.endpoints.manage.SalesQuotasEndpoint import SalesQuotasEndpoint from pyconnectwise.endpoints.manage.SalesRolesEndpoint import SalesRolesEndpoint -from pyconnectwise.endpoints.manage.SalesSalesteamsEndpoint import ( - SalesSalesteamsEndpoint, -) +from pyconnectwise.endpoints.manage.SalesSalesteamsEndpoint import SalesSalesteamsEndpoint from pyconnectwise.endpoints.manage.SalesScheduleEndpoint import SalesScheduleEndpoint from pyconnectwise.endpoints.manage.SalesServiceEndpoint import SalesServiceEndpoint from pyconnectwise.endpoints.manage.SalesStagesEndpoint import SalesStagesEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SalesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "sales", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "sales", parent_endpoint=parent_endpoint) - self.sales_teams = self._register_child_endpoint( - SalesSalesteamsEndpoint(client, parent_endpoint=self) - ) - self.roles = self._register_child_endpoint( - SalesRolesEndpoint(client, parent_endpoint=self) - ) - self.service = self._register_child_endpoint( - SalesServiceEndpoint(client, parent_endpoint=self) - ) - self.quotas = self._register_child_endpoint( - SalesQuotasEndpoint(client, parent_endpoint=self) - ) - self.opportunities = self._register_child_endpoint( - SalesOpportunitiesEndpoint(client, parent_endpoint=self) - ) - self.orders = self._register_child_endpoint( - SalesOrdersEndpoint(client, parent_endpoint=self) - ) - self.probabilities = self._register_child_endpoint( - SalesProbabilitiesEndpoint(client, parent_endpoint=self) - ) - self.commissions = self._register_child_endpoint( - SalesCommissionsEndpoint(client, parent_endpoint=self) - ) - self.schedule = self._register_child_endpoint( - SalesScheduleEndpoint(client, parent_endpoint=self) - ) - self.stages = self._register_child_endpoint( - SalesStagesEndpoint(client, parent_endpoint=self) - ) - self.activities = self._register_child_endpoint( - SalesActivitiesEndpoint(client, parent_endpoint=self) - ) + self.activities = self._register_child_endpoint(SalesActivitiesEndpoint(client, parent_endpoint=self)) + self.commissions = self._register_child_endpoint(SalesCommissionsEndpoint(client, parent_endpoint=self)) + self.opportunities = self._register_child_endpoint(SalesOpportunitiesEndpoint(client, parent_endpoint=self)) + self.orders = self._register_child_endpoint(SalesOrdersEndpoint(client, parent_endpoint=self)) + self.probabilities = self._register_child_endpoint(SalesProbabilitiesEndpoint(client, parent_endpoint=self)) + self.quotas = self._register_child_endpoint(SalesQuotasEndpoint(client, parent_endpoint=self)) + self.roles = self._register_child_endpoint(SalesRolesEndpoint(client, parent_endpoint=self)) + self.sales_teams = self._register_child_endpoint(SalesSalesteamsEndpoint(client, parent_endpoint=self)) + self.schedule = self._register_child_endpoint(SalesScheduleEndpoint(client, parent_endpoint=self)) + self.service = self._register_child_endpoint(SalesServiceEndpoint(client, parent_endpoint=self)) + self.stages = self._register_child_endpoint(SalesStagesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesCountEndpoint.py index 9de0e83d2..d2a7b4125 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesDefaultEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesDefaultEndpoint.py index 797b9e9fa..0d790e073 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesDefaultEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesDefaultEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Opportunity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesDefaultEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesDefaultEndpoint( IGettable[Opportunity, ConnectWiseManageRequestParams], IPaginateable[Opportunity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "default", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "default", parent_endpoint=parent_endpoint) IGettable.__init__(self, Opportunity) IPaginateable.__init__(self, Opportunity) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Opportunity]: """ Performs a GET request against the /sales/opportunities/default endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Opportunity, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Opportunity, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Opportunity: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Opportunity: """ Performs a GET request against the /sales/opportunities/default endpoint. @@ -67,6 +52,4 @@ def get( Returns: Opportunity: The parsed response data. """ - return self._parse_one( - Opportunity, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Opportunity, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesEndpoint.py index fa7d49403..ed4d81a69 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesEndpoint.py @@ -1,33 +1,19 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOpportunitiesCountEndpoint import ( - SalesOpportunitiesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesDefaultEndpoint import ( - SalesOpportunitiesDefaultEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdEndpoint import ( - SalesOpportunitiesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsEndpoint import ( - SalesOpportunitiesRatingsEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesEndpoint import ( - SalesOpportunitiesStatusesEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesEndpoint import ( - SalesOpportunitiesTypesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesCountEndpoint import SalesOpportunitiesCountEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesDefaultEndpoint import SalesOpportunitiesDefaultEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdEndpoint import SalesOpportunitiesIdEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsEndpoint import SalesOpportunitiesRatingsEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesEndpoint import SalesOpportunitiesStatusesEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesEndpoint import SalesOpportunitiesTypesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Opportunity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesEndpoint( @@ -36,48 +22,33 @@ class SalesOpportunitiesEndpoint( IPostable[Opportunity, ConnectWiseManageRequestParams], IPaginateable[Opportunity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "opportunities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "opportunities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Opportunity]) IPostable.__init__(self, Opportunity) IPaginateable.__init__(self, Opportunity) - self.count = self._register_child_endpoint( - SalesOpportunitiesCountEndpoint(client, parent_endpoint=self) - ) - self.default = self._register_child_endpoint( - SalesOpportunitiesDefaultEndpoint(client, parent_endpoint=self) - ) - self.statuses = self._register_child_endpoint( - SalesOpportunitiesStatusesEndpoint(client, parent_endpoint=self) - ) - self.ratings = self._register_child_endpoint( - SalesOpportunitiesRatingsEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - SalesOpportunitiesTypesEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOpportunitiesCountEndpoint(client, parent_endpoint=self)) + self.default = self._register_child_endpoint(SalesOpportunitiesDefaultEndpoint(client, parent_endpoint=self)) + self.ratings = self._register_child_endpoint(SalesOpportunitiesRatingsEndpoint(client, parent_endpoint=self)) + self.statuses = self._register_child_endpoint(SalesOpportunitiesStatusesEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(SalesOpportunitiesTypesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOpportunitiesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesIdEndpoint: The initialized SalesOpportunitiesIdEndpoint object. """ child = SalesOpportunitiesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Opportunity]: """ Performs a GET request against the /sales/opportunities endpoint and returns an initialized PaginatedResponse object. @@ -95,19 +66,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Opportunity, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Opportunity, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Opportunity]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Opportunity]: """ Performs a GET request against the /sales/opportunities endpoint. @@ -117,15 +79,9 @@ def get( Returns: list[Opportunity]: The parsed response data. """ - return self._parse_many( - Opportunity, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Opportunity, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Opportunity: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Opportunity: """ Performs a POST request against the /sales/opportunities endpoint. @@ -135,6 +91,4 @@ def post( Returns: Opportunity: The parsed response data. """ - return self._parse_one( - Opportunity, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Opportunity, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsCountEndpoint.py index ec3c89f3a..5f8c23332 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdContactsCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesIdContactsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/{id}/contacts/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/{id}/contacts/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsEndpoint.py index fbd38871f..d3d8bfba0 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesIdContactsCountEndpoint import ( SalesOpportunitiesIdContactsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdContactsIdEndpoint import ( - SalesOpportunitiesIdContactsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdContactsIdEndpoint import SalesOpportunitiesIdContactsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OpportunityContact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdContactsEndpoint( @@ -24,10 +20,8 @@ class SalesOpportunitiesIdContactsEndpoint( IPostable[OpportunityContact, ConnectWiseManageRequestParams], IPaginateable[OpportunityContact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contacts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "contacts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityContact]) IPostable.__init__(self, OpportunityContact) IPaginateable.__init__(self, OpportunityContact) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SalesOpportunitiesIdContactsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SalesOpportunitiesIdContactsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesIdContactsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesIdContactsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesIdContactsIdEndpoint: The initialized SalesOpportunitiesIdContactsIdEndpoint object. """ - child = SalesOpportunitiesIdContactsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SalesOpportunitiesIdContactsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityContact]: """ Performs a GET request against the /sales/opportunities/{id}/contacts endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityContact, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityContact, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityContact]: """ Performs a GET request against the /sales/opportunities/{id}/contacts endpoint. @@ -95,15 +77,10 @@ def get( Returns: list[OpportunityContact]: The parsed response data. """ - return self._parse_many( - OpportunityContact, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityContact, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OpportunityContact: """ Performs a POST request against the /sales/opportunities/{id}/contacts endpoint. @@ -114,7 +91,4 @@ def post( Returns: OpportunityContact: The parsed response data. """ - return self._parse_one( - OpportunityContact, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OpportunityContact, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsIdEndpoint.py index 7c02ee2eb..46149cb39 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdContactsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OpportunityContact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdContactsIdEndpoint( ConnectWiseEndpoint, IGettable[OpportunityContact, ConnectWiseManageRequestParams], - IPuttable[OpportunityContact, ConnectWiseManageRequestParams], IPatchable[OpportunityContact, ConnectWiseManageRequestParams], + IPuttable[OpportunityContact, ConnectWiseManageRequestParams], IPaginateable[OpportunityContact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityContact) - IPuttable.__init__(self, OpportunityContact) IPatchable.__init__(self, OpportunityContact) + IPuttable.__init__(self, OpportunityContact) IPaginateable.__init__(self, OpportunityContact) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityContact]: """ Performs a GET request against the /sales/opportunities/{id}/contacts/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityContact, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityContact, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityContact: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/{id}/contacts/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OpportunityContact: The parsed response data. """ - return self._parse_one( - OpportunityContact, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityContact: """ - Performs a DELETE request against the /sales/opportunities/{id}/contacts/{id} endpoint. + Performs a GET request against the /sales/opportunities/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OpportunityContact: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OpportunityContact, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityContact: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OpportunityContact: """ - Performs a PUT request against the /sales/opportunities/{id}/contacts/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: OpportunityContact: The parsed response data. """ - return self._parse_one( - OpportunityContact, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(OpportunityContact, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityContact: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityContact: """ - Performs a PATCH request against the /sales/opportunities/{id}/contacts/{id} endpoint. + Performs a PUT request against the /sales/opportunities/{id}/contacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: OpportunityContact: The parsed response data. """ - return self._parse_one( - OpportunityContact, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OpportunityContact, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoagreementEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoagreementEndpoint.py index 621453adf..d558b1da4 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoagreementEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoagreementEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Agreement -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdConverttoagreementEndpoint( ConnectWiseEndpoint, IPostable[Agreement, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "convertToAgreement", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "convertToAgreement", parent_endpoint=parent_endpoint) IPostable.__init__(self, Agreement) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Agreement: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Agreement: """ Performs a POST request against the /sales/opportunities/{id}/convertToAgreement endpoint. @@ -32,6 +26,4 @@ def post( Returns: Agreement: The parsed response data. """ - return self._parse_one( - Agreement, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Agreement, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoprojectEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoprojectEndpoint.py index 674430cf0..1339cad32 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoprojectEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoprojectEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Project -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdConverttoprojectEndpoint( ConnectWiseEndpoint, IPostable[Project, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "convertToProject", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "convertToProject", parent_endpoint=parent_endpoint) IPostable.__init__(self, Project) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Project: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Project: """ Performs a POST request against the /sales/opportunities/{id}/convertToProject endpoint. @@ -32,6 +26,4 @@ def post( Returns: Project: The parsed response data. """ - return self._parse_one( - Project, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Project, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttosalesorderEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttosalesorderEndpoint.py index f648166fe..f34c04a08 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttosalesorderEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttosalesorderEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Order -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdConverttosalesorderEndpoint( ConnectWiseEndpoint, IPostable[Order, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "convertToSalesOrder", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "convertToSalesOrder", parent_endpoint=parent_endpoint) IPostable.__init__(self, Order) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Order: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Order: """ Performs a POST request against the /sales/opportunities/{id}/convertToSalesOrder endpoint. @@ -32,6 +26,4 @@ def post( Returns: Order: The parsed response data. """ - return self._parse_one( - Order, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Order, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoserviceticketEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoserviceticketEndpoint.py index ee77d77d3..3f168f488 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoserviceticketEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdConverttoserviceticketEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Ticket -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdConverttoserviceticketEndpoint( ConnectWiseEndpoint, IPostable[Ticket, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "convertToServiceTicket", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "convertToServiceTicket", parent_endpoint=parent_endpoint) IPostable.__init__(self, Ticket) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Ticket: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Ticket: """ Performs a POST request against the /sales/opportunities/{id}/convertToServiceTicket endpoint. @@ -32,6 +26,4 @@ def post( Returns: Ticket: The parsed response data. """ - return self._parse_one( - Ticket, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Ticket, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdEndpoint.py index 034ba13e9..122d0b655 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdEndpoint.py @@ -1,7 +1,7 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdContactsEndpoint import ( - SalesOpportunitiesIdContactsEndpoint, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdContactsEndpoint import SalesOpportunitiesIdContactsEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesIdConverttoagreementEndpoint import ( SalesOpportunitiesIdConverttoagreementEndpoint, ) @@ -14,80 +14,55 @@ from pyconnectwise.endpoints.manage.SalesOpportunitiesIdConverttoserviceticketEndpoint import ( SalesOpportunitiesIdConverttoserviceticketEndpoint, ) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdForecastEndpoint import ( - SalesOpportunitiesIdForecastEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdNotesEndpoint import ( - SalesOpportunitiesIdNotesEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdTeamEndpoint import ( - SalesOpportunitiesIdTeamEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdForecastEndpoint import SalesOpportunitiesIdForecastEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdNotesEndpoint import SalesOpportunitiesIdNotesEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdTeamEndpoint import SalesOpportunitiesIdTeamEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Opportunity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdEndpoint( ConnectWiseEndpoint, IGettable[Opportunity, ConnectWiseManageRequestParams], - IPuttable[Opportunity, ConnectWiseManageRequestParams], IPatchable[Opportunity, ConnectWiseManageRequestParams], + IPuttable[Opportunity, ConnectWiseManageRequestParams], IPaginateable[Opportunity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Opportunity) - IPuttable.__init__(self, Opportunity) IPatchable.__init__(self, Opportunity) + IPuttable.__init__(self, Opportunity) IPaginateable.__init__(self, Opportunity) - self.convert_to_sales_order = self._register_child_endpoint( - SalesOpportunitiesIdConverttosalesorderEndpoint( - client, parent_endpoint=self - ) + self.contacts = self._register_child_endpoint( + SalesOpportunitiesIdContactsEndpoint(client, parent_endpoint=self) ) - self.team = self._register_child_endpoint( - SalesOpportunitiesIdTeamEndpoint(client, parent_endpoint=self) + self.convert_to_agreement = self._register_child_endpoint( + SalesOpportunitiesIdConverttoagreementEndpoint(client, parent_endpoint=self) ) self.convert_to_project = self._register_child_endpoint( SalesOpportunitiesIdConverttoprojectEndpoint(client, parent_endpoint=self) ) - self.convert_to_agreement = self._register_child_endpoint( - SalesOpportunitiesIdConverttoagreementEndpoint(client, parent_endpoint=self) - ) - self.contacts = self._register_child_endpoint( - SalesOpportunitiesIdContactsEndpoint(client, parent_endpoint=self) + self.convert_to_sales_order = self._register_child_endpoint( + SalesOpportunitiesIdConverttosalesorderEndpoint(client, parent_endpoint=self) ) self.convert_to_service_ticket = self._register_child_endpoint( - SalesOpportunitiesIdConverttoserviceticketEndpoint( - client, parent_endpoint=self - ) + SalesOpportunitiesIdConverttoserviceticketEndpoint(client, parent_endpoint=self) ) self.forecast = self._register_child_endpoint( SalesOpportunitiesIdForecastEndpoint(client, parent_endpoint=self) ) - self.notes = self._register_child_endpoint( - SalesOpportunitiesIdNotesEndpoint(client, parent_endpoint=self) - ) + self.notes = self._register_child_endpoint(SalesOpportunitiesIdNotesEndpoint(client, parent_endpoint=self)) + self.team = self._register_child_endpoint(SalesOpportunitiesIdTeamEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Opportunity]: """ Performs a GET request against the /sales/opportunities/{id} endpoint and returns an initialized PaginatedResponse object. @@ -105,53 +80,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Opportunity, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Opportunity, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Opportunity: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Opportunity: The parsed response data. """ - return self._parse_one( - Opportunity, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Opportunity: """ - Performs a DELETE request against the /sales/opportunities/{id} endpoint. + Performs a GET request against the /sales/opportunities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Opportunity: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Opportunity, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Opportunity: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Opportunity: """ - Performs a PUT request against the /sales/opportunities/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -159,17 +115,11 @@ def put( Returns: Opportunity: The parsed response data. """ - return self._parse_one( - Opportunity, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Opportunity, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Opportunity: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Opportunity: """ - Performs a PATCH request against the /sales/opportunities/{id} endpoint. + Performs a PUT request against the /sales/opportunities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -177,6 +127,4 @@ def patch( Returns: Opportunity: The parsed response data. """ - return self._parse_one( - Opportunity, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Opportunity, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyEndpoint.py index 3e1b12d34..8aa5b60e4 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyEndpoint.py @@ -1,26 +1,27 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesIdForecastCopyIdEndpoint import ( SalesOpportunitiesIdForecastCopyIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SalesOpportunitiesIdForecastCopyEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) - def id(self, id: int) -> SalesOpportunitiesIdForecastCopyIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesIdForecastCopyIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesIdForecastCopyIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesIdForecastCopyIdEndpoint: The initialized SalesOpportunitiesIdForecastCopyIdEndpoint object. """ - child = SalesOpportunitiesIdForecastCopyIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SalesOpportunitiesIdForecastCopyIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyIdEndpoint.py index 4aec88f4a..421d6edfe 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCopyIdEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdForecastCopyIdEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /sales/opportunities/{id}/forecast/copy/{id} endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCountEndpoint.py index 24d9c62bb..f8a60e9ea 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdForecastCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesIdForecastCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/{id}/forecast/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/{id}/forecast/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastEndpoint.py index 0ad6eae7e..0a6875b7f 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesIdForecastCopyEndpoint import ( SalesOpportunitiesIdForecastCopyEndpoint, @@ -5,20 +7,14 @@ from pyconnectwise.endpoints.manage.SalesOpportunitiesIdForecastCountEndpoint import ( SalesOpportunitiesIdForecastCountEndpoint, ) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdForecastIdEndpoint import ( - SalesOpportunitiesIdForecastIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdForecastIdEndpoint import SalesOpportunitiesIdForecastIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Forecast from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdForecastEndpoint( @@ -27,10 +23,8 @@ class SalesOpportunitiesIdForecastEndpoint( IPostable[Forecast, ConnectWiseManageRequestParams], IPaginateable[Forecast, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "forecast", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "forecast", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Forecast]) IPostable.__init__(self, Forecast) IPaginateable.__init__(self, Forecast) @@ -42,26 +36,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SalesOpportunitiesIdForecastCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SalesOpportunitiesIdForecastIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesIdForecastIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesIdForecastIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesIdForecastIdEndpoint: The initialized SalesOpportunitiesIdForecastIdEndpoint object. """ - child = SalesOpportunitiesIdForecastIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SalesOpportunitiesIdForecastIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Forecast]: """ Performs a GET request against the /sales/opportunities/{id}/forecast endpoint and returns an initialized PaginatedResponse object. @@ -78,20 +67,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Forecast, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Forecast, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Forecast]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Forecast]: """ Performs a GET request against the /sales/opportunities/{id}/forecast endpoint. @@ -101,15 +79,9 @@ def get( Returns: list[Forecast]: The parsed response data. """ - return self._parse_many( - Forecast, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Forecast, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Forecast: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Forecast: """ Performs a POST request against the /sales/opportunities/{id}/forecast endpoint. @@ -119,6 +91,4 @@ def post( Returns: Forecast: The parsed response data. """ - return self._parse_one( - Forecast, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Forecast, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastIdEndpoint.py index b1dd58e3c..07d84f0cd 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdForecastIdEndpoint.py @@ -1,43 +1,33 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPostable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPostable, IPuttable from pyconnectwise.models.manage import ForecastItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdForecastIdEndpoint( ConnectWiseEndpoint, IGettable[ForecastItem, ConnectWiseManageRequestParams], + IPatchable[ForecastItem, ConnectWiseManageRequestParams], IPostable[ForecastItem, ConnectWiseManageRequestParams], IPuttable[ForecastItem, ConnectWiseManageRequestParams], - IPatchable[ForecastItem, ConnectWiseManageRequestParams], IPaginateable[ForecastItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ForecastItem) + IPatchable.__init__(self, ForecastItem) IPostable.__init__(self, ForecastItem) IPuttable.__init__(self, ForecastItem) - IPatchable.__init__(self, ForecastItem) IPaginateable.__init__(self, ForecastItem) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ForecastItem]: """ Performs a GET request against the /sales/opportunities/{id}/forecast/{id} endpoint and returns an initialized PaginatedResponse object. @@ -55,39 +45,22 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ForecastItem, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ForecastItem, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ForecastItem: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/{id}/forecast/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/{id}/forecast/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ForecastItem: The parsed response data. """ - return self._parse_one( - ForecastItem, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ForecastItem: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ForecastItem: """ - Performs a POST request against the /sales/opportunities/{id}/forecast/{id} endpoint. + Performs a GET request against the /sales/opportunities/{id}/forecast/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -95,31 +68,23 @@ def post( Returns: ForecastItem: The parsed response data. """ - return self._parse_one( - ForecastItem, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ForecastItem, super()._make_request("GET", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ForecastItem: """ - Performs a DELETE request against the /sales/opportunities/{id}/forecast/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/{id}/forecast/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ForecastItem: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ForecastItem, super()._make_request("PATCH", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ForecastItem: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ForecastItem: """ - Performs a PUT request against the /sales/opportunities/{id}/forecast/{id} endpoint. + Performs a POST request against the /sales/opportunities/{id}/forecast/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,17 +92,11 @@ def put( Returns: ForecastItem: The parsed response data. """ - return self._parse_one( - ForecastItem, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ForecastItem, super()._make_request("POST", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ForecastItem: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ForecastItem: """ - Performs a PATCH request against the /sales/opportunities/{id}/forecast/{id} endpoint. + Performs a PUT request against the /sales/opportunities/{id}/forecast/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -145,7 +104,4 @@ def patch( Returns: ForecastItem: The parsed response data. """ - return self._parse_one( - ForecastItem, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ForecastItem, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesCountEndpoint.py index 625a700f7..909d1e85d 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdNotesCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesIdNotesCountEndpoint( IGettable[list[OpportunityNote], ConnectWiseManageRequestParams], IPaginateable[OpportunityNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityNote]) IPaginateable.__init__(self, OpportunityNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityNote]: """ Performs a GET request against the /sales/opportunities/{id}/notes/count endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityNote, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityNote]: """ Performs a GET request against the /sales/opportunities/{id}/notes/count endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[OpportunityNote]: The parsed response data. """ - return self._parse_many( - OpportunityNote, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityNote, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesEndpoint.py index dde028cc9..5d8455205 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdNotesCountEndpoint import ( - SalesOpportunitiesIdNotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdNotesIdEndpoint import ( - SalesOpportunitiesIdNotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdNotesCountEndpoint import SalesOpportunitiesIdNotesCountEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdNotesIdEndpoint import SalesOpportunitiesIdNotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OpportunityNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdNotesEndpoint( @@ -24,36 +18,29 @@ class SalesOpportunitiesIdNotesEndpoint( IPostable[OpportunityNote, ConnectWiseManageRequestParams], IPaginateable[OpportunityNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityNote]) IPostable.__init__(self, OpportunityNote) IPaginateable.__init__(self, OpportunityNote) - self.count = self._register_child_endpoint( - SalesOpportunitiesIdNotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOpportunitiesIdNotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOpportunitiesIdNotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesIdNotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesIdNotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesIdNotesIdEndpoint: The initialized SalesOpportunitiesIdNotesIdEndpoint object. """ child = SalesOpportunitiesIdNotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityNote]: """ Performs a GET request against the /sales/opportunities/{id}/notes endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityNote, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityNote]: """ Performs a GET request against the /sales/opportunities/{id}/notes endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[OpportunityNote]: The parsed response data. """ - return self._parse_many( - OpportunityNote, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityNote: """ Performs a POST request against the /sales/opportunities/{id}/notes endpoint. @@ -112,7 +85,4 @@ def post( Returns: OpportunityNote: The parsed response data. """ - return self._parse_one( - OpportunityNote, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OpportunityNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesIdEndpoint.py index a89e837ee..b90b7268e 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdNotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OpportunityNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdNotesIdEndpoint( ConnectWiseEndpoint, IGettable[OpportunityNote, ConnectWiseManageRequestParams], - IPuttable[OpportunityNote, ConnectWiseManageRequestParams], IPatchable[OpportunityNote, ConnectWiseManageRequestParams], + IPuttable[OpportunityNote, ConnectWiseManageRequestParams], IPaginateable[OpportunityNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityNote) - IPuttable.__init__(self, OpportunityNote) IPatchable.__init__(self, OpportunityNote) + IPuttable.__init__(self, OpportunityNote) IPaginateable.__init__(self, OpportunityNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityNote]: """ Performs a GET request against the /sales/opportunities/{id}/notes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/{id}/notes/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OpportunityNote: The parsed response data. """ - return self._parse_one( - OpportunityNote, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityNote: """ - Performs a DELETE request against the /sales/opportunities/{id}/notes/{id} endpoint. + Performs a GET request against the /sales/opportunities/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OpportunityNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OpportunityNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OpportunityNote: """ - Performs a PUT request against the /sales/opportunities/{id}/notes/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: OpportunityNote: The parsed response data. """ - return self._parse_one( - OpportunityNote, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(OpportunityNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityNote: """ - Performs a PATCH request against the /sales/opportunities/{id}/notes/{id} endpoint. + Performs a PUT request against the /sales/opportunities/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: OpportunityNote: The parsed response data. """ - return self._parse_one( - OpportunityNote, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OpportunityNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamCountEndpoint.py index bc260c5d1..98e240cc8 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdTeamCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesIdTeamCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/{id}/team/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/{id}/team/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamEndpoint.py index 098f9e3ca..c26f4c7e4 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdTeamCountEndpoint import ( - SalesOpportunitiesIdTeamCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesIdTeamIdEndpoint import ( - SalesOpportunitiesIdTeamIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdTeamCountEndpoint import SalesOpportunitiesIdTeamCountEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesIdTeamIdEndpoint import SalesOpportunitiesIdTeamIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Team from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdTeamEndpoint( @@ -24,36 +18,29 @@ class SalesOpportunitiesIdTeamEndpoint( IPostable[Team, ConnectWiseManageRequestParams], IPaginateable[Team, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "team", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "team", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Team]) IPostable.__init__(self, Team) IPaginateable.__init__(self, Team) - self.count = self._register_child_endpoint( - SalesOpportunitiesIdTeamCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOpportunitiesIdTeamCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOpportunitiesIdTeamIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesIdTeamIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesIdTeamIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesIdTeamIdEndpoint: The initialized SalesOpportunitiesIdTeamIdEndpoint object. """ child = SalesOpportunitiesIdTeamIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Team]: """ Performs a GET request against the /sales/opportunities/{id}/team endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Team, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Team, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Team]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Team]: """ Performs a GET request against the /sales/opportunities/{id}/team endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Team]: The parsed response data. """ - return self._parse_many( - Team, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Team, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Team: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Team: """ Performs a POST request against the /sales/opportunities/{id}/team endpoint. @@ -111,6 +81,4 @@ def post( Returns: Team: The parsed response data. """ - return self._parse_one( - Team, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Team, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamIdEndpoint.py index 9943df9bd..c8e791d95 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesIdTeamIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Team from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesIdTeamIdEndpoint( ConnectWiseEndpoint, IGettable[Team, ConnectWiseManageRequestParams], - IPuttable[Team, ConnectWiseManageRequestParams], IPatchable[Team, ConnectWiseManageRequestParams], + IPuttable[Team, ConnectWiseManageRequestParams], IPaginateable[Team, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Team) - IPuttable.__init__(self, Team) IPatchable.__init__(self, Team) + IPuttable.__init__(self, Team) IPaginateable.__init__(self, Team) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Team]: """ Performs a GET request against the /sales/opportunities/{id}/team/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Team, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Team, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Team: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/{id}/team/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/{id}/team/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Team: The parsed response data. """ - return self._parse_one( - Team, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Team: """ - Performs a DELETE request against the /sales/opportunities/{id}/team/{id} endpoint. + Performs a GET request against the /sales/opportunities/{id}/team/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Team: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Team, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Team: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Team: """ - Performs a PUT request against the /sales/opportunities/{id}/team/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/{id}/team/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Team: The parsed response data. """ - return self._parse_one( - Team, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Team, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Team: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Team: """ - Performs a PATCH request against the /sales/opportunities/{id}/team/{id} endpoint. + Performs a PUT request against the /sales/opportunities/{id}/team/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Team: The parsed response data. """ - return self._parse_one( - Team, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Team, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsCountEndpoint.py index 775b1469b..e9ece4c44 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesRatingsCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesRatingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/ratings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/ratings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsEndpoint.py index d89d057d7..b74e240fe 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsCountEndpoint import ( - SalesOpportunitiesRatingsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsIdEndpoint import ( - SalesOpportunitiesRatingsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsInfoEndpoint import ( - SalesOpportunitiesRatingsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsCountEndpoint import SalesOpportunitiesRatingsCountEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsIdEndpoint import SalesOpportunitiesRatingsIdEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsInfoEndpoint import SalesOpportunitiesRatingsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OpportunityRating from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesRatingsEndpoint( @@ -27,39 +19,30 @@ class SalesOpportunitiesRatingsEndpoint( IPostable[OpportunityRating, ConnectWiseManageRequestParams], IPaginateable[OpportunityRating, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ratings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ratings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityRating]) IPostable.__init__(self, OpportunityRating) IPaginateable.__init__(self, OpportunityRating) - self.count = self._register_child_endpoint( - SalesOpportunitiesRatingsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SalesOpportunitiesRatingsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOpportunitiesRatingsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SalesOpportunitiesRatingsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOpportunitiesRatingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesRatingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesRatingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesRatingsIdEndpoint: The initialized SalesOpportunitiesRatingsIdEndpoint object. """ child = SalesOpportunitiesRatingsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityRating]: """ Performs a GET request against the /sales/opportunities/ratings endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityRating, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityRating, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityRating]: """ Performs a GET request against the /sales/opportunities/ratings endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[OpportunityRating]: The parsed response data. """ - return self._parse_many( - OpportunityRating, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityRating, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityRating: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityRating: """ Performs a POST request against the /sales/opportunities/ratings endpoint. @@ -118,7 +87,4 @@ def post( Returns: OpportunityRating: The parsed response data. """ - return self._parse_one( - OpportunityRating, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OpportunityRating, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdEndpoint.py index 2de8d67fe..fe02c6ee2 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdEndpoint.py @@ -1,47 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsIdInfoEndpoint import ( SalesOpportunitiesRatingsIdInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OpportunityRating from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesRatingsIdEndpoint( ConnectWiseEndpoint, IGettable[OpportunityRating, ConnectWiseManageRequestParams], - IPuttable[OpportunityRating, ConnectWiseManageRequestParams], IPatchable[OpportunityRating, ConnectWiseManageRequestParams], + IPuttable[OpportunityRating, ConnectWiseManageRequestParams], IPaginateable[OpportunityRating, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityRating) - IPuttable.__init__(self, OpportunityRating) IPatchable.__init__(self, OpportunityRating) + IPuttable.__init__(self, OpportunityRating) IPaginateable.__init__(self, OpportunityRating) - self.info = self._register_child_endpoint( - SalesOpportunitiesRatingsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SalesOpportunitiesRatingsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityRating]: """ Performs a GET request against the /sales/opportunities/ratings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityRating, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityRating, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityRating: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/ratings/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/ratings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OpportunityRating: The parsed response data. """ - return self._parse_one( - OpportunityRating, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityRating: """ - Performs a DELETE request against the /sales/opportunities/ratings/{id} endpoint. + Performs a GET request against the /sales/opportunities/ratings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OpportunityRating: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OpportunityRating, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityRating: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OpportunityRating: """ - Performs a PUT request against the /sales/opportunities/ratings/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/ratings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +83,11 @@ def put( Returns: OpportunityRating: The parsed response data. """ - return self._parse_one( - OpportunityRating, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(OpportunityRating, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityRating: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityRating: """ - Performs a PATCH request against the /sales/opportunities/ratings/{id} endpoint. + Performs a PUT request against the /sales/opportunities/ratings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +95,4 @@ def patch( Returns: OpportunityRating: The parsed response data. """ - return self._parse_one( - OpportunityRating, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OpportunityRating, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdInfoEndpoint.py index 819a1d0a9..917a0bc1f 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityRatingInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesRatingsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesRatingsIdInfoEndpoint( IGettable[OpportunityRatingInfo, ConnectWiseManageRequestParams], IPaginateable[OpportunityRatingInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityRatingInfo) IPaginateable.__init__(self, OpportunityRatingInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityRatingInfo]: """ Performs a GET request against the /sales/opportunities/ratings/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityRatingInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityRatingInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OpportunityRatingInfo: """ Performs a GET request against the /sales/opportunities/ratings/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: OpportunityRatingInfo: The parsed response data. """ - return self._parse_one( - OpportunityRatingInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(OpportunityRatingInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoCountEndpoint.py index e52354b60..990f26ac9 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesRatingsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesRatingsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/ratings/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/ratings/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoEndpoint.py index 8927b76b1..fd6cdfbde 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesRatingsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesRatingsInfoCountEndpoint import ( SalesOpportunitiesRatingsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityRatingInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesRatingsInfoEndpoint( @@ -19,10 +18,8 @@ class SalesOpportunitiesRatingsInfoEndpoint( IGettable[list[OpportunityRatingInfo], ConnectWiseManageRequestParams], IPaginateable[OpportunityRatingInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityRatingInfo]) IPaginateable.__init__(self, OpportunityRatingInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityRatingInfo]: """ Performs a GET request against the /sales/opportunities/ratings/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityRatingInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityRatingInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityRatingInfo]: """ Performs a GET request against the /sales/opportunities/ratings/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[OpportunityRatingInfo]: The parsed response data. """ - return self._parse_many( - OpportunityRatingInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityRatingInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesCountEndpoint.py index 3227c3c02..969344bf5 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesEndpoint.py index a9ed4bd05..05a7b8cad 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesEndpoint.py @@ -1,24 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesCountEndpoint import ( SalesOpportunitiesStatusesCountEndpoint, ) -from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesIdEndpoint import ( - SalesOpportunitiesStatusesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesInfoEndpoint import ( - SalesOpportunitiesStatusesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesIdEndpoint import SalesOpportunitiesStatusesIdEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesInfoEndpoint import SalesOpportunitiesStatusesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OpportunityStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesEndpoint( @@ -27,10 +21,8 @@ class SalesOpportunitiesStatusesEndpoint( IPostable[OpportunityStatus, ConnectWiseManageRequestParams], IPaginateable[OpportunityStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityStatus]) IPostable.__init__(self, OpportunityStatus) IPaginateable.__init__(self, OpportunityStatus) @@ -38,28 +30,23 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 self.count = self._register_child_endpoint( SalesOpportunitiesStatusesCountEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - SalesOpportunitiesStatusesInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SalesOpportunitiesStatusesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOpportunitiesStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesStatusesIdEndpoint: The initialized SalesOpportunitiesStatusesIdEndpoint object. """ child = SalesOpportunitiesStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStatus]: """ Performs a GET request against the /sales/opportunities/statuses endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityStatus]: """ Performs a GET request against the /sales/opportunities/statuses endpoint. @@ -99,16 +79,9 @@ def get( Returns: list[OpportunityStatus]: The parsed response data. """ - return self._parse_many( - OpportunityStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStatus: """ Performs a POST request against the /sales/opportunities/statuses endpoint. @@ -118,7 +91,4 @@ def post( Returns: OpportunityStatus: The parsed response data. """ - return self._parse_one( - OpportunityStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdEndpoint.py index adcc7b20a..4aaaf6513 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesIdInfoEndpoint import ( SalesOpportunitiesStatusesIdInfoEndpoint, @@ -5,49 +7,38 @@ from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesIdUsagesEndpoint import ( SalesOpportunitiesStatusesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OpportunityStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[OpportunityStatus, ConnectWiseManageRequestParams], - IPuttable[OpportunityStatus, ConnectWiseManageRequestParams], IPatchable[OpportunityStatus, ConnectWiseManageRequestParams], + IPuttable[OpportunityStatus, ConnectWiseManageRequestParams], IPaginateable[OpportunityStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityStatus) - IPuttable.__init__(self, OpportunityStatus) IPatchable.__init__(self, OpportunityStatus) + IPuttable.__init__(self, OpportunityStatus) IPaginateable.__init__(self, OpportunityStatus) - self.usages = self._register_child_endpoint( - SalesOpportunitiesStatusesIdUsagesEndpoint(client, parent_endpoint=self) - ) self.info = self._register_child_endpoint( SalesOpportunitiesStatusesIdInfoEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint( + SalesOpportunitiesStatusesIdUsagesEndpoint(client, parent_endpoint=self) + ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStatus]: """ Performs a GET request against the /sales/opportunities/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +56,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/statuses/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OpportunityStatus: The parsed response data. """ - return self._parse_one( - OpportunityStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStatus: """ - Performs a DELETE request against the /sales/opportunities/statuses/{id} endpoint. + Performs a GET request against the /sales/opportunities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OpportunityStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OpportunityStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStatus: """ - Performs a PUT request against the /sales/opportunities/statuses/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +91,11 @@ def put( Returns: OpportunityStatus: The parsed response data. """ - return self._parse_one( - OpportunityStatus, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStatus: """ - Performs a PATCH request against the /sales/opportunities/statuses/{id} endpoint. + Performs a PUT request against the /sales/opportunities/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +103,4 @@ def patch( Returns: OpportunityStatus: The parsed response data. """ - return self._parse_one( - OpportunityStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdInfoEndpoint.py index 14f93a901..651565691 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesStatusesIdInfoEndpoint( IGettable[OpportunityStatusInfo, ConnectWiseManageRequestParams], IPaginateable[OpportunityStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityStatusInfo) IPaginateable.__init__(self, OpportunityStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStatusInfo]: """ Performs a GET request against the /sales/opportunities/statuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OpportunityStatusInfo: """ Performs a GET request against the /sales/opportunities/statuses/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: OpportunityStatusInfo: The parsed response data. """ - return self._parse_one( - OpportunityStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesEndpoint.py index 4e97ee990..68f74e4af 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesIdUsagesListEndpoint import ( SalesOpportunitiesStatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class SalesOpportunitiesStatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/opportunities/statuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/opportunities/statuses/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesListEndpoint.py index bb9288545..01a76ce70 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesStatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/opportunities/statuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/opportunities/statuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoCountEndpoint.py index 50bbb9128..32108e35a 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesStatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/statuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/statuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoEndpoint.py index 6edfaecd5..34b985ea6 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesStatusesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesStatusesInfoCountEndpoint import ( SalesOpportunitiesStatusesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesStatusesInfoEndpoint( @@ -19,10 +18,8 @@ class SalesOpportunitiesStatusesInfoEndpoint( IGettable[list[OpportunityStatusInfo], ConnectWiseManageRequestParams], IPaginateable[OpportunityStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityStatusInfo]) IPaginateable.__init__(self, OpportunityStatusInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStatusInfo]: """ Performs a GET request against the /sales/opportunities/statuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityStatusInfo]: """ Performs a GET request against the /sales/opportunities/statuses/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[OpportunityStatusInfo]: The parsed response data. """ - return self._parse_many( - OpportunityStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesCountEndpoint.py index e2d5edf8e..6cccfd29e 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesEndpoint.py index 1e2c895ed..fbbd7cb82 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesCountEndpoint import ( - SalesOpportunitiesTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesIdEndpoint import ( - SalesOpportunitiesTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesInfoEndpoint import ( - SalesOpportunitiesTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesCountEndpoint import SalesOpportunitiesTypesCountEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesIdEndpoint import SalesOpportunitiesTypesIdEndpoint +from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesInfoEndpoint import SalesOpportunitiesTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OpportunityType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesEndpoint( @@ -27,39 +19,30 @@ class SalesOpportunitiesTypesEndpoint( IPostable[OpportunityType, ConnectWiseManageRequestParams], IPaginateable[OpportunityType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityType]) IPostable.__init__(self, OpportunityType) IPaginateable.__init__(self, OpportunityType) - self.count = self._register_child_endpoint( - SalesOpportunitiesTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SalesOpportunitiesTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOpportunitiesTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SalesOpportunitiesTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOpportunitiesTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOpportunitiesTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOpportunitiesTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOpportunitiesTypesIdEndpoint: The initialized SalesOpportunitiesTypesIdEndpoint object. """ child = SalesOpportunitiesTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityType]: """ Performs a GET request against the /sales/opportunities/types endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityType]: """ Performs a GET request against the /sales/opportunities/types endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[OpportunityType]: The parsed response data. """ - return self._parse_many( - OpportunityType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityType: """ Performs a POST request against the /sales/opportunities/types endpoint. @@ -118,7 +87,4 @@ def post( Returns: OpportunityType: The parsed response data. """ - return self._parse_one( - OpportunityType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OpportunityType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdEndpoint.py index 4e4397700..8c1b4e85b 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdEndpoint.py @@ -1,53 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesIdInfoEndpoint import ( - SalesOpportunitiesTypesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesIdInfoEndpoint import SalesOpportunitiesTypesIdInfoEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesIdUsagesEndpoint import ( SalesOpportunitiesTypesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OpportunityType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesIdEndpoint( ConnectWiseEndpoint, IGettable[OpportunityType, ConnectWiseManageRequestParams], - IPuttable[OpportunityType, ConnectWiseManageRequestParams], IPatchable[OpportunityType, ConnectWiseManageRequestParams], + IPuttable[OpportunityType, ConnectWiseManageRequestParams], IPaginateable[OpportunityType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityType) - IPuttable.__init__(self, OpportunityType) IPatchable.__init__(self, OpportunityType) + IPuttable.__init__(self, OpportunityType) IPaginateable.__init__(self, OpportunityType) + self.info = self._register_child_endpoint(SalesOpportunitiesTypesIdInfoEndpoint(client, parent_endpoint=self)) self.usages = self._register_child_endpoint( SalesOpportunitiesTypesIdUsagesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - SalesOpportunitiesTypesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityType]: """ Performs a GET request against the /sales/opportunities/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +52,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/opportunities/types/{id} endpoint. + Performs a DELETE request against the /sales/opportunities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OpportunityType: The parsed response data. """ - return self._parse_one( - OpportunityType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityType: """ - Performs a DELETE request against the /sales/opportunities/types/{id} endpoint. + Performs a GET request against the /sales/opportunities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OpportunityType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OpportunityType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OpportunityType: """ - Performs a PUT request against the /sales/opportunities/types/{id} endpoint. + Performs a PATCH request against the /sales/opportunities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +87,11 @@ def put( Returns: OpportunityType: The parsed response data. """ - return self._parse_one( - OpportunityType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(OpportunityType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityType: """ - Performs a PATCH request against the /sales/opportunities/types/{id} endpoint. + Performs a PUT request against the /sales/opportunities/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +99,4 @@ def patch( Returns: OpportunityType: The parsed response data. """ - return self._parse_one( - OpportunityType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OpportunityType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdInfoEndpoint.py index 422193753..c4ba3d2bf 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesTypesIdInfoEndpoint( IGettable[OpportunityTypeInfo, ConnectWiseManageRequestParams], IPaginateable[OpportunityTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityTypeInfo) IPaginateable.__init__(self, OpportunityTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityTypeInfo]: """ Performs a GET request against the /sales/opportunities/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OpportunityTypeInfo: """ Performs a GET request against the /sales/opportunities/types/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: OpportunityTypeInfo: The parsed response data. """ - return self._parse_one( - OpportunityTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(OpportunityTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesEndpoint.py index a96ee4b20..2abf31a45 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesIdUsagesListEndpoint import ( SalesOpportunitiesTypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class SalesOpportunitiesTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/opportunities/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/opportunities/types/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesListEndpoint.py index 488334a9a..c8884e82c 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/opportunities/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/opportunities/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoCountEndpoint.py index 7e8d83d9b..6b5831d76 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesOpportunitiesTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/opportunities/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/opportunities/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoEndpoint.py index 7be42b2e1..47ddd5289 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOpportunitiesTypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOpportunitiesTypesInfoCountEndpoint import ( SalesOpportunitiesTypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOpportunitiesTypesInfoEndpoint( @@ -19,10 +18,8 @@ class SalesOpportunitiesTypesInfoEndpoint( IGettable[list[OpportunityTypeInfo], ConnectWiseManageRequestParams], IPaginateable[OpportunityTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityTypeInfo]) IPaginateable.__init__(self, OpportunityTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityTypeInfo]: """ Performs a GET request against the /sales/opportunities/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityTypeInfo]: """ Performs a GET request against the /sales/opportunities/types/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[OpportunityTypeInfo]: The parsed response data. """ - return self._parse_many( - OpportunityTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersCountEndpoint.py index f4b23a20e..0cfd5b661 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersCountEndpoint( @@ -16,18 +15,13 @@ class SalesOrdersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/orders/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/orders/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersEndpoint.py index b171f239d..9fce28312 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersEndpoint.py @@ -1,22 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOrdersCountEndpoint import ( - SalesOrdersCountEndpoint, -) +from pyconnectwise.endpoints.manage.SalesOrdersCountEndpoint import SalesOrdersCountEndpoint from pyconnectwise.endpoints.manage.SalesOrdersIdEndpoint import SalesOrdersIdEndpoint -from pyconnectwise.endpoints.manage.SalesOrdersStatusesEndpoint import ( - SalesOrdersStatusesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOrdersStatusesEndpoint import SalesOrdersStatusesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Order from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersEndpoint( @@ -25,39 +19,30 @@ class SalesOrdersEndpoint( IPostable[Order, ConnectWiseManageRequestParams], IPaginateable[Order, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "orders", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "orders", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Order]) IPostable.__init__(self, Order) IPaginateable.__init__(self, Order) - self.count = self._register_child_endpoint( - SalesOrdersCountEndpoint(client, parent_endpoint=self) - ) - self.statuses = self._register_child_endpoint( - SalesOrdersStatusesEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOrdersCountEndpoint(client, parent_endpoint=self)) + self.statuses = self._register_child_endpoint(SalesOrdersStatusesEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOrdersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOrdersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOrdersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOrdersIdEndpoint: The initialized SalesOrdersIdEndpoint object. """ child = SalesOrdersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Order]: """ Performs a GET request against the /sales/orders endpoint and returns an initialized PaginatedResponse object. @@ -74,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Order, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Order, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Order]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Order]: """ Performs a GET request against the /sales/orders endpoint. @@ -97,15 +71,9 @@ def get( Returns: list[Order]: The parsed response data. """ - return self._parse_many( - Order, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Order, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Order: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Order: """ Performs a POST request against the /sales/orders endpoint. @@ -115,6 +83,4 @@ def post( Returns: Order: The parsed response data. """ - return self._parse_one( - Order, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Order, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersIdConverttoserviceticketEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersIdConverttoserviceticketEndpoint.py index 987daf94d..847cea5a4 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersIdConverttoserviceticketEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersIdConverttoserviceticketEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Ticket -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersIdConverttoserviceticketEndpoint( ConnectWiseEndpoint, IPostable[Ticket, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "convertToServiceTicket", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "convertToServiceTicket", parent_endpoint=parent_endpoint) IPostable.__init__(self, Ticket) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Ticket: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Ticket: """ Performs a POST request against the /sales/orders/{id}/convertToServiceTicket endpoint. @@ -32,6 +26,4 @@ def post( Returns: Ticket: The parsed response data. """ - return self._parse_one( - Ticket, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Ticket, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersIdEndpoint.py index 1ee820bea..7ed2d1429 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOrdersIdConverttoserviceticketEndpoint import ( SalesOrdersIdConverttoserviceticketEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Order from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersIdEndpoint( ConnectWiseEndpoint, IGettable[Order, ConnectWiseManageRequestParams], - IPuttable[Order, ConnectWiseManageRequestParams], IPatchable[Order, ConnectWiseManageRequestParams], + IPuttable[Order, ConnectWiseManageRequestParams], IPaginateable[Order, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Order) - IPuttable.__init__(self, Order) IPatchable.__init__(self, Order) + IPuttable.__init__(self, Order) IPaginateable.__init__(self, Order) self.convert_to_service_ticket = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Order]: """ Performs a GET request against the /sales/orders/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +49,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Order, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Order, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Order: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/orders/{id} endpoint. + Performs a DELETE request against the /sales/orders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Order: The parsed response data. """ - return self._parse_one( - Order, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Order: """ - Performs a DELETE request against the /sales/orders/{id} endpoint. + Performs a GET request against the /sales/orders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Order: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Order, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Order: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Order: """ - Performs a PUT request against the /sales/orders/{id} endpoint. + Performs a PATCH request against the /sales/orders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +83,11 @@ def put( Returns: Order: The parsed response data. """ - return self._parse_one( - Order, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Order, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Order: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Order: """ - Performs a PATCH request against the /sales/orders/{id} endpoint. + Performs a PUT request against the /sales/orders/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +95,4 @@ def patch( Returns: Order: The parsed response data. """ - return self._parse_one( - Order, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Order, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesCountEndpoint.py index a02272a4c..a3edcebf5 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesCountEndpoint( @@ -16,18 +15,13 @@ class SalesOrdersStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/orders/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/orders/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesEndpoint.py index e7553c3a5..1597aa700 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOrdersStatusesCountEndpoint import ( - SalesOrdersStatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdEndpoint import ( - SalesOrdersStatusesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesOrdersStatusesInfoEndpoint import ( - SalesOrdersStatusesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesOrdersStatusesCountEndpoint import SalesOrdersStatusesCountEndpoint +from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdEndpoint import SalesOrdersStatusesIdEndpoint +from pyconnectwise.endpoints.manage.SalesOrdersStatusesInfoEndpoint import SalesOrdersStatusesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OrderStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesEndpoint( @@ -27,39 +19,30 @@ class SalesOrdersStatusesEndpoint( IPostable[list[OrderStatus], ConnectWiseManageRequestParams], IPaginateable[OrderStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OrderStatus]) IPostable.__init__(self, list[OrderStatus]) IPaginateable.__init__(self, OrderStatus) - self.count = self._register_child_endpoint( - SalesOrdersStatusesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SalesOrdersStatusesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOrdersStatusesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SalesOrdersStatusesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesOrdersStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOrdersStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOrdersStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOrdersStatusesIdEndpoint: The initialized SalesOrdersStatusesIdEndpoint object. """ child = SalesOrdersStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OrderStatus]: """ Performs a GET request against the /sales/orders/statuses endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OrderStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OrderStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[OrderStatus]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[OrderStatus]: """ Performs a GET request against the /sales/orders/statuses endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[OrderStatus]: The parsed response data. """ - return self._parse_many( - OrderStatus, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(OrderStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[OrderStatus]: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[OrderStatus]: """ Performs a POST request against the /sales/orders/statuses endpoint. @@ -117,6 +85,4 @@ def post( Returns: list[OrderStatus]: The parsed response data. """ - return self._parse_many( - OrderStatus, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_many(OrderStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesCountEndpoint.py index f2fe218e1..04abc0a41 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdEmailtemplatesCountEndpoint( @@ -16,18 +15,13 @@ class SalesOrdersStatusesIdEmailtemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/orders/statuses/{id}/emailtemplates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/orders/statuses/{id}/emailtemplates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesEndpoint.py index 962f68956..4115df90c 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdEmailtemplatesCountEndpoint import ( SalesOrdersStatusesIdEmailtemplatesCountEndpoint, @@ -6,32 +8,27 @@ SalesOrdersStatusesIdEmailtemplatesIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SalesOrdersStatusesIdEmailtemplatesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailtemplates", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailtemplates", parent_endpoint=parent_endpoint) self.count = self._register_child_endpoint( - SalesOrdersStatusesIdEmailtemplatesCountEndpoint( - client, parent_endpoint=self - ) + SalesOrdersStatusesIdEmailtemplatesCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> SalesOrdersStatusesIdEmailtemplatesIdEndpoint: + def id(self, _id: int) -> SalesOrdersStatusesIdEmailtemplatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOrdersStatusesIdEmailtemplatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOrdersStatusesIdEmailtemplatesIdEndpoint: The initialized SalesOrdersStatusesIdEmailtemplatesIdEndpoint object. """ - child = SalesOrdersStatusesIdEmailtemplatesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SalesOrdersStatusesIdEmailtemplatesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesIdEndpoint.py index 99a4a416a..fedd44b11 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEmailtemplatesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OrderStatusEmailTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdEmailtemplatesIdEndpoint( ConnectWiseEndpoint, IGettable[OrderStatusEmailTemplate, ConnectWiseManageRequestParams], - IPuttable[OrderStatusEmailTemplate, ConnectWiseManageRequestParams], IPatchable[OrderStatusEmailTemplate, ConnectWiseManageRequestParams], + IPuttable[OrderStatusEmailTemplate, ConnectWiseManageRequestParams], IPaginateable[OrderStatusEmailTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OrderStatusEmailTemplate) - IPuttable.__init__(self, OrderStatusEmailTemplate) IPatchable.__init__(self, OrderStatusEmailTemplate) + IPuttable.__init__(self, OrderStatusEmailTemplate) IPaginateable.__init__(self, OrderStatusEmailTemplate) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OrderStatusEmailTemplate]: """ Performs a GET request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OrderStatusEmailTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OrderStatusEmailTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OrderStatusEmailTemplate: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. + Performs a DELETE request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OrderStatusEmailTemplate: The parsed response data. """ - return self._parse_one( - OrderStatusEmailTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> OrderStatusEmailTemplate: """ - Performs a DELETE request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. + Performs a GET request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OrderStatusEmailTemplate: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OrderStatusEmailTemplate, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> OrderStatusEmailTemplate: """ - Performs a PUT request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. + Performs a PATCH request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +83,14 @@ def put( OrderStatusEmailTemplate: The parsed response data. """ return self._parse_one( - OrderStatusEmailTemplate, - super()._make_request("PUT", data=data, params=params).json(), + OrderStatusEmailTemplate, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OrderStatusEmailTemplate: """ - Performs a PATCH request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. + Performs a PUT request against the /sales/orders/statuses/{id}/emailtemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +98,4 @@ def patch( Returns: OrderStatusEmailTemplate: The parsed response data. """ - return self._parse_one( - OrderStatusEmailTemplate, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OrderStatusEmailTemplate, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEndpoint.py index 41bbd50ac..cb5cf2a09 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdEndpoint.py @@ -1,65 +1,48 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdEmailtemplatesEndpoint import ( SalesOrdersStatusesIdEmailtemplatesEndpoint, ) -from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdInfoEndpoint import ( - SalesOrdersStatusesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdInfoEndpoint import SalesOrdersStatusesIdInfoEndpoint from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdNotificationsEndpoint import ( SalesOrdersStatusesIdNotificationsEndpoint, ) -from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdUsagesEndpoint import ( - SalesOrdersStatusesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdUsagesEndpoint import SalesOrdersStatusesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OrderStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[OrderStatus, ConnectWiseManageRequestParams], - IPuttable[OrderStatus, ConnectWiseManageRequestParams], IPatchable[OrderStatus, ConnectWiseManageRequestParams], + IPuttable[OrderStatus, ConnectWiseManageRequestParams], IPaginateable[OrderStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OrderStatus) - IPuttable.__init__(self, OrderStatus) IPatchable.__init__(self, OrderStatus) + IPuttable.__init__(self, OrderStatus) IPaginateable.__init__(self, OrderStatus) - self.usages = self._register_child_endpoint( - SalesOrdersStatusesIdUsagesEndpoint(client, parent_endpoint=self) - ) self.emailtemplates = self._register_child_endpoint( SalesOrdersStatusesIdEmailtemplatesEndpoint(client, parent_endpoint=self) ) + self.info = self._register_child_endpoint(SalesOrdersStatusesIdInfoEndpoint(client, parent_endpoint=self)) self.notifications = self._register_child_endpoint( SalesOrdersStatusesIdNotificationsEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - SalesOrdersStatusesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(SalesOrdersStatusesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OrderStatus]: """ Performs a GET request against the /sales/orders/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -77,53 +60,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OrderStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OrderStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OrderStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/orders/statuses/{id} endpoint. + Performs a DELETE request against the /sales/orders/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OrderStatus: The parsed response data. """ - return self._parse_one( - OrderStatus, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OrderStatus: """ - Performs a DELETE request against the /sales/orders/statuses/{id} endpoint. + Performs a GET request against the /sales/orders/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OrderStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OrderStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OrderStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OrderStatus: """ - Performs a PUT request against the /sales/orders/statuses/{id} endpoint. + Performs a PATCH request against the /sales/orders/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,17 +95,11 @@ def put( Returns: OrderStatus: The parsed response data. """ - return self._parse_one( - OrderStatus, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(OrderStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OrderStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OrderStatus: """ - Performs a PATCH request against the /sales/orders/statuses/{id} endpoint. + Performs a PUT request against the /sales/orders/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -149,6 +107,4 @@ def patch( Returns: OrderStatus: The parsed response data. """ - return self._parse_one( - OrderStatus, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(OrderStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdInfoEndpoint.py index 9f56f7ad8..62627047c 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OrderStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SalesOrdersStatusesIdInfoEndpoint( IGettable[OrderStatusInfo, ConnectWiseManageRequestParams], IPaginateable[OrderStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, OrderStatusInfo) IPaginateable.__init__(self, OrderStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OrderStatusInfo]: """ Performs a GET request against the /sales/orders/statuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OrderStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OrderStatusInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OrderStatusInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OrderStatusInfo: """ Performs a GET request against the /sales/orders/statuses/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: OrderStatusInfo: The parsed response data. """ - return self._parse_one( - OrderStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(OrderStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsCountEndpoint.py index 1be6a1ee7..d08e5055d 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdNotificationsCountEndpoint( @@ -16,18 +15,13 @@ class SalesOrdersStatusesIdNotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/orders/statuses/{id}/notifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/orders/statuses/{id}/notifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsEndpoint.py index 037f4a6d3..7b24c85f2 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdNotificationsCountEndpoint import ( SalesOrdersStatusesIdNotificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdNotificationsIdEndpoint import ( SalesOrdersStatusesIdNotificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OrderStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdNotificationsEndpoint( @@ -24,40 +22,31 @@ class SalesOrdersStatusesIdNotificationsEndpoint( IPostable[OrderStatusNotification, ConnectWiseManageRequestParams], IPaginateable[OrderStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OrderStatusNotification]) IPostable.__init__(self, OrderStatusNotification) IPaginateable.__init__(self, OrderStatusNotification) self.count = self._register_child_endpoint( - SalesOrdersStatusesIdNotificationsCountEndpoint( - client, parent_endpoint=self - ) + SalesOrdersStatusesIdNotificationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SalesOrdersStatusesIdNotificationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesOrdersStatusesIdNotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesOrdersStatusesIdNotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesOrdersStatusesIdNotificationsIdEndpoint: The initialized SalesOrdersStatusesIdNotificationsIdEndpoint object. """ - child = SalesOrdersStatusesIdNotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SalesOrdersStatusesIdNotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OrderStatusNotification]: """ Performs a GET request against the /sales/orders/statuses/{id}/notifications endpoint and returns an initialized PaginatedResponse object. @@ -75,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OrderStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OrderStatusNotification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OrderStatusNotification]: """ Performs a GET request against the /sales/orders/statuses/{id}/notifications endpoint. @@ -97,15 +79,10 @@ def get( Returns: list[OrderStatusNotification]: The parsed response data. """ - return self._parse_many( - OrderStatusNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OrderStatusNotification, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OrderStatusNotification: """ Performs a POST request against the /sales/orders/statuses/{id}/notifications endpoint. @@ -116,7 +93,4 @@ def post( Returns: OrderStatusNotification: The parsed response data. """ - return self._parse_one( - OrderStatusNotification, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OrderStatusNotification, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsIdEndpoint.py index 8f7ac7293..ffa22ac1e 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdNotificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OrderStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdNotificationsIdEndpoint( ConnectWiseEndpoint, IGettable[OrderStatusNotification, ConnectWiseManageRequestParams], - IPuttable[OrderStatusNotification, ConnectWiseManageRequestParams], IPatchable[OrderStatusNotification, ConnectWiseManageRequestParams], + IPuttable[OrderStatusNotification, ConnectWiseManageRequestParams], IPaginateable[OrderStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OrderStatusNotification) - IPuttable.__init__(self, OrderStatusNotification) IPatchable.__init__(self, OrderStatusNotification) + IPuttable.__init__(self, OrderStatusNotification) IPaginateable.__init__(self, OrderStatusNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OrderStatusNotification]: """ Performs a GET request against the /sales/orders/statuses/{id}/notifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OrderStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OrderStatusNotification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OrderStatusNotification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. + Performs a DELETE request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OrderStatusNotification: The parsed response data. """ - return self._parse_one( - OrderStatusNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> OrderStatusNotification: """ - Performs a DELETE request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. + Performs a GET request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OrderStatusNotification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OrderStatusNotification, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> OrderStatusNotification: """ - Performs a PUT request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. + Performs a PATCH request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: OrderStatusNotification: The parsed response data. """ - return self._parse_one( - OrderStatusNotification, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(OrderStatusNotification, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OrderStatusNotification: """ - Performs a PATCH request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. + Performs a PUT request against the /sales/orders/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: OrderStatusNotification: The parsed response data. """ - return self._parse_one( - OrderStatusNotification, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OrderStatusNotification, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesEndpoint.py index 6354f90f9..1223d1920 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesOrdersStatusesIdUsagesListEndpoint import ( SalesOrdersStatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdUsagesEndpoint( @@ -19,22 +18,15 @@ class SalesOrdersStatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - SalesOrdersStatusesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(SalesOrdersStatusesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/orders/statuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +43,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/orders/statuses/{id}/usages endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesListEndpoint.py index 76078a20f..f3f697d95 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SalesOrdersStatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/orders/statuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/orders/statuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoCountEndpoint.py index e3970bdce..83f376ee0 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesOrdersStatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/orders/statuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/orders/statuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoEndpoint.py index 152f3ef53..0c9a7a22a 100644 --- a/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesOrdersStatusesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesOrdersStatusesInfoCountEndpoint import ( - SalesOrdersStatusesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SalesOrdersStatusesInfoCountEndpoint import SalesOrdersStatusesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OrderStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesOrdersStatusesInfoEndpoint( @@ -19,22 +16,15 @@ class SalesOrdersStatusesInfoEndpoint( IGettable[list[OrderStatusInfo], ConnectWiseManageRequestParams], IPaginateable[OrderStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OrderStatusInfo]) IPaginateable.__init__(self, OrderStatusInfo) - self.count = self._register_child_endpoint( - SalesOrdersStatusesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesOrdersStatusesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OrderStatusInfo]: """ Performs a GET request against the /sales/orders/statuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OrderStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OrderStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OrderStatusInfo]: """ Performs a GET request against the /sales/orders/statuses/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[OrderStatusInfo]: The parsed response data. """ - return self._parse_many( - OrderStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OrderStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesCountEndpoint.py index e0bb89983..63ba60cd5 100644 --- a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesProbabilitiesCountEndpoint( @@ -16,18 +15,13 @@ class SalesProbabilitiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/probabilities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/probabilities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesEndpoint.py index 68f937650..05cd8b992 100644 --- a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesProbabilitiesCountEndpoint import ( - SalesProbabilitiesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesProbabilitiesIdEndpoint import ( - SalesProbabilitiesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesProbabilitiesInfoEndpoint import ( - SalesProbabilitiesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesProbabilitiesCountEndpoint import SalesProbabilitiesCountEndpoint +from pyconnectwise.endpoints.manage.SalesProbabilitiesIdEndpoint import SalesProbabilitiesIdEndpoint +from pyconnectwise.endpoints.manage.SalesProbabilitiesInfoEndpoint import SalesProbabilitiesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SalesProbability from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesProbabilitiesEndpoint( @@ -27,39 +19,30 @@ class SalesProbabilitiesEndpoint( IPostable[SalesProbability, ConnectWiseManageRequestParams], IPaginateable[SalesProbability, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "probabilities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "probabilities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SalesProbability]) IPostable.__init__(self, SalesProbability) IPaginateable.__init__(self, SalesProbability) - self.count = self._register_child_endpoint( - SalesProbabilitiesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SalesProbabilitiesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesProbabilitiesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SalesProbabilitiesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesProbabilitiesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesProbabilitiesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesProbabilitiesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesProbabilitiesIdEndpoint: The initialized SalesProbabilitiesIdEndpoint object. """ child = SalesProbabilitiesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesProbability]: """ Performs a GET request against the /sales/probabilities endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SalesProbability, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SalesProbability, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SalesProbability]: """ Performs a GET request against the /sales/probabilities endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[SalesProbability]: The parsed response data. """ - return self._parse_many( - SalesProbability, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SalesProbability, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesProbability: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesProbability: """ Performs a POST request against the /sales/probabilities endpoint. @@ -118,7 +87,4 @@ def post( Returns: SalesProbability: The parsed response data. """ - return self._parse_one( - SalesProbability, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SalesProbability, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdEndpoint.py index 5ee56790a..7818581aa 100644 --- a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesProbabilitiesIdInfoEndpoint import ( - SalesProbabilitiesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesProbabilitiesIdInfoEndpoint import SalesProbabilitiesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SalesProbability from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesProbabilitiesIdEndpoint( ConnectWiseEndpoint, IGettable[SalesProbability, ConnectWiseManageRequestParams], - IPuttable[SalesProbability, ConnectWiseManageRequestParams], IPatchable[SalesProbability, ConnectWiseManageRequestParams], + IPuttable[SalesProbability, ConnectWiseManageRequestParams], IPaginateable[SalesProbability, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SalesProbability) - IPuttable.__init__(self, SalesProbability) IPatchable.__init__(self, SalesProbability) + IPuttable.__init__(self, SalesProbability) IPaginateable.__init__(self, SalesProbability) - self.info = self._register_child_endpoint( - SalesProbabilitiesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SalesProbabilitiesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesProbability]: """ Performs a GET request against the /sales/probabilities/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SalesProbability, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SalesProbability, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesProbability: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/probabilities/{id} endpoint. + Performs a DELETE request against the /sales/probabilities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SalesProbability: The parsed response data. """ - return self._parse_one( - SalesProbability, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesProbability: """ - Performs a DELETE request against the /sales/probabilities/{id} endpoint. + Performs a GET request against the /sales/probabilities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SalesProbability: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SalesProbability, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesProbability: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SalesProbability: """ - Performs a PUT request against the /sales/probabilities/{id} endpoint. + Performs a PATCH request against the /sales/probabilities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +81,11 @@ def put( Returns: SalesProbability: The parsed response data. """ - return self._parse_one( - SalesProbability, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(SalesProbability, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesProbability: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesProbability: """ - Performs a PATCH request against the /sales/probabilities/{id} endpoint. + Performs a PUT request against the /sales/probabilities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +93,4 @@ def patch( Returns: SalesProbability: The parsed response data. """ - return self._parse_one( - SalesProbability, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SalesProbability, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdInfoEndpoint.py index 72ad62130..a93752cf9 100644 --- a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SalesProbabilityInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesProbabilitiesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SalesProbabilitiesIdInfoEndpoint( IGettable[SalesProbabilityInfo, ConnectWiseManageRequestParams], IPaginateable[SalesProbabilityInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SalesProbabilityInfo) IPaginateable.__init__(self, SalesProbabilityInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesProbabilityInfo]: """ Performs a GET request against the /sales/probabilities/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SalesProbabilityInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SalesProbabilityInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> SalesProbabilityInfo: """ Performs a GET request against the /sales/probabilities/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: SalesProbabilityInfo: The parsed response data. """ - return self._parse_one( - SalesProbabilityInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SalesProbabilityInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoCountEndpoint.py index 5c7c1df4a..889207bc1 100644 --- a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesProbabilitiesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesProbabilitiesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/probabilities/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/probabilities/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoEndpoint.py index 4d6678d87..9f08d144a 100644 --- a/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesProbabilitiesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesProbabilitiesInfoCountEndpoint import ( - SalesProbabilitiesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SalesProbabilitiesInfoCountEndpoint import SalesProbabilitiesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SalesProbabilityInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesProbabilitiesInfoEndpoint( @@ -19,22 +16,15 @@ class SalesProbabilitiesInfoEndpoint( IGettable[list[SalesProbabilityInfo], ConnectWiseManageRequestParams], IPaginateable[SalesProbabilityInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SalesProbabilityInfo]) IPaginateable.__init__(self, SalesProbabilityInfo) - self.count = self._register_child_endpoint( - SalesProbabilitiesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesProbabilitiesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesProbabilityInfo]: """ Performs a GET request against the /sales/probabilities/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SalesProbabilityInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SalesProbabilityInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SalesProbabilityInfo]: """ Performs a GET request against the /sales/probabilities/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[SalesProbabilityInfo]: The parsed response data. """ - return self._parse_many( - SalesProbabilityInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SalesProbabilityInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesQuotasCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesQuotasCountEndpoint.py index c25197fa5..f65db6c9b 100644 --- a/src/pyconnectwise/endpoints/manage/SalesQuotasCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesQuotasCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesQuotasCountEndpoint( @@ -16,18 +15,13 @@ class SalesQuotasCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/quotas/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/quotas/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesQuotasEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesQuotasEndpoint.py index cba7e6f22..fe530835b 100644 --- a/src/pyconnectwise/endpoints/manage/SalesQuotasEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesQuotasEndpoint.py @@ -1,19 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesQuotasCountEndpoint import ( - SalesQuotasCountEndpoint, -) +from pyconnectwise.endpoints.manage.SalesQuotasCountEndpoint import SalesQuotasCountEndpoint from pyconnectwise.endpoints.manage.SalesQuotasIdEndpoint import SalesQuotasIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SalesQuota from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesQuotasEndpoint( @@ -22,36 +18,29 @@ class SalesQuotasEndpoint( IPostable[SalesQuota, ConnectWiseManageRequestParams], IPaginateable[SalesQuota, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "quotas", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "quotas", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SalesQuota]) IPostable.__init__(self, SalesQuota) IPaginateable.__init__(self, SalesQuota) - self.count = self._register_child_endpoint( - SalesQuotasCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesQuotasCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesQuotasIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesQuotasIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesQuotasIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesQuotasIdEndpoint: The initialized SalesQuotasIdEndpoint object. """ child = SalesQuotasIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesQuota]: """ Performs a GET request against the /sales/quotas endpoint and returns an initialized PaginatedResponse object. @@ -68,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SalesQuota, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SalesQuota, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SalesQuota]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SalesQuota]: """ Performs a GET request against the /sales/quotas endpoint. @@ -91,15 +69,9 @@ def get( Returns: list[SalesQuota]: The parsed response data. """ - return self._parse_many( - SalesQuota, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SalesQuota, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesQuota: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesQuota: """ Performs a POST request against the /sales/quotas endpoint. @@ -109,6 +81,4 @@ def post( Returns: SalesQuota: The parsed response data. """ - return self._parse_one( - SalesQuota, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(SalesQuota, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesQuotasIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesQuotasIdEndpoint.py index 09bab35ac..c54e3df03 100644 --- a/src/pyconnectwise/endpoints/manage/SalesQuotasIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesQuotasIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SalesQuota from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesQuotasIdEndpoint( ConnectWiseEndpoint, IGettable[SalesQuota, ConnectWiseManageRequestParams], - IPuttable[SalesQuota, ConnectWiseManageRequestParams], IPatchable[SalesQuota, ConnectWiseManageRequestParams], + IPuttable[SalesQuota, ConnectWiseManageRequestParams], IPaginateable[SalesQuota, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SalesQuota) - IPuttable.__init__(self, SalesQuota) IPatchable.__init__(self, SalesQuota) + IPuttable.__init__(self, SalesQuota) IPaginateable.__init__(self, SalesQuota) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesQuota]: """ Performs a GET request against the /sales/quotas/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SalesQuota, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SalesQuota, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesQuota: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/quotas/{id} endpoint. + Performs a DELETE request against the /sales/quotas/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SalesQuota: The parsed response data. """ - return self._parse_one( - SalesQuota, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesQuota: """ - Performs a DELETE request against the /sales/quotas/{id} endpoint. + Performs a GET request against the /sales/quotas/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SalesQuota: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SalesQuota, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesQuota: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SalesQuota: """ - Performs a PUT request against the /sales/quotas/{id} endpoint. + Performs a PATCH request against the /sales/quotas/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: SalesQuota: The parsed response data. """ - return self._parse_one( - SalesQuota, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SalesQuota, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesQuota: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesQuota: """ - Performs a PATCH request against the /sales/quotas/{id} endpoint. + Performs a PUT request against the /sales/quotas/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: SalesQuota: The parsed response data. """ - return self._parse_one( - SalesQuota, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(SalesQuota, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesRolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesRolesCountEndpoint.py index 9a0305dbf..4bccb9fe8 100644 --- a/src/pyconnectwise/endpoints/manage/SalesRolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesRolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesRolesCountEndpoint( @@ -16,18 +15,13 @@ class SalesRolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/roles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/roles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesRolesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesRolesEndpoint.py index 98bd91f9f..144fcf22e 100644 --- a/src/pyconnectwise/endpoints/manage/SalesRolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesRolesEndpoint.py @@ -1,19 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesRolesCountEndpoint import ( - SalesRolesCountEndpoint, -) +from pyconnectwise.endpoints.manage.SalesRolesCountEndpoint import SalesRolesCountEndpoint from pyconnectwise.endpoints.manage.SalesRolesIdEndpoint import SalesRolesIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Role from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesRolesEndpoint( @@ -22,36 +18,29 @@ class SalesRolesEndpoint( IPostable[Role, ConnectWiseManageRequestParams], IPaginateable[Role, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "roles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "roles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Role]) IPostable.__init__(self, Role) IPaginateable.__init__(self, Role) - self.count = self._register_child_endpoint( - SalesRolesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesRolesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesRolesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesRolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesRolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesRolesIdEndpoint: The initialized SalesRolesIdEndpoint object. """ child = SalesRolesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Role]: """ Performs a GET request against the /sales/roles endpoint and returns an initialized PaginatedResponse object. @@ -68,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Role, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Role, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Role]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Role]: """ Performs a GET request against the /sales/roles endpoint. @@ -91,15 +69,9 @@ def get( Returns: list[Role]: The parsed response data. """ - return self._parse_many( - Role, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Role, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Role: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Role: """ Performs a POST request against the /sales/roles endpoint. @@ -109,6 +81,4 @@ def post( Returns: Role: The parsed response data. """ - return self._parse_one( - Role, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Role, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesRolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesRolesIdEndpoint.py index 1667c9965..5edab9da6 100644 --- a/src/pyconnectwise/endpoints/manage/SalesRolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesRolesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Role from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesRolesIdEndpoint( ConnectWiseEndpoint, IGettable[Role, ConnectWiseManageRequestParams], - IPuttable[Role, ConnectWiseManageRequestParams], IPatchable[Role, ConnectWiseManageRequestParams], + IPuttable[Role, ConnectWiseManageRequestParams], IPaginateable[Role, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Role) - IPuttable.__init__(self, Role) IPatchable.__init__(self, Role) + IPuttable.__init__(self, Role) IPaginateable.__init__(self, Role) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Role]: """ Performs a GET request against the /sales/roles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Role, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Role, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Role: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/roles/{id} endpoint. + Performs a DELETE request against the /sales/roles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Role: The parsed response data. """ - return self._parse_one( - Role, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Role: """ - Performs a DELETE request against the /sales/roles/{id} endpoint. + Performs a GET request against the /sales/roles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Role: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Role, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Role: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Role: """ - Performs a PUT request against the /sales/roles/{id} endpoint. + Performs a PATCH request against the /sales/roles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Role: The parsed response data. """ - return self._parse_one( - Role, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Role, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Role: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Role: """ - Performs a PATCH request against the /sales/roles/{id} endpoint. + Performs a PUT request against the /sales/roles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Role: The parsed response data. """ - return self._parse_one( - Role, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Role, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesSalesteamsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesSalesteamsCountEndpoint.py index e7cc78a7e..480863012 100644 --- a/src/pyconnectwise/endpoints/manage/SalesSalesteamsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesSalesteamsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesSalesteamsCountEndpoint( @@ -16,18 +15,13 @@ class SalesSalesteamsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/salesTeams/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/salesTeams/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesSalesteamsEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesSalesteamsEndpoint.py index 0adcab4c3..e3a264ddc 100644 --- a/src/pyconnectwise/endpoints/manage/SalesSalesteamsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesSalesteamsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesSalesteamsCountEndpoint import ( - SalesSalesteamsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesSalesteamsIdEndpoint import ( - SalesSalesteamsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesSalesteamsCountEndpoint import SalesSalesteamsCountEndpoint +from pyconnectwise.endpoints.manage.SalesSalesteamsIdEndpoint import SalesSalesteamsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SalesTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesSalesteamsEndpoint( @@ -24,36 +18,29 @@ class SalesSalesteamsEndpoint( IPostable[SalesTeam, ConnectWiseManageRequestParams], IPaginateable[SalesTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "salesTeams", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "salesTeams", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SalesTeam]) IPostable.__init__(self, SalesTeam) IPaginateable.__init__(self, SalesTeam) - self.count = self._register_child_endpoint( - SalesSalesteamsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesSalesteamsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesSalesteamsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesSalesteamsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesSalesteamsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesSalesteamsIdEndpoint: The initialized SalesSalesteamsIdEndpoint object. """ child = SalesSalesteamsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesTeam]: """ Performs a GET request against the /sales/salesTeams endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SalesTeam, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SalesTeam, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SalesTeam]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SalesTeam]: """ Performs a GET request against the /sales/salesTeams endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[SalesTeam]: The parsed response data. """ - return self._parse_many( - SalesTeam, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SalesTeam, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeam: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesTeam: """ Performs a POST request against the /sales/salesTeams endpoint. @@ -111,6 +81,4 @@ def post( Returns: SalesTeam: The parsed response data. """ - return self._parse_one( - SalesTeam, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(SalesTeam, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdEndpoint.py index 9b646678e..1a28dfd5c 100644 --- a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesSalesteamsIdMembersEndpoint import ( - SalesSalesteamsIdMembersEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesSalesteamsIdMembersEndpoint import SalesSalesteamsIdMembersEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SalesTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesSalesteamsIdEndpoint( ConnectWiseEndpoint, IGettable[SalesTeam, ConnectWiseManageRequestParams], - IPuttable[SalesTeam, ConnectWiseManageRequestParams], IPatchable[SalesTeam, ConnectWiseManageRequestParams], + IPuttable[SalesTeam, ConnectWiseManageRequestParams], IPaginateable[SalesTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SalesTeam) - IPuttable.__init__(self, SalesTeam) IPatchable.__init__(self, SalesTeam) + IPuttable.__init__(self, SalesTeam) IPaginateable.__init__(self, SalesTeam) - self.members = self._register_child_endpoint( - SalesSalesteamsIdMembersEndpoint(client, parent_endpoint=self) - ) + self.members = self._register_child_endpoint(SalesSalesteamsIdMembersEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesTeam]: """ Performs a GET request against the /sales/salesTeams/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SalesTeam, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SalesTeam, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeam: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/salesTeams/{id} endpoint. + Performs a DELETE request against the /sales/salesTeams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SalesTeam: The parsed response data. """ - return self._parse_one( - SalesTeam, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesTeam: """ - Performs a DELETE request against the /sales/salesTeams/{id} endpoint. + Performs a GET request against the /sales/salesTeams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SalesTeam: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SalesTeam, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeam: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SalesTeam: """ - Performs a PUT request against the /sales/salesTeams/{id} endpoint. + Performs a PATCH request against the /sales/salesTeams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: SalesTeam: The parsed response data. """ - return self._parse_one( - SalesTeam, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SalesTeam, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeam: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesTeam: """ - Performs a PATCH request against the /sales/salesTeams/{id} endpoint. + Performs a PUT request against the /sales/salesTeams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: SalesTeam: The parsed response data. """ - return self._parse_one( - SalesTeam, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(SalesTeam, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersCountEndpoint.py index 15f47a492..63c29a6ee 100644 --- a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesSalesteamsIdMembersCountEndpoint( @@ -16,18 +15,13 @@ class SalesSalesteamsIdMembersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/salesTeams/{id}/members/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/salesTeams/{id}/members/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersEndpoint.py index 36cfbc254..b8be2e0d2 100644 --- a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesSalesteamsIdMembersCountEndpoint import ( - SalesSalesteamsIdMembersCountEndpoint, -) -from pyconnectwise.endpoints.manage.SalesSalesteamsIdMembersIdEndpoint import ( - SalesSalesteamsIdMembersIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesSalesteamsIdMembersCountEndpoint import SalesSalesteamsIdMembersCountEndpoint +from pyconnectwise.endpoints.manage.SalesSalesteamsIdMembersIdEndpoint import SalesSalesteamsIdMembersIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SalesTeamMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesSalesteamsIdMembersEndpoint( @@ -24,36 +18,29 @@ class SalesSalesteamsIdMembersEndpoint( IPostable[SalesTeamMember, ConnectWiseManageRequestParams], IPaginateable[SalesTeamMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "members", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "members", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SalesTeamMember]) IPostable.__init__(self, SalesTeamMember) IPaginateable.__init__(self, SalesTeamMember) - self.count = self._register_child_endpoint( - SalesSalesteamsIdMembersCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesSalesteamsIdMembersCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesSalesteamsIdMembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesSalesteamsIdMembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesSalesteamsIdMembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesSalesteamsIdMembersIdEndpoint: The initialized SalesSalesteamsIdMembersIdEndpoint object. """ child = SalesSalesteamsIdMembersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesTeamMember]: """ Performs a GET request against the /sales/salesTeams/{id}/members endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SalesTeamMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SalesTeamMember, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SalesTeamMember]: """ Performs a GET request against the /sales/salesTeams/{id}/members endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[SalesTeamMember]: The parsed response data. """ - return self._parse_many( - SalesTeamMember, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SalesTeamMember, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeamMember: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesTeamMember: """ Performs a POST request against the /sales/salesTeams/{id}/members endpoint. @@ -112,7 +85,4 @@ def post( Returns: SalesTeamMember: The parsed response data. """ - return self._parse_one( - SalesTeamMember, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SalesTeamMember, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersIdEndpoint.py index 9f2166ac0..8a2c7e320 100644 --- a/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesSalesteamsIdMembersIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SalesTeamMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesSalesteamsIdMembersIdEndpoint( ConnectWiseEndpoint, IGettable[SalesTeamMember, ConnectWiseManageRequestParams], - IPuttable[SalesTeamMember, ConnectWiseManageRequestParams], IPatchable[SalesTeamMember, ConnectWiseManageRequestParams], + IPuttable[SalesTeamMember, ConnectWiseManageRequestParams], IPaginateable[SalesTeamMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SalesTeamMember) - IPuttable.__init__(self, SalesTeamMember) IPatchable.__init__(self, SalesTeamMember) + IPuttable.__init__(self, SalesTeamMember) IPaginateable.__init__(self, SalesTeamMember) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SalesTeamMember]: """ Performs a GET request against the /sales/salesTeams/{id}/members/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SalesTeamMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SalesTeamMember, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeamMember: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/salesTeams/{id}/members/{id} endpoint. + Performs a DELETE request against the /sales/salesTeams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SalesTeamMember: The parsed response data. """ - return self._parse_one( - SalesTeamMember, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesTeamMember: """ - Performs a DELETE request against the /sales/salesTeams/{id}/members/{id} endpoint. + Performs a GET request against the /sales/salesTeams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SalesTeamMember: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SalesTeamMember, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeamMember: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SalesTeamMember: """ - Performs a PUT request against the /sales/salesTeams/{id}/members/{id} endpoint. + Performs a PATCH request against the /sales/salesTeams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: SalesTeamMember: The parsed response data. """ - return self._parse_one( - SalesTeamMember, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(SalesTeamMember, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SalesTeamMember: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SalesTeamMember: """ - Performs a PATCH request against the /sales/salesTeams/{id}/members/{id} endpoint. + Performs a PUT request against the /sales/salesTeams/{id}/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: SalesTeamMember: The parsed response data. """ - return self._parse_one( - SalesTeamMember, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SalesTeamMember, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleEndpoint.py index d0b6edf1a..6ce77b3c4 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleEndpoint.py @@ -1,14 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsEndpoint import ( - SalesScheduleHolidaylistsEndpoint, -) +from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsEndpoint import SalesScheduleHolidaylistsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesScheduleEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "schedule", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "schedule", parent_endpoint=parent_endpoint) self.holidaylists = self._register_child_endpoint( SalesScheduleHolidaylistsEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsEndpoint.py index 518f20a5b..2529585c3 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsIdEndpoint import ( - SalesScheduleHolidaylistsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsInfoEndpoint import ( - SalesScheduleHolidaylistsInfoEndpoint, -) +from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsIdEndpoint import SalesScheduleHolidaylistsIdEndpoint +from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsInfoEndpoint import SalesScheduleHolidaylistsInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesScheduleHolidaylistsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "holidaylists", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "holidaylists", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - SalesScheduleHolidaylistsInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SalesScheduleHolidaylistsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesScheduleHolidaylistsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesScheduleHolidaylistsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesScheduleHolidaylistsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesScheduleHolidaylistsIdEndpoint: The initialized SalesScheduleHolidaylistsIdEndpoint object. """ child = SalesScheduleHolidaylistsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdEndpoint.py index 1b24a7af6..071c4c817 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdEndpoint.py @@ -1,14 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsIdHolidaysEndpoint import ( SalesScheduleHolidaylistsIdHolidaysEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SalesScheduleHolidaylistsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.holidays = self._register_child_endpoint( SalesScheduleHolidaylistsIdHolidaysEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysEndpoint.py index 50d6450bd..f2ed62be7 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysEndpoint.py @@ -1,17 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsIdHolidaysInfoEndpoint import ( SalesScheduleHolidaylistsIdHolidaysInfoEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SalesScheduleHolidaylistsIdHolidaysEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "holidays", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "holidays", parent_endpoint=parent_endpoint) self.info = self._register_child_endpoint( - SalesScheduleHolidaylistsIdHolidaysInfoEndpoint( - client, parent_endpoint=self - ) + SalesScheduleHolidaylistsIdHolidaysInfoEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint.py index a796f9705..a9fd2eaf6 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/schedule/holidaylists/{id}/holidays/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/schedule/holidaylists/{id}/holidays/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoEndpoint.py index a94eb280d..6bf1c18a1 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsIdHolidaysInfoEndpoint.py @@ -1,17 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint import ( SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SalesScheduleHolidaylistsIdHolidaysInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) self.count = self._register_child_endpoint( - SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint( - client, parent_endpoint=self - ) + SalesScheduleHolidaylistsIdHolidaysInfoCountEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoCountEndpoint.py index ac88976cb..89aae157b 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesScheduleHolidaylistsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesScheduleHolidaylistsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/schedule/holidaylists/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/schedule/holidaylists/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoEndpoint.py index 77ac7ca5d..28f234bf6 100644 --- a/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesScheduleHolidaylistsInfoEndpoint.py @@ -1,14 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SalesScheduleHolidaylistsInfoCountEndpoint import ( SalesScheduleHolidaylistsInfoCountEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SalesScheduleHolidaylistsInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) self.count = self._register_child_endpoint( SalesScheduleHolidaylistsInfoCountEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/SalesServiceEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesServiceEndpoint.py index 50820422a..5a694e931 100644 --- a/src/pyconnectwise/endpoints/manage/SalesServiceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesServiceEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesServicePriorityEndpoint import ( - SalesServicePriorityEndpoint, -) +from pyconnectwise.endpoints.manage.SalesServicePriorityEndpoint import SalesServicePriorityEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesServiceEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "service", parent_endpoint=parent_endpoint - ) - - self.priority = self._register_child_endpoint( - SalesServicePriorityEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "service", parent_endpoint=parent_endpoint) + + self.priority = self._register_child_endpoint(SalesServicePriorityEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SalesServicePriorityEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesServicePriorityEndpoint.py index 1c57233d2..7aced4e27 100644 --- a/src/pyconnectwise/endpoints/manage/SalesServicePriorityEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesServicePriorityEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesServicePriorityInfoEndpoint import ( - SalesServicePriorityInfoEndpoint, -) +from pyconnectwise.endpoints.manage.SalesServicePriorityInfoEndpoint import SalesServicePriorityInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesServicePriorityEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "priority", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - SalesServicePriorityInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "priority", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(SalesServicePriorityInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoCountEndpoint.py index fcb026133..50a9deb54 100644 --- a/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesServicePriorityInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesServicePriorityInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/service/priority/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/service/priority/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoEndpoint.py index 1139eb4e8..a9a2ef88d 100644 --- a/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesServicePriorityInfoEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesServicePriorityInfoCountEndpoint import ( - SalesServicePriorityInfoCountEndpoint, -) +from pyconnectwise.endpoints.manage.SalesServicePriorityInfoCountEndpoint import SalesServicePriorityInfoCountEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesServicePriorityInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - - self.count = self._register_child_endpoint( - SalesServicePriorityInfoCountEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + + self.count = self._register_child_endpoint(SalesServicePriorityInfoCountEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesCountEndpoint.py index b15f5e40a..a5daeb68b 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesCountEndpoint( @@ -16,18 +15,13 @@ class SalesStagesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/stages/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/stages/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesEndpoint.py index 4447097d4..03333b394 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesEndpoint.py @@ -1,22 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesStagesCountEndpoint import ( - SalesStagesCountEndpoint, -) +from pyconnectwise.endpoints.manage.SalesStagesCountEndpoint import SalesStagesCountEndpoint from pyconnectwise.endpoints.manage.SalesStagesIdEndpoint import SalesStagesIdEndpoint -from pyconnectwise.endpoints.manage.SalesStagesInfoEndpoint import ( - SalesStagesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SalesStagesInfoEndpoint import SalesStagesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import OpportunityStage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesEndpoint( @@ -25,39 +19,30 @@ class SalesStagesEndpoint( IPostable[OpportunityStage, ConnectWiseManageRequestParams], IPaginateable[OpportunityStage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "stages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "stages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityStage]) IPostable.__init__(self, OpportunityStage) IPaginateable.__init__(self, OpportunityStage) - self.count = self._register_child_endpoint( - SalesStagesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SalesStagesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesStagesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SalesStagesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SalesStagesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SalesStagesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SalesStagesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SalesStagesIdEndpoint: The initialized SalesStagesIdEndpoint object. """ child = SalesStagesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStage]: """ Performs a GET request against the /sales/stages endpoint and returns an initialized PaginatedResponse object. @@ -75,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStage, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStage, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityStage]: """ Performs a GET request against the /sales/stages endpoint. @@ -97,16 +75,9 @@ def get( Returns: list[OpportunityStage]: The parsed response data. """ - return self._parse_many( - OpportunityStage, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityStage, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStage: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStage: """ Performs a POST request against the /sales/stages endpoint. @@ -116,7 +87,4 @@ def post( Returns: OpportunityStage: The parsed response data. """ - return self._parse_one( - OpportunityStage, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStage, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesIdEndpoint.py index 642d245e6..e653391f9 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesStagesIdInfoEndpoint import ( - SalesStagesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.SalesStagesIdUsagesEndpoint import ( - SalesStagesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SalesStagesIdInfoEndpoint import SalesStagesIdInfoEndpoint +from pyconnectwise.endpoints.manage.SalesStagesIdUsagesEndpoint import SalesStagesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OpportunityStage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesIdEndpoint( ConnectWiseEndpoint, IGettable[OpportunityStage, ConnectWiseManageRequestParams], - IPuttable[OpportunityStage, ConnectWiseManageRequestParams], IPatchable[OpportunityStage, ConnectWiseManageRequestParams], + IPuttable[OpportunityStage, ConnectWiseManageRequestParams], IPaginateable[OpportunityStage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityStage) - IPuttable.__init__(self, OpportunityStage) IPatchable.__init__(self, OpportunityStage) + IPuttable.__init__(self, OpportunityStage) IPaginateable.__init__(self, OpportunityStage) - self.usages = self._register_child_endpoint( - SalesStagesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SalesStagesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SalesStagesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(SalesStagesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStage]: """ Performs a GET request against the /sales/stages/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStage, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStage, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStage: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /sales/stages/{id} endpoint. + Performs a DELETE request against the /sales/stages/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - OpportunityStage: The parsed response data. """ - return self._parse_one( - OpportunityStage, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStage: """ - Performs a DELETE request against the /sales/stages/{id} endpoint. + Performs a GET request against the /sales/stages/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + OpportunityStage: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(OpportunityStage, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStage: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStage: """ - Performs a PUT request against the /sales/stages/{id} endpoint. + Performs a PATCH request against the /sales/stages/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +83,11 @@ def put( Returns: OpportunityStage: The parsed response data. """ - return self._parse_one( - OpportunityStage, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStage, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OpportunityStage: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OpportunityStage: """ - Performs a PATCH request against the /sales/stages/{id} endpoint. + Performs a PUT request against the /sales/stages/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +95,4 @@ def patch( Returns: OpportunityStage: The parsed response data. """ - return self._parse_one( - OpportunityStage, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStage, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesIdInfoEndpoint.py index 8e00e8417..ac06f70c8 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityStageInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SalesStagesIdInfoEndpoint( IGettable[OpportunityStageInfo, ConnectWiseManageRequestParams], IPaginateable[OpportunityStageInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, OpportunityStageInfo) IPaginateable.__init__(self, OpportunityStageInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStageInfo]: """ Performs a GET request against the /sales/stages/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStageInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStageInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> OpportunityStageInfo: """ Performs a GET request against the /sales/stages/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: OpportunityStageInfo: The parsed response data. """ - return self._parse_one( - OpportunityStageInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(OpportunityStageInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesEndpoint.py index 1e5b07852..79737ad2d 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesStagesIdUsagesListEndpoint import ( - SalesStagesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SalesStagesIdUsagesListEndpoint import SalesStagesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class SalesStagesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - SalesStagesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(SalesStagesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/stages/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/stages/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesListEndpoint.py index 6e1f146b3..21665718f 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SalesStagesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /sales/stages/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /sales/stages/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesInfoCountEndpoint.py index 4380163de..2182bacba 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SalesStagesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /sales/stages/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /sales/stages/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SalesStagesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SalesStagesInfoEndpoint.py index d687cbc0b..32e36f056 100644 --- a/src/pyconnectwise/endpoints/manage/SalesStagesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SalesStagesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SalesStagesInfoCountEndpoint import ( - SalesStagesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SalesStagesInfoCountEndpoint import SalesStagesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OpportunityStageInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SalesStagesInfoEndpoint( @@ -19,22 +16,15 @@ class SalesStagesInfoEndpoint( IGettable[list[OpportunityStageInfo], ConnectWiseManageRequestParams], IPaginateable[OpportunityStageInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OpportunityStageInfo]) IPaginateable.__init__(self, OpportunityStageInfo) - self.count = self._register_child_endpoint( - SalesStagesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SalesStagesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OpportunityStageInfo]: """ Performs a GET request against the /sales/stages/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OpportunityStageInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OpportunityStageInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OpportunityStageInfo]: """ Performs a GET request against the /sales/stages/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[OpportunityStageInfo]: The parsed response data. """ - return self._parse_many( - OpportunityStageInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(OpportunityStageInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsCountEndpoint.py index 80b208536..60224641e 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Calendar from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleCalendarsCountEndpoint( IGettable[Calendar, ConnectWiseManageRequestParams], IPaginateable[Calendar, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Calendar) IPaginateable.__init__(self, Calendar) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Calendar]: """ Performs a GET request against the /schedule/calendars/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Calendar, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Calendar, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Calendar: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Calendar: """ Performs a GET request against the /schedule/calendars/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Calendar: The parsed response data. """ - return self._parse_one( - Calendar, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Calendar, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsEndpoint.py index 9c4e7f663..08b376fd6 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleCalendarsCountEndpoint import ( - ScheduleCalendarsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleCalendarsIdEndpoint import ( - ScheduleCalendarsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleCalendarsInfoEndpoint import ( - ScheduleCalendarsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ScheduleCalendarsCountEndpoint import ScheduleCalendarsCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleCalendarsIdEndpoint import ScheduleCalendarsIdEndpoint +from pyconnectwise.endpoints.manage.ScheduleCalendarsInfoEndpoint import ScheduleCalendarsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Calendar from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsEndpoint( @@ -27,39 +19,30 @@ class ScheduleCalendarsEndpoint( IPostable[Calendar, ConnectWiseManageRequestParams], IPaginateable[Calendar, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "calendars", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "calendars", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Calendar]) IPostable.__init__(self, Calendar) IPaginateable.__init__(self, Calendar) - self.count = self._register_child_endpoint( - ScheduleCalendarsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ScheduleCalendarsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleCalendarsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ScheduleCalendarsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleCalendarsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleCalendarsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleCalendarsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleCalendarsIdEndpoint: The initialized ScheduleCalendarsIdEndpoint object. """ child = ScheduleCalendarsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Calendar]: """ Performs a GET request against the /schedule/calendars endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Calendar, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Calendar, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Calendar]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Calendar]: """ Performs a GET request against the /schedule/calendars endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Calendar]: The parsed response data. """ - return self._parse_many( - Calendar, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Calendar, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Calendar: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Calendar: """ Performs a POST request against the /schedule/calendars endpoint. @@ -117,6 +83,4 @@ def post( Returns: Calendar: The parsed response data. """ - return self._parse_one( - Calendar, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Calendar, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdCopyEndpoint.py index 82ec74008..a9fef730b 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdCopyEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Calendar -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ScheduleCalendarsIdCopyEndpoint( - ConnectWiseEndpoint, IPostable[Calendar, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) +class ScheduleCalendarsIdCopyEndpoint(ConnectWiseEndpoint, IPostable[Calendar, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, Calendar) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Calendar: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Calendar: """ Performs a POST request against the /schedule/calendars/{id}/copy endpoint. @@ -32,6 +24,4 @@ def post( Returns: Calendar: The parsed response data. """ - return self._parse_one( - Calendar, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Calendar, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdEndpoint.py index 823106d61..f6a2722b6 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdEndpoint.py @@ -1,26 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleCalendarsIdCopyEndpoint import ( - ScheduleCalendarsIdCopyEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleCalendarsIdInfoEndpoint import ( - ScheduleCalendarsIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleCalendarsIdUsagesEndpoint import ( - ScheduleCalendarsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ScheduleCalendarsIdCopyEndpoint import ScheduleCalendarsIdCopyEndpoint +from pyconnectwise.endpoints.manage.ScheduleCalendarsIdInfoEndpoint import ScheduleCalendarsIdInfoEndpoint +from pyconnectwise.endpoints.manage.ScheduleCalendarsIdUsagesEndpoint import ScheduleCalendarsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Calendar from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsIdEndpoint( @@ -30,30 +20,19 @@ class ScheduleCalendarsIdEndpoint( IPuttable[Calendar, ConnectWiseManageRequestParams], IPaginateable[Calendar, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Calendar) IPatchable.__init__(self, Calendar) IPuttable.__init__(self, Calendar) IPaginateable.__init__(self, Calendar) - self.copy = self._register_child_endpoint( - ScheduleCalendarsIdCopyEndpoint(client, parent_endpoint=self) - ) - self.usages = self._register_child_endpoint( - ScheduleCalendarsIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ScheduleCalendarsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(ScheduleCalendarsIdCopyEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ScheduleCalendarsIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ScheduleCalendarsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Calendar]: """ Performs a GET request against the /schedule/calendars/{id} endpoint and returns an initialized PaginatedResponse object. @@ -70,40 +49,21 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Calendar, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Calendar, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Calendar: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /schedule/calendars/{id} endpoint. + Performs a DELETE request against the /schedule/calendars/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Calendar: The parsed response data. """ - return self._parse_one( - Calendar, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Calendar: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Calendar: """ - Performs a PATCH request against the /schedule/calendars/{id} endpoint. + Performs a GET request against the /schedule/calendars/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -111,17 +71,11 @@ def patch( Returns: Calendar: The parsed response data. """ - return self._parse_one( - Calendar, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Calendar, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Calendar: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Calendar: """ - Performs a PUT request against the /schedule/calendars/{id} endpoint. + Performs a PATCH request against the /schedule/calendars/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -129,20 +83,16 @@ def put( Returns: Calendar: The parsed response data. """ - return self._parse_one( - Calendar, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Calendar, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Calendar: """ - Performs a DELETE request against the /schedule/calendars/{id} endpoint. + Performs a PUT request against the /schedule/calendars/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Calendar: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Calendar, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdInfoEndpoint.py index f39a7d779..46ade02af 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CalendarInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ScheduleCalendarsIdInfoEndpoint( IGettable[CalendarInfo, ConnectWiseManageRequestParams], IPaginateable[CalendarInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CalendarInfo) IPaginateable.__init__(self, CalendarInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CalendarInfo]: """ Performs a GET request against the /schedule/calendars/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CalendarInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CalendarInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CalendarInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CalendarInfo: """ Performs a GET request against the /schedule/calendars/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: CalendarInfo: The parsed response data. """ - return self._parse_one( - CalendarInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CalendarInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesEndpoint.py index 2c9add3a2..86b65c71b 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleCalendarsIdUsagesListEndpoint import ( - ScheduleCalendarsIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleCalendarsIdUsagesListEndpoint import ScheduleCalendarsIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ScheduleCalendarsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ScheduleCalendarsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ScheduleCalendarsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /schedule/calendars/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /schedule/calendars/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesListEndpoint.py index 510f85339..23f690bc2 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ScheduleCalendarsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /schedule/calendars/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /schedule/calendars/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoCountEndpoint.py index 54848b28f..ab843b253 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CalendarInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleCalendarsInfoCountEndpoint( IGettable[CalendarInfo, ConnectWiseManageRequestParams], IPaginateable[CalendarInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, CalendarInfo) IPaginateable.__init__(self, CalendarInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CalendarInfo]: """ Performs a GET request against the /schedule/calendars/info/count endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CalendarInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CalendarInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CalendarInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CalendarInfo: """ Performs a GET request against the /schedule/calendars/info/count endpoint. @@ -67,6 +52,4 @@ def get( Returns: CalendarInfo: The parsed response data. """ - return self._parse_one( - CalendarInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CalendarInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoEndpoint.py index 4e03fbd49..d049e02e6 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleCalendarsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleCalendarsInfoCountEndpoint import ( - ScheduleCalendarsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleCalendarsInfoCountEndpoint import ScheduleCalendarsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CalendarInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleCalendarsInfoEndpoint( @@ -19,22 +16,15 @@ class ScheduleCalendarsInfoEndpoint( IGettable[list[CalendarInfo], ConnectWiseManageRequestParams], IPaginateable[CalendarInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CalendarInfo]) IPaginateable.__init__(self, CalendarInfo) - self.count = self._register_child_endpoint( - ScheduleCalendarsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleCalendarsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CalendarInfo]: """ Performs a GET request against the /schedule/calendars/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CalendarInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CalendarInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CalendarInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CalendarInfo]: """ Performs a GET request against the /schedule/calendars/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[CalendarInfo]: The parsed response data. """ - return self._parse_many( - CalendarInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CalendarInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleColorsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleColorsCountEndpoint.py index f6089cef2..ecaa15906 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleColorsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleColorsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleColorsCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleColorsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/colors/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/colors/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleColorsEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleColorsEndpoint.py index 15a66da26..01934fa9a 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleColorsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleColorsEndpoint.py @@ -1,23 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleColorsCountEndpoint import ( - ScheduleColorsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleColorsIdEndpoint import ( - ScheduleColorsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleColorsResetEndpoint import ( - ScheduleColorsResetEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleColorsCountEndpoint import ScheduleColorsCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleColorsIdEndpoint import ScheduleColorsIdEndpoint +from pyconnectwise.endpoints.manage.ScheduleColorsResetEndpoint import ScheduleColorsResetEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleColor from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleColorsEndpoint( @@ -25,38 +18,29 @@ class ScheduleColorsEndpoint( IGettable[list[ScheduleColor], ConnectWiseManageRequestParams], IPaginateable[ScheduleColor, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "colors", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "colors", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleColor]) IPaginateable.__init__(self, ScheduleColor) - self.count = self._register_child_endpoint( - ScheduleColorsCountEndpoint(client, parent_endpoint=self) - ) - self.reset = self._register_child_endpoint( - ScheduleColorsResetEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleColorsCountEndpoint(client, parent_endpoint=self)) + self.reset = self._register_child_endpoint(ScheduleColorsResetEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleColorsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleColorsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleColorsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleColorsIdEndpoint: The initialized ScheduleColorsIdEndpoint object. """ child = ScheduleColorsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleColor]: """ Performs a GET request against the /schedule/colors endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleColor, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleColor, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleColor]: """ Performs a GET request against the /schedule/colors endpoint. @@ -96,6 +73,4 @@ def get( Returns: list[ScheduleColor]: The parsed response data. """ - return self._parse_many( - ScheduleColor, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ScheduleColor, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleColorsIdClearEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleColorsIdClearEndpoint.py index 529db1bb2..2a21900d7 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleColorsIdClearEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleColorsIdClearEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ScheduleColor -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ScheduleColorsIdClearEndpoint( - ConnectWiseEndpoint, IPostable[ScheduleColor, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "clear", parent_endpoint=parent_endpoint - ) +class ScheduleColorsIdClearEndpoint(ConnectWiseEndpoint, IPostable[ScheduleColor, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "clear", parent_endpoint=parent_endpoint) IPostable.__init__(self, ScheduleColor) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleColor: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleColor: """ Performs a POST request against the /schedule/colors/{id}/clear endpoint. @@ -32,7 +24,4 @@ def post( Returns: ScheduleColor: The parsed response data. """ - return self._parse_one( - ScheduleColor, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ScheduleColor, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleColorsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleColorsIdEndpoint.py index c32fe7b4a..f7a31d018 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleColorsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleColorsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleColorsIdClearEndpoint import ( - ScheduleColorsIdClearEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ScheduleColorsIdClearEndpoint import ScheduleColorsIdClearEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ScheduleColor from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleColorsIdEndpoint( ConnectWiseEndpoint, IGettable[ScheduleColor, ConnectWiseManageRequestParams], - IPuttable[ScheduleColor, ConnectWiseManageRequestParams], IPatchable[ScheduleColor, ConnectWiseManageRequestParams], + IPuttable[ScheduleColor, ConnectWiseManageRequestParams], IPaginateable[ScheduleColor, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleColor) - IPuttable.__init__(self, ScheduleColor) IPatchable.__init__(self, ScheduleColor) + IPuttable.__init__(self, ScheduleColor) IPaginateable.__init__(self, ScheduleColor) - self.clear = self._register_child_endpoint( - ScheduleColorsIdClearEndpoint(client, parent_endpoint=self) - ) + self.clear = self._register_child_endpoint(ScheduleColorsIdClearEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleColor]: """ Performs a GET request against the /schedule/colors/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,19 +46,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleColor, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleColor, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleColor: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleColor: """ Performs a GET request against the /schedule/colors/{id} endpoint. @@ -81,17 +59,11 @@ def get( Returns: ScheduleColor: The parsed response data. """ - return self._parse_one( - ScheduleColor, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ScheduleColor, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleColor: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ScheduleColor: """ - Performs a PUT request against the /schedule/colors/{id} endpoint. + Performs a PATCH request against the /schedule/colors/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -99,17 +71,11 @@ def put( Returns: ScheduleColor: The parsed response data. """ - return self._parse_one( - ScheduleColor, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ScheduleColor, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleColor: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleColor: """ - Performs a PATCH request against the /schedule/colors/{id} endpoint. + Performs a PUT request against the /schedule/colors/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -117,7 +83,4 @@ def patch( Returns: ScheduleColor: The parsed response data. """ - return self._parse_one( - ScheduleColor, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ScheduleColor, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleColorsResetEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleColorsResetEndpoint.py index 7c3f72db3..0a1a17a05 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleColorsResetEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleColorsResetEndpoint.py @@ -1,27 +1,21 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ScheduleColor -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ScheduleColorsResetEndpoint( - ConnectWiseEndpoint, IPostable[list[ScheduleColor], ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reset", parent_endpoint=parent_endpoint - ) +class ScheduleColorsResetEndpoint(ConnectWiseEndpoint, IPostable[list[ScheduleColor], ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reset", parent_endpoint=parent_endpoint) IPostable.__init__(self, list[ScheduleColor]) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleColor]: """ Performs a POST request against the /schedule/colors/reset endpoint. @@ -32,7 +26,4 @@ def post( Returns: list[ScheduleColor]: The parsed response data. """ - return self._parse_many( - ScheduleColor, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_many(ScheduleColor, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleDetailsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleDetailsCountEndpoint.py index 7a07f48ec..fd7f39762 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleDetailsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleDetailsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleDetailsCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleDetailsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/details/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/details/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleDetailsEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleDetailsEndpoint.py index 37ea38739..46d2e78c8 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleDetailsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleDetailsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleDetailsCountEndpoint import ( - ScheduleDetailsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleDetailsIdEndpoint import ( - ScheduleDetailsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleDetailsCountEndpoint import ScheduleDetailsCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleDetailsIdEndpoint import ScheduleDetailsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleEntryDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleDetailsEndpoint( @@ -22,35 +17,28 @@ class ScheduleDetailsEndpoint( IGettable[list[ScheduleEntryDetail], ConnectWiseManageRequestParams], IPaginateable[ScheduleEntryDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "details", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "details", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleEntryDetail]) IPaginateable.__init__(self, ScheduleEntryDetail) - self.count = self._register_child_endpoint( - ScheduleDetailsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleDetailsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleDetailsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleDetailsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleDetailsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleDetailsIdEndpoint: The initialized ScheduleDetailsIdEndpoint object. """ child = ScheduleDetailsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleEntryDetail]: """ Performs a GET request against the /schedule/details endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleEntryDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleEntryDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleEntryDetail]: """ Performs a GET request against the /schedule/details endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ScheduleEntryDetail]: The parsed response data. """ - return self._parse_many( - ScheduleEntryDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleEntryDetail, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleDetailsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleDetailsIdEndpoint.py index e5306a714..fbe483765 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleDetailsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleDetailsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleEntryDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleDetailsIdEndpoint( @@ -16,18 +15,13 @@ class ScheduleDetailsIdEndpoint( IGettable[ScheduleEntryDetail, ConnectWiseManageRequestParams], IPaginateable[ScheduleEntryDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleEntryDetail) IPaginateable.__init__(self, ScheduleEntryDetail) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleEntryDetail]: """ Performs a GET request against the /schedule/details/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleEntryDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleEntryDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ScheduleEntryDetail: """ Performs a GET request against the /schedule/details/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: ScheduleEntryDetail: The parsed response data. """ - return self._parse_one( - ScheduleEntryDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ScheduleEntryDetail, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleEndpoint.py index 27eef3090..13660e6b0 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleEndpoint.py @@ -1,62 +1,33 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleCalendarsEndpoint import ( - ScheduleCalendarsEndpoint, -) +from pyconnectwise.endpoints.manage.ScheduleCalendarsEndpoint import ScheduleCalendarsEndpoint from pyconnectwise.endpoints.manage.ScheduleColorsEndpoint import ScheduleColorsEndpoint -from pyconnectwise.endpoints.manage.ScheduleDetailsEndpoint import ( - ScheduleDetailsEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleEntriesEndpoint import ( - ScheduleEntriesEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleHolidaylistsEndpoint import ( - ScheduleHolidaylistsEndpoint, -) -from pyconnectwise.endpoints.manage.SchedulePortalcalendarsEndpoint import ( - SchedulePortalcalendarsEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleRemindertimesEndpoint import ( - ScheduleRemindertimesEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleStatusesEndpoint import ( - ScheduleStatusesEndpoint, -) +from pyconnectwise.endpoints.manage.ScheduleDetailsEndpoint import ScheduleDetailsEndpoint +from pyconnectwise.endpoints.manage.ScheduleEntriesEndpoint import ScheduleEntriesEndpoint +from pyconnectwise.endpoints.manage.ScheduleHolidaylistsEndpoint import ScheduleHolidaylistsEndpoint +from pyconnectwise.endpoints.manage.SchedulePortalcalendarsEndpoint import SchedulePortalcalendarsEndpoint +from pyconnectwise.endpoints.manage.ScheduleRemindertimesEndpoint import ScheduleRemindertimesEndpoint +from pyconnectwise.endpoints.manage.ScheduleStatusesEndpoint import ScheduleStatusesEndpoint from pyconnectwise.endpoints.manage.ScheduleTypesEndpoint import ScheduleTypesEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ScheduleEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "schedule", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "schedule", parent_endpoint=parent_endpoint) - self.calendars = self._register_child_endpoint( - ScheduleCalendarsEndpoint(client, parent_endpoint=self) - ) - self.holidaylists = self._register_child_endpoint( - ScheduleHolidaylistsEndpoint(client, parent_endpoint=self) - ) - self.entries = self._register_child_endpoint( - ScheduleEntriesEndpoint(client, parent_endpoint=self) - ) - self.reminder_times = self._register_child_endpoint( - ScheduleRemindertimesEndpoint(client, parent_endpoint=self) - ) - self.holiday_lists = self._register_child_endpoint( - ScheduleHolidaylistsEndpoint(client, parent_endpoint=self) - ) - self.statuses = self._register_child_endpoint( - ScheduleStatusesEndpoint(client, parent_endpoint=self) - ) - self.details = self._register_child_endpoint( - ScheduleDetailsEndpoint(client, parent_endpoint=self) - ) - self.colors = self._register_child_endpoint( - ScheduleColorsEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - ScheduleTypesEndpoint(client, parent_endpoint=self) - ) + self.calendars = self._register_child_endpoint(ScheduleCalendarsEndpoint(client, parent_endpoint=self)) + self.colors = self._register_child_endpoint(ScheduleColorsEndpoint(client, parent_endpoint=self)) + self.details = self._register_child_endpoint(ScheduleDetailsEndpoint(client, parent_endpoint=self)) + self.entries = self._register_child_endpoint(ScheduleEntriesEndpoint(client, parent_endpoint=self)) + self.holiday_lists = self._register_child_endpoint(ScheduleHolidaylistsEndpoint(client, parent_endpoint=self)) + self.holidaylists = self._register_child_endpoint(ScheduleHolidaylistsEndpoint(client, parent_endpoint=self)) self.portalcalendars = self._register_child_endpoint( SchedulePortalcalendarsEndpoint(client, parent_endpoint=self) ) + self.reminder_times = self._register_child_endpoint(ScheduleRemindertimesEndpoint(client, parent_endpoint=self)) + self.statuses = self._register_child_endpoint(ScheduleStatusesEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(ScheduleTypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleEntriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleEntriesCountEndpoint.py index 45cd800f0..6ae530ec7 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleEntriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleEntriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleEntriesCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleEntriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/entries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/entries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleEntriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleEntriesEndpoint.py index 8b825e49d..39c3b2fef 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleEntriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleEntriesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleEntriesCountEndpoint import ( - ScheduleEntriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleEntriesIdEndpoint import ( - ScheduleEntriesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ScheduleEntriesCountEndpoint import ScheduleEntriesCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleEntriesIdEndpoint import ScheduleEntriesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ScheduleEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleEntriesEndpoint( @@ -24,36 +18,29 @@ class ScheduleEntriesEndpoint( IPostable[ScheduleEntry, ConnectWiseManageRequestParams], IPaginateable[ScheduleEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "entries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "entries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleEntry]) IPostable.__init__(self, ScheduleEntry) IPaginateable.__init__(self, ScheduleEntry) - self.count = self._register_child_endpoint( - ScheduleEntriesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleEntriesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleEntriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleEntriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleEntriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleEntriesIdEndpoint: The initialized ScheduleEntriesIdEndpoint object. """ child = ScheduleEntriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleEntry]: """ Performs a GET request against the /schedule/entries endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleEntry, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleEntry, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleEntry]: """ Performs a GET request against the /schedule/entries endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[ScheduleEntry]: The parsed response data. """ - return self._parse_many( - ScheduleEntry, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ScheduleEntry, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleEntry: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleEntry: """ Performs a POST request against the /schedule/entries endpoint. @@ -111,7 +85,4 @@ def post( Returns: ScheduleEntry: The parsed response data. """ - return self._parse_one( - ScheduleEntry, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ScheduleEntry, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsCountEndpoint.py index 8c49d1e8b..36c5cebe4 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleEntriesIdDetailsCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleEntriesIdDetailsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/entries/{id}/details/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/entries/{id}/details/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsEndpoint.py index bf8bf33bd..be8417f4d 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleEntriesIdDetailsCountEndpoint import ( - ScheduleEntriesIdDetailsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleEntriesIdDetailsIdEndpoint import ( - ScheduleEntriesIdDetailsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleEntriesIdDetailsCountEndpoint import ScheduleEntriesIdDetailsCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleEntriesIdDetailsIdEndpoint import ScheduleEntriesIdDetailsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleEntriesIdDetailsEndpoint( @@ -22,35 +17,28 @@ class ScheduleEntriesIdDetailsEndpoint( IGettable[list[ScheduleDetail], ConnectWiseManageRequestParams], IPaginateable[ScheduleDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "details", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "details", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleDetail]) IPaginateable.__init__(self, ScheduleDetail) - self.count = self._register_child_endpoint( - ScheduleEntriesIdDetailsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleEntriesIdDetailsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleEntriesIdDetailsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleEntriesIdDetailsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleEntriesIdDetailsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleEntriesIdDetailsIdEndpoint: The initialized ScheduleEntriesIdDetailsIdEndpoint object. """ child = ScheduleEntriesIdDetailsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleDetail]: """ Performs a GET request against the /schedule/entries/{id}/details endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleDetail]: """ Performs a GET request against the /schedule/entries/{id}/details endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ScheduleDetail]: The parsed response data. """ - return self._parse_many( - ScheduleDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleDetail, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsIdEndpoint.py index d38fb3052..0e68501b1 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdDetailsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleEntriesIdDetailsIdEndpoint( @@ -16,18 +15,13 @@ class ScheduleEntriesIdDetailsIdEndpoint( IGettable[ScheduleDetail, ConnectWiseManageRequestParams], IPaginateable[ScheduleDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleDetail) IPaginateable.__init__(self, ScheduleDetail) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleDetail]: """ Performs a GET request against the /schedule/entries/{id}/details/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleDetail, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleDetail: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleDetail: """ Performs a GET request against the /schedule/entries/{id}/details/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: ScheduleDetail: The parsed response data. """ - return self._parse_one( - ScheduleDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ScheduleDetail, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdEndpoint.py index 0bdbd4f50..559e2923a 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleEntriesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleEntriesIdDetailsEndpoint import ( - ScheduleEntriesIdDetailsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ScheduleEntriesIdDetailsEndpoint import ScheduleEntriesIdDetailsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ScheduleEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleEntriesIdEndpoint( ConnectWiseEndpoint, IGettable[ScheduleEntry, ConnectWiseManageRequestParams], - IPuttable[ScheduleEntry, ConnectWiseManageRequestParams], IPatchable[ScheduleEntry, ConnectWiseManageRequestParams], + IPuttable[ScheduleEntry, ConnectWiseManageRequestParams], IPaginateable[ScheduleEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleEntry) - IPuttable.__init__(self, ScheduleEntry) IPatchable.__init__(self, ScheduleEntry) + IPuttable.__init__(self, ScheduleEntry) IPaginateable.__init__(self, ScheduleEntry) - self.details = self._register_child_endpoint( - ScheduleEntriesIdDetailsEndpoint(client, parent_endpoint=self) - ) + self.details = self._register_child_endpoint(ScheduleEntriesIdDetailsEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleEntry]: """ Performs a GET request against the /schedule/entries/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleEntry, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleEntry, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleEntry: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /schedule/entries/{id} endpoint. + Performs a DELETE request against the /schedule/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ScheduleEntry: The parsed response data. """ - return self._parse_one( - ScheduleEntry, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleEntry: """ - Performs a DELETE request against the /schedule/entries/{id} endpoint. + Performs a GET request against the /schedule/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ScheduleEntry: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ScheduleEntry, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleEntry: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ScheduleEntry: """ - Performs a PUT request against the /schedule/entries/{id} endpoint. + Performs a PATCH request against the /schedule/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: ScheduleEntry: The parsed response data. """ - return self._parse_one( - ScheduleEntry, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ScheduleEntry, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleEntry: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleEntry: """ - Performs a PATCH request against the /schedule/entries/{id} endpoint. + Performs a PUT request against the /schedule/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +93,4 @@ def patch( Returns: ScheduleEntry: The parsed response data. """ - return self._parse_one( - ScheduleEntry, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ScheduleEntry, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCopyEndpoint.py index d5c2b32b2..d1f284715 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCopyEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import HolidayList -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ScheduleHolidaylistsCopyEndpoint( - ConnectWiseEndpoint, IPostable[HolidayList, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) +class ScheduleHolidaylistsCopyEndpoint(ConnectWiseEndpoint, IPostable[HolidayList, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, HolidayList) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> HolidayList: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> HolidayList: """ Performs a POST request against the /schedule/holidayLists/copy endpoint. @@ -32,6 +24,4 @@ def post( Returns: HolidayList: The parsed response data. """ - return self._parse_one( - HolidayList, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(HolidayList, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCountEndpoint.py index 16af188e5..5396f2dbd 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleHolidaylistsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/holidayLists/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/holidayLists/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsEndpoint.py index 9b8111ea3..1762896b9 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdEndpoint import ( - ScheduleHolidaylistsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleHolidaylistsInfoEndpoint import ( - ScheduleHolidaylistsInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdEndpoint import ScheduleHolidaylistsIdEndpoint +from pyconnectwise.endpoints.manage.ScheduleHolidaylistsInfoEndpoint import ScheduleHolidaylistsInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "holidaylists", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "holidaylists", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - ScheduleHolidaylistsInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ScheduleHolidaylistsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleHolidaylistsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleHolidaylistsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleHolidaylistsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleHolidaylistsIdEndpoint: The initialized ScheduleHolidaylistsIdEndpoint object. """ child = ScheduleHolidaylistsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdEndpoint.py index 6f171c2a5..d9c1cb570 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdEndpoint.py @@ -1,21 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdHolidaysEndpoint import ( - ScheduleHolidaylistsIdHolidaysEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdInfoEndpoint import ( - ScheduleHolidaylistsIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdHolidaysEndpoint import ScheduleHolidaylistsIdHolidaysEndpoint +from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdInfoEndpoint import ScheduleHolidaylistsIdInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - ScheduleHolidaylistsIdInfoEndpoint(client, parent_endpoint=self) - ) self.holidays = self._register_child_endpoint( ScheduleHolidaylistsIdHolidaysEndpoint(client, parent_endpoint=self) ) + self.info = self._register_child_endpoint(ScheduleHolidaylistsIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysCountEndpoint.py index eb9aee2d6..5fcb6b47a 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsIdHolidaysCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleHolidaylistsIdHolidaysCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/holidayLists/{id}/holidays/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/holidayLists/{id}/holidays/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysEndpoint.py index 21fdca965..0554e0b1e 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdHolidaysIdEndpoint import ( ScheduleHolidaylistsIdHolidaysIdEndpoint, @@ -6,28 +8,27 @@ ScheduleHolidaylistsIdHolidaysInfoEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ScheduleHolidaylistsIdHolidaysEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "holidays", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "holidays", parent_endpoint=parent_endpoint) self.info = self._register_child_endpoint( ScheduleHolidaylistsIdHolidaysInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ScheduleHolidaylistsIdHolidaysIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleHolidaylistsIdHolidaysIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleHolidaylistsIdHolidaysIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleHolidaylistsIdHolidaysIdEndpoint: The initialized ScheduleHolidaylistsIdHolidaysIdEndpoint object. """ - child = ScheduleHolidaylistsIdHolidaysIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ScheduleHolidaylistsIdHolidaysIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdEndpoint.py index 1a09eb1e7..2fd4c8192 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdEndpoint.py @@ -1,14 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdHolidaysIdInfoEndpoint import ( ScheduleHolidaylistsIdHolidaysIdInfoEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ScheduleHolidaylistsIdHolidaysIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.info = self._register_child_endpoint( ScheduleHolidaylistsIdHolidaysIdInfoEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdInfoEndpoint.py index eb4a045a8..aaf01d19c 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import HolidayInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsIdHolidaysIdInfoEndpoint( @@ -16,18 +15,13 @@ class ScheduleHolidaylistsIdHolidaysIdInfoEndpoint( IGettable[HolidayInfo, ConnectWiseManageRequestParams], IPaginateable[HolidayInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, HolidayInfo) IPaginateable.__init__(self, HolidayInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[HolidayInfo]: """ Performs a GET request against the /schedule/holidaylists/{id}/holidays/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - HolidayInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), HolidayInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> HolidayInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> HolidayInfo: """ Performs a GET request against the /schedule/holidaylists/{id}/holidays/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: HolidayInfo: The parsed response data. """ - return self._parse_one( - HolidayInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(HolidayInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysInfoEndpoint.py index 9f46170cb..1c5d5ebbd 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdHolidaysInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import HolidayInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsIdHolidaysInfoEndpoint( @@ -16,18 +15,13 @@ class ScheduleHolidaylistsIdHolidaysInfoEndpoint( IGettable[list[HolidayInfo], ConnectWiseManageRequestParams], IPaginateable[HolidayInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[HolidayInfo]) IPaginateable.__init__(self, HolidayInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[HolidayInfo]: """ Performs a GET request against the /schedule/holidaylists/{id}/holidays/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - HolidayInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), HolidayInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[HolidayInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[HolidayInfo]: """ Performs a GET request against the /schedule/holidaylists/{id}/holidays/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: list[HolidayInfo]: The parsed response data. """ - return self._parse_many( - HolidayInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(HolidayInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdInfoEndpoint.py index e53ec0b27..b5ffbefb1 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import HolidayListInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ScheduleHolidaylistsIdInfoEndpoint( IGettable[HolidayListInfo, ConnectWiseManageRequestParams], IPaginateable[HolidayListInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, HolidayListInfo) IPaginateable.__init__(self, HolidayListInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[HolidayListInfo]: """ Performs a GET request against the /schedule/holidaylists/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - HolidayListInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), HolidayListInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> HolidayListInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> HolidayListInfo: """ Performs a GET request against the /schedule/holidaylists/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: HolidayListInfo: The parsed response data. """ - return self._parse_one( - HolidayListInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(HolidayListInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesEndpoint.py index e5aa57e1c..37b0a6ecd 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ScheduleHolidaylistsIdUsagesListEndpoint import ( ScheduleHolidaylistsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ScheduleHolidaylistsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /schedule/holidayLists/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /schedule/holidayLists/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesListEndpoint.py index 9410544f2..911432423 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ScheduleHolidaylistsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /schedule/holidayLists/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /schedule/holidayLists/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsInfoEndpoint.py index 5c8ed8475..9800335a6 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleHolidaylistsInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import HolidayListInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleHolidaylistsInfoEndpoint( @@ -16,18 +15,13 @@ class ScheduleHolidaylistsInfoEndpoint( IGettable[list[HolidayListInfo], ConnectWiseManageRequestParams], IPaginateable[HolidayListInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[HolidayListInfo]) IPaginateable.__init__(self, HolidayListInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[HolidayListInfo]: """ Performs a GET request against the /schedule/holidaylists/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - HolidayListInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), HolidayListInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[HolidayListInfo]: """ Performs a GET request against the /schedule/holidaylists/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[HolidayListInfo]: The parsed response data. """ - return self._parse_many( - HolidayListInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(HolidayListInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsCountEndpoint.py index 0957c5627..f97e56c88 100644 --- a/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SchedulePortalcalendarsCountEndpoint( @@ -16,18 +15,13 @@ class SchedulePortalcalendarsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/portalcalendars/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/portalcalendars/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsEndpoint.py b/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsEndpoint.py index b1d8539bc..503d9982f 100644 --- a/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SchedulePortalcalendarsCountEndpoint import ( - SchedulePortalcalendarsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SchedulePortalcalendarsIdEndpoint import ( - SchedulePortalcalendarsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SchedulePortalcalendarsCountEndpoint import SchedulePortalcalendarsCountEndpoint +from pyconnectwise.endpoints.manage.SchedulePortalcalendarsIdEndpoint import SchedulePortalcalendarsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PortalCalendar from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SchedulePortalcalendarsEndpoint( @@ -22,35 +17,28 @@ class SchedulePortalcalendarsEndpoint( IGettable[list[PortalCalendar], ConnectWiseManageRequestParams], IPaginateable[PortalCalendar, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "portalcalendars", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "portalcalendars", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalCalendar]) IPaginateable.__init__(self, PortalCalendar) - self.count = self._register_child_endpoint( - SchedulePortalcalendarsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SchedulePortalcalendarsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SchedulePortalcalendarsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SchedulePortalcalendarsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SchedulePortalcalendarsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SchedulePortalcalendarsIdEndpoint: The initialized SchedulePortalcalendarsIdEndpoint object. """ child = SchedulePortalcalendarsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalCalendar]: """ Performs a GET request against the /schedule/portalcalendars endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalCalendar, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalCalendar, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[PortalCalendar]: """ Performs a GET request against the /schedule/portalcalendars endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[PortalCalendar]: The parsed response data. """ - return self._parse_many( - PortalCalendar, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(PortalCalendar, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsIdEndpoint.py index b45258970..c5e0a7d3a 100644 --- a/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SchedulePortalcalendarsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalCalendar from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SchedulePortalcalendarsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalCalendar, ConnectWiseManageRequestParams], - IPuttable[PortalCalendar, ConnectWiseManageRequestParams], IPatchable[PortalCalendar, ConnectWiseManageRequestParams], + IPuttable[PortalCalendar, ConnectWiseManageRequestParams], IPaginateable[PortalCalendar, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalCalendar) - IPuttable.__init__(self, PortalCalendar) IPatchable.__init__(self, PortalCalendar) + IPuttable.__init__(self, PortalCalendar) IPaginateable.__init__(self, PortalCalendar) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalCalendar]: """ Performs a GET request against the /schedule/portalcalendars/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalCalendar, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalCalendar, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalCalendar: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PortalCalendar: """ Performs a GET request against the /schedule/portalcalendars/{id} endpoint. @@ -74,18 +56,11 @@ def get( Returns: PortalCalendar: The parsed response data. """ - return self._parse_one( - PortalCalendar, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(PortalCalendar, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalCalendar: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PortalCalendar: """ - Performs a PUT request against the /schedule/portalcalendars/{id} endpoint. + Performs a PATCH request against the /schedule/portalcalendars/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +68,11 @@ def put( Returns: PortalCalendar: The parsed response data. """ - return self._parse_one( - PortalCalendar, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(PortalCalendar, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalCalendar: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PortalCalendar: """ - Performs a PATCH request against the /schedule/portalcalendars/{id} endpoint. + Performs a PUT request against the /schedule/portalcalendars/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +80,4 @@ def patch( Returns: PortalCalendar: The parsed response data. """ - return self._parse_one( - PortalCalendar, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PortalCalendar, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesCountEndpoint.py index 8782cb674..baa360dce 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleRemindertimesCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleRemindertimesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/reminderTimes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/reminderTimes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesEndpoint.py index 7b2d479e0..5e1e36b21 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleRemindertimesCountEndpoint import ( - ScheduleRemindertimesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleRemindertimesIdEndpoint import ( - ScheduleRemindertimesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleRemindertimesCountEndpoint import ScheduleRemindertimesCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleRemindertimesIdEndpoint import ScheduleRemindertimesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleReminderTime from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleRemindertimesEndpoint( @@ -22,35 +17,28 @@ class ScheduleRemindertimesEndpoint( IGettable[list[ScheduleReminderTime], ConnectWiseManageRequestParams], IPaginateable[ScheduleReminderTime, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reminderTimes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reminderTimes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleReminderTime]) IPaginateable.__init__(self, ScheduleReminderTime) - self.count = self._register_child_endpoint( - ScheduleRemindertimesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleRemindertimesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleRemindertimesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleRemindertimesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleRemindertimesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleRemindertimesIdEndpoint: The initialized ScheduleRemindertimesIdEndpoint object. """ child = ScheduleRemindertimesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleReminderTime]: """ Performs a GET request against the /schedule/reminderTimes endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleReminderTime, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleReminderTime, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleReminderTime]: """ Performs a GET request against the /schedule/reminderTimes endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ScheduleReminderTime]: The parsed response data. """ - return self._parse_many( - ScheduleReminderTime, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleReminderTime, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesIdEndpoint.py index 11f3f02da..8e77886c1 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleRemindertimesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ScheduleReminderTime from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleRemindertimesIdEndpoint( ConnectWiseEndpoint, IGettable[ScheduleReminderTime, ConnectWiseManageRequestParams], - IPuttable[ScheduleReminderTime, ConnectWiseManageRequestParams], IPatchable[ScheduleReminderTime, ConnectWiseManageRequestParams], + IPuttable[ScheduleReminderTime, ConnectWiseManageRequestParams], IPaginateable[ScheduleReminderTime, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleReminderTime) - IPuttable.__init__(self, ScheduleReminderTime) IPatchable.__init__(self, ScheduleReminderTime) + IPuttable.__init__(self, ScheduleReminderTime) IPaginateable.__init__(self, ScheduleReminderTime) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleReminderTime]: """ Performs a GET request against the /schedule/reminderTimes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleReminderTime, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleReminderTime, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ScheduleReminderTime: """ Performs a GET request against the /schedule/reminderTimes/{id} endpoint. @@ -74,18 +58,13 @@ def get( Returns: ScheduleReminderTime: The parsed response data. """ - return self._parse_one( - ScheduleReminderTime, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ScheduleReminderTime, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ScheduleReminderTime: """ - Performs a PUT request against the /schedule/reminderTimes/{id} endpoint. + Performs a PATCH request against the /schedule/reminderTimes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +72,13 @@ def put( Returns: ScheduleReminderTime: The parsed response data. """ - return self._parse_one( - ScheduleReminderTime, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ScheduleReminderTime, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ScheduleReminderTime: """ - Performs a PATCH request against the /schedule/reminderTimes/{id} endpoint. + Performs a PUT request against the /schedule/reminderTimes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +86,4 @@ def patch( Returns: ScheduleReminderTime: The parsed response data. """ - return self._parse_one( - ScheduleReminderTime, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ScheduleReminderTime, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleStatusesCountEndpoint.py index 40ecca375..9c300809c 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleStatusesCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleStatusesEndpoint.py index 27a51ac0f..0255f76fb 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleStatusesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleStatusesCountEndpoint import ( - ScheduleStatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleStatusesIdEndpoint import ( - ScheduleStatusesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ScheduleStatusesCountEndpoint import ScheduleStatusesCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleStatusesIdEndpoint import ScheduleStatusesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ScheduleStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleStatusesEndpoint( @@ -24,36 +18,29 @@ class ScheduleStatusesEndpoint( IPostable[ScheduleStatus, ConnectWiseManageRequestParams], IPaginateable[ScheduleStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleStatus]) IPostable.__init__(self, ScheduleStatus) IPaginateable.__init__(self, ScheduleStatus) - self.count = self._register_child_endpoint( - ScheduleStatusesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleStatusesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleStatusesIdEndpoint: The initialized ScheduleStatusesIdEndpoint object. """ child = ScheduleStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleStatus]: """ Performs a GET request against the /schedule/statuses endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleStatus, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleStatus]: """ Performs a GET request against the /schedule/statuses endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[ScheduleStatus]: The parsed response data. """ - return self._parse_many( - ScheduleStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStatus: """ Performs a POST request against the /schedule/statuses endpoint. @@ -112,7 +85,4 @@ def post( Returns: ScheduleStatus: The parsed response data. """ - return self._parse_one( - ScheduleStatus, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ScheduleStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleStatusesIdEndpoint.py index 603676b61..58e0888ab 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleStatusesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ScheduleStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[ScheduleStatus, ConnectWiseManageRequestParams], - IPuttable[ScheduleStatus, ConnectWiseManageRequestParams], IPatchable[ScheduleStatus, ConnectWiseManageRequestParams], + IPuttable[ScheduleStatus, ConnectWiseManageRequestParams], IPaginateable[ScheduleStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleStatus) - IPuttable.__init__(self, ScheduleStatus) IPatchable.__init__(self, ScheduleStatus) + IPuttable.__init__(self, ScheduleStatus) IPaginateable.__init__(self, ScheduleStatus) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleStatus]: """ Performs a GET request against the /schedule/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /schedule/statuses/{id} endpoint. + Performs a DELETE request against the /schedule/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ScheduleStatus: The parsed response data. """ - return self._parse_one( - ScheduleStatus, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStatus: """ - Performs a DELETE request against the /schedule/statuses/{id} endpoint. + Performs a GET request against the /schedule/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ScheduleStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ScheduleStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStatus: """ - Performs a PUT request against the /schedule/statuses/{id} endpoint. + Performs a PATCH request against the /schedule/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: ScheduleStatus: The parsed response data. """ - return self._parse_one( - ScheduleStatus, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ScheduleStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStatus: """ - Performs a PATCH request against the /schedule/statuses/{id} endpoint. + Performs a PUT request against the /schedule/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: ScheduleStatus: The parsed response data. """ - return self._parse_one( - ScheduleStatus, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ScheduleStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesCountEndpoint.py index f85e8edc9..8416180cb 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesEndpoint.py index a09120d73..f4897f5d0 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleTypesCountEndpoint import ( - ScheduleTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleTypesIdEndpoint import ( - ScheduleTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleTypesInfoEndpoint import ( - ScheduleTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ScheduleTypesCountEndpoint import ScheduleTypesCountEndpoint +from pyconnectwise.endpoints.manage.ScheduleTypesIdEndpoint import ScheduleTypesIdEndpoint +from pyconnectwise.endpoints.manage.ScheduleTypesInfoEndpoint import ScheduleTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ScheduleType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesEndpoint( @@ -27,39 +19,30 @@ class ScheduleTypesEndpoint( IPostable[ScheduleType, ConnectWiseManageRequestParams], IPaginateable[ScheduleType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleType]) IPostable.__init__(self, ScheduleType) IPaginateable.__init__(self, ScheduleType) - self.count = self._register_child_endpoint( - ScheduleTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ScheduleTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ScheduleTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ScheduleTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ScheduleTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ScheduleTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ScheduleTypesIdEndpoint: The initialized ScheduleTypesIdEndpoint object. """ child = ScheduleTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleType]: """ Performs a GET request against the /schedule/types endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ScheduleType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ScheduleType]: """ Performs a GET request against the /schedule/types endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[ScheduleType]: The parsed response data. """ - return self._parse_many( - ScheduleType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ScheduleType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleType: """ Performs a POST request against the /schedule/types endpoint. @@ -117,6 +85,4 @@ def post( Returns: ScheduleType: The parsed response data. """ - return self._parse_one( - ScheduleType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ScheduleType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdEndpoint.py index a9ac84058..2e56e6810 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleTypesIdInfoEndpoint import ( - ScheduleTypesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ScheduleTypesIdUsagesEndpoint import ( - ScheduleTypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ScheduleTypesIdInfoEndpoint import ScheduleTypesIdInfoEndpoint +from pyconnectwise.endpoints.manage.ScheduleTypesIdUsagesEndpoint import ScheduleTypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ScheduleType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesIdEndpoint( ConnectWiseEndpoint, IGettable[ScheduleType, ConnectWiseManageRequestParams], - IPuttable[ScheduleType, ConnectWiseManageRequestParams], IPatchable[ScheduleType, ConnectWiseManageRequestParams], + IPuttable[ScheduleType, ConnectWiseManageRequestParams], IPaginateable[ScheduleType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleType) - IPuttable.__init__(self, ScheduleType) IPatchable.__init__(self, ScheduleType) + IPuttable.__init__(self, ScheduleType) IPaginateable.__init__(self, ScheduleType) - self.usages = self._register_child_endpoint( - ScheduleTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ScheduleTypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ScheduleTypesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ScheduleTypesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleType]: """ Performs a GET request against the /schedule/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /schedule/types/{id} endpoint. + Performs a DELETE request against the /schedule/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ScheduleType: The parsed response data. """ - return self._parse_one( - ScheduleType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleType: """ - Performs a DELETE request against the /schedule/types/{id} endpoint. + Performs a GET request against the /schedule/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ScheduleType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ScheduleType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ScheduleType: """ - Performs a PUT request against the /schedule/types/{id} endpoint. + Performs a PATCH request against the /schedule/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +83,11 @@ def put( Returns: ScheduleType: The parsed response data. """ - return self._parse_one( - ScheduleType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ScheduleType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleType: """ - Performs a PATCH request against the /schedule/types/{id} endpoint. + Performs a PUT request against the /schedule/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,7 +95,4 @@ def patch( Returns: ScheduleType: The parsed response data. """ - return self._parse_one( - ScheduleType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ScheduleType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdInfoEndpoint.py index 8af70b68d..451111da9 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ScheduleTypesIdInfoEndpoint( IGettable[ScheduleTypeInfo, ConnectWiseManageRequestParams], IPaginateable[ScheduleTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleTypeInfo) IPaginateable.__init__(self, ScheduleTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleTypeInfo]: """ Performs a GET request against the /schedule/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleTypeInfo: """ Performs a GET request against the /schedule/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ScheduleTypeInfo: The parsed response data. """ - return self._parse_one( - ScheduleTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ScheduleTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesEndpoint.py index 9113eb054..ac289f6a8 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleTypesIdUsagesListEndpoint import ( - ScheduleTypesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleTypesIdUsagesListEndpoint import ScheduleTypesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ScheduleTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ScheduleTypesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ScheduleTypesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /schedule/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /schedule/types/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesListEndpoint.py index d54eb2bfc..7e3c130f0 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ScheduleTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /schedule/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /schedule/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoCountEndpoint.py index 0e1262f33..43f7c2813 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ScheduleTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /schedule/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /schedule/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoEndpoint.py index e0b25b52f..2cbd43551 100644 --- a/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ScheduleTypesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ScheduleTypesInfoCountEndpoint import ( - ScheduleTypesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ScheduleTypesInfoCountEndpoint import ScheduleTypesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ScheduleTypesInfoEndpoint( @@ -19,22 +16,15 @@ class ScheduleTypesInfoEndpoint( IGettable[list[ScheduleTypeInfo], ConnectWiseManageRequestParams], IPaginateable[ScheduleTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleTypeInfo]) IPaginateable.__init__(self, ScheduleTypeInfo) - self.count = self._register_child_endpoint( - ScheduleTypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ScheduleTypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleTypeInfo]: """ Performs a GET request against the /schedule/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleTypeInfo]: """ Performs a GET request against the /schedule/types/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ScheduleTypeInfo]: The parsed response data. """ - return self._parse_many( - ScheduleTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsCopyEndpoint.py index 63ef8dd2c..7051c80a0 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsCopyEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Board -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ServiceBoardsCopyEndpoint( - ConnectWiseEndpoint, IPostable[Board, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) +class ServiceBoardsCopyEndpoint(ConnectWiseEndpoint, IPostable[Board, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, Board) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Board: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Board: """ Performs a POST request against the /service/boards/copy endpoint. @@ -32,6 +24,4 @@ def post( Returns: Board: The parsed response data. """ - return self._parse_one( - Board, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Board, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsCountEndpoint.py index e203a50b6..0b3489520 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsEndpoint.py index e9d0ed524..8b4d73f14 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsCopyEndpoint import ( - ServiceBoardsCopyEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsCountEndpoint import ( - ServiceBoardsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdEndpoint import ( - ServiceBoardsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsCopyEndpoint import ServiceBoardsCopyEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsCountEndpoint import ServiceBoardsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdEndpoint import ServiceBoardsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Board from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsEndpoint( @@ -27,39 +19,30 @@ class ServiceBoardsEndpoint( IPostable[Board, ConnectWiseManageRequestParams], IPaginateable[Board, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "boards", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "boards", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Board]) IPostable.__init__(self, Board) IPaginateable.__init__(self, Board) - self.copy = self._register_child_endpoint( - ServiceBoardsCopyEndpoint(client, parent_endpoint=self) - ) - self.count = self._register_child_endpoint( - ServiceBoardsCountEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(ServiceBoardsCopyEndpoint(client, parent_endpoint=self)) + self.count = self._register_child_endpoint(ServiceBoardsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceBoardsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdEndpoint: The initialized ServiceBoardsIdEndpoint object. """ child = ServiceBoardsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Board]: """ Performs a GET request against the /service/boards endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Board, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Board, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Board]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Board]: """ Performs a GET request against the /service/boards endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Board]: The parsed response data. """ - return self._parse_many( - Board, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Board, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Board: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Board: """ Performs a POST request against the /service/boards endpoint. @@ -117,6 +83,4 @@ def post( Returns: Board: The parsed response data. """ - return self._parse_one( - Board, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Board, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesCountEndpoint.py index ac0ba5e8b..90580c9f4 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdAutoassignresourcesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdAutoassignresourcesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/autoAssignResources/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/autoAssignResources/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesEndpoint.py index afb6c51fb..bd4b2bb22 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdAutoassignresourcesCountEndpoint import ( ServiceBoardsIdAutoassignresourcesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceBoardsIdAutoassignresourcesIdEndpoint import ( ServiceBoardsIdAutoassignresourcesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardAutoAssignResource from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdAutoassignresourcesEndpoint( @@ -24,40 +22,31 @@ class ServiceBoardsIdAutoassignresourcesEndpoint( IPostable[BoardAutoAssignResource, ConnectWiseManageRequestParams], IPaginateable[BoardAutoAssignResource, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "autoAssignResources", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "autoAssignResources", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardAutoAssignResource]) IPostable.__init__(self, BoardAutoAssignResource) IPaginateable.__init__(self, BoardAutoAssignResource) self.count = self._register_child_endpoint( - ServiceBoardsIdAutoassignresourcesCountEndpoint( - client, parent_endpoint=self - ) + ServiceBoardsIdAutoassignresourcesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceBoardsIdAutoassignresourcesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdAutoassignresourcesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdAutoassignresourcesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdAutoassignresourcesIdEndpoint: The initialized ServiceBoardsIdAutoassignresourcesIdEndpoint object. """ - child = ServiceBoardsIdAutoassignresourcesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceBoardsIdAutoassignresourcesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardAutoAssignResource]: """ Performs a GET request against the /service/boards/{id}/autoAssignResources endpoint and returns an initialized PaginatedResponse object. @@ -75,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardAutoAssignResource, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardAutoAssignResource, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardAutoAssignResource]: """ Performs a GET request against the /service/boards/{id}/autoAssignResources endpoint. @@ -97,15 +79,10 @@ def get( Returns: list[BoardAutoAssignResource]: The parsed response data. """ - return self._parse_many( - BoardAutoAssignResource, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardAutoAssignResource, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardAutoAssignResource: """ Performs a POST request against the /service/boards/{id}/autoAssignResources endpoint. @@ -116,7 +93,4 @@ def post( Returns: BoardAutoAssignResource: The parsed response data. """ - return self._parse_one( - BoardAutoAssignResource, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BoardAutoAssignResource, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesIdEndpoint.py index 76b001158..a1a9aeb13 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutoassignresourcesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardAutoAssignResource from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdAutoassignresourcesIdEndpoint( ConnectWiseEndpoint, IGettable[BoardAutoAssignResource, ConnectWiseManageRequestParams], - IPuttable[BoardAutoAssignResource, ConnectWiseManageRequestParams], IPatchable[BoardAutoAssignResource, ConnectWiseManageRequestParams], + IPuttable[BoardAutoAssignResource, ConnectWiseManageRequestParams], IPaginateable[BoardAutoAssignResource, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardAutoAssignResource) - IPuttable.__init__(self, BoardAutoAssignResource) IPatchable.__init__(self, BoardAutoAssignResource) + IPuttable.__init__(self, BoardAutoAssignResource) IPaginateable.__init__(self, BoardAutoAssignResource) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardAutoAssignResource]: """ Performs a GET request against the /service/boards/{id}/autoAssignResources/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardAutoAssignResource, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardAutoAssignResource, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardAutoAssignResource: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/autoAssignResources/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/autoAssignResources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardAutoAssignResource: The parsed response data. """ - return self._parse_one( - BoardAutoAssignResource, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> BoardAutoAssignResource: """ - Performs a DELETE request against the /service/boards/{id}/autoAssignResources/{id} endpoint. + Performs a GET request against the /service/boards/{id}/autoAssignResources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardAutoAssignResource: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardAutoAssignResource, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> BoardAutoAssignResource: """ - Performs a PUT request against the /service/boards/{id}/autoAssignResources/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/autoAssignResources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: BoardAutoAssignResource: The parsed response data. """ - return self._parse_one( - BoardAutoAssignResource, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(BoardAutoAssignResource, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardAutoAssignResource: """ - Performs a PATCH request against the /service/boards/{id}/autoAssignResources/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/autoAssignResources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: BoardAutoAssignResource: The parsed response data. """ - return self._parse_one( - BoardAutoAssignResource, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BoardAutoAssignResource, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesCountEndpoint.py index 8bf31f8e3..af2a690e0 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdAutotemplatesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdAutotemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/autoTemplates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/autoTemplates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesEndpoint.py index 8a558ab3d..72d8b9197 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdAutotemplatesCountEndpoint import ( ServiceBoardsIdAutotemplatesCountEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceBoardsIdAutotemplatesIdEndpoint import ( - ServiceBoardsIdAutotemplatesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdAutotemplatesIdEndpoint import ServiceBoardsIdAutotemplatesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardAutoTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdAutotemplatesEndpoint( @@ -24,10 +20,8 @@ class ServiceBoardsIdAutotemplatesEndpoint( IPostable[BoardAutoTemplate, ConnectWiseManageRequestParams], IPaginateable[BoardAutoTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "autoTemplates", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "autoTemplates", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardAutoTemplate]) IPostable.__init__(self, BoardAutoTemplate) IPaginateable.__init__(self, BoardAutoTemplate) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ServiceBoardsIdAutotemplatesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceBoardsIdAutotemplatesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdAutotemplatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdAutotemplatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdAutotemplatesIdEndpoint: The initialized ServiceBoardsIdAutotemplatesIdEndpoint object. """ - child = ServiceBoardsIdAutotemplatesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceBoardsIdAutotemplatesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardAutoTemplate]: """ Performs a GET request against the /service/boards/{id}/autoTemplates endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardAutoTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardAutoTemplate, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardAutoTemplate]: """ Performs a GET request against the /service/boards/{id}/autoTemplates endpoint. @@ -95,16 +77,9 @@ def get( Returns: list[BoardAutoTemplate]: The parsed response data. """ - return self._parse_many( - BoardAutoTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardAutoTemplate, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardAutoTemplate: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardAutoTemplate: """ Performs a POST request against the /service/boards/{id}/autoTemplates endpoint. @@ -114,7 +89,4 @@ def post( Returns: BoardAutoTemplate: The parsed response data. """ - return self._parse_one( - BoardAutoTemplate, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BoardAutoTemplate, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesIdEndpoint.py index 220e8cf7d..a0998c075 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdAutotemplatesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardAutoTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdAutotemplatesIdEndpoint( ConnectWiseEndpoint, IGettable[BoardAutoTemplate, ConnectWiseManageRequestParams], - IPuttable[BoardAutoTemplate, ConnectWiseManageRequestParams], IPatchable[BoardAutoTemplate, ConnectWiseManageRequestParams], + IPuttable[BoardAutoTemplate, ConnectWiseManageRequestParams], IPaginateable[BoardAutoTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardAutoTemplate) - IPuttable.__init__(self, BoardAutoTemplate) IPatchable.__init__(self, BoardAutoTemplate) + IPuttable.__init__(self, BoardAutoTemplate) IPaginateable.__init__(self, BoardAutoTemplate) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardAutoTemplate]: """ Performs a GET request against the /service/boards/{id}/autoTemplates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardAutoTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardAutoTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardAutoTemplate: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/autoTemplates/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/autoTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardAutoTemplate: The parsed response data. """ - return self._parse_one( - BoardAutoTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardAutoTemplate: """ - Performs a DELETE request against the /service/boards/{id}/autoTemplates/{id} endpoint. + Performs a GET request against the /service/boards/{id}/autoTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardAutoTemplate: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardAutoTemplate, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardAutoTemplate: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardAutoTemplate: """ - Performs a PUT request against the /service/boards/{id}/autoTemplates/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/autoTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: BoardAutoTemplate: The parsed response data. """ - return self._parse_one( - BoardAutoTemplate, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(BoardAutoTemplate, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardAutoTemplate: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardAutoTemplate: """ - Performs a PATCH request against the /service/boards/{id}/autoTemplates/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/autoTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: BoardAutoTemplate: The parsed response data. """ - return self._parse_one( - BoardAutoTemplate, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BoardAutoTemplate, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdEndpoint.py index 928985b2a..2d2ce1e70 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdEndpoint.py @@ -1,109 +1,68 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdAutoassignresourcesEndpoint import ( ServiceBoardsIdAutoassignresourcesEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceBoardsIdAutotemplatesEndpoint import ( - ServiceBoardsIdAutotemplatesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdExcludedmembersEndpoint import ( - ServiceBoardsIdExcludedmembersEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsEndpoint import ( - ServiceBoardsIdItemsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdNotificationsEndpoint import ( - ServiceBoardsIdNotificationsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesEndpoint import ( - ServiceBoardsIdStatusesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesEndpoint import ( - ServiceBoardsIdSubtypesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsEndpoint import ( - ServiceBoardsIdTeamsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesEndpoint import ( - ServiceBoardsIdTypesEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdAutotemplatesEndpoint import ServiceBoardsIdAutotemplatesEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdExcludedmembersEndpoint import ServiceBoardsIdExcludedmembersEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsEndpoint import ServiceBoardsIdItemsEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdNotificationsEndpoint import ServiceBoardsIdNotificationsEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesEndpoint import ServiceBoardsIdStatusesEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesEndpoint import ServiceBoardsIdSubtypesEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsEndpoint import ServiceBoardsIdTeamsEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesEndpoint import ServiceBoardsIdTypesEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesubtypeitemassociationsEndpoint import ( ServiceBoardsIdTypesubtypeitemassociationsEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceBoardsIdUsagesEndpoint import ( - ServiceBoardsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdUsagesEndpoint import ServiceBoardsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Board from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdEndpoint( ConnectWiseEndpoint, IGettable[Board, ConnectWiseManageRequestParams], - IPuttable[Board, ConnectWiseManageRequestParams], IPatchable[Board, ConnectWiseManageRequestParams], + IPuttable[Board, ConnectWiseManageRequestParams], IPaginateable[Board, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Board) - IPuttable.__init__(self, Board) IPatchable.__init__(self, Board) + IPuttable.__init__(self, Board) IPaginateable.__init__(self, Board) self.auto_assign_resources = self._register_child_endpoint( ServiceBoardsIdAutoassignresourcesEndpoint(client, parent_endpoint=self) ) - self.teams = self._register_child_endpoint( - ServiceBoardsIdTeamsEndpoint(client, parent_endpoint=self) - ) - self.type_sub_type_item_associations = self._register_child_endpoint( - ServiceBoardsIdTypesubtypeitemassociationsEndpoint( - client, parent_endpoint=self - ) - ) - self.statuses = self._register_child_endpoint( - ServiceBoardsIdStatusesEndpoint(client, parent_endpoint=self) - ) self.auto_templates = self._register_child_endpoint( ServiceBoardsIdAutotemplatesEndpoint(client, parent_endpoint=self) ) - self.usages = self._register_child_endpoint( - ServiceBoardsIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.items = self._register_child_endpoint( - ServiceBoardsIdItemsEndpoint(client, parent_endpoint=self) + self.excluded_members = self._register_child_endpoint( + ServiceBoardsIdExcludedmembersEndpoint(client, parent_endpoint=self) ) + self.items = self._register_child_endpoint(ServiceBoardsIdItemsEndpoint(client, parent_endpoint=self)) self.notifications = self._register_child_endpoint( ServiceBoardsIdNotificationsEndpoint(client, parent_endpoint=self) ) - self.types = self._register_child_endpoint( - ServiceBoardsIdTypesEndpoint(client, parent_endpoint=self) - ) - self.subtypes = self._register_child_endpoint( - ServiceBoardsIdSubtypesEndpoint(client, parent_endpoint=self) - ) - self.excluded_members = self._register_child_endpoint( - ServiceBoardsIdExcludedmembersEndpoint(client, parent_endpoint=self) + self.statuses = self._register_child_endpoint(ServiceBoardsIdStatusesEndpoint(client, parent_endpoint=self)) + self.subtypes = self._register_child_endpoint(ServiceBoardsIdSubtypesEndpoint(client, parent_endpoint=self)) + self.teams = self._register_child_endpoint(ServiceBoardsIdTeamsEndpoint(client, parent_endpoint=self)) + self.type_sub_type_item_associations = self._register_child_endpoint( + ServiceBoardsIdTypesubtypeitemassociationsEndpoint(client, parent_endpoint=self) ) + self.types = self._register_child_endpoint(ServiceBoardsIdTypesEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ServiceBoardsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Board]: """ Performs a GET request against the /service/boards/{id} endpoint and returns an initialized PaginatedResponse object. @@ -120,54 +79,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Board, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Board, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Board: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id} endpoint. + Performs a DELETE request against the /service/boards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Board: The parsed response data. """ - return self._parse_one( - Board, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Board: """ - Performs a DELETE request against the /service/boards/{id} endpoint. + Performs a GET request against the /service/boards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Board: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Board, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Board: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Board: """ - Performs a PUT request against the /service/boards/{id} endpoint. + Performs a PATCH request against the /service/boards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -175,17 +113,11 @@ def put( Returns: Board: The parsed response data. """ - return self._parse_one( - Board, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Board, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Board: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Board: """ - Performs a PATCH request against the /service/boards/{id} endpoint. + Performs a PUT request against the /service/boards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -193,6 +125,4 @@ def patch( Returns: Board: The parsed response data. """ - return self._parse_one( - Board, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Board, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersCountEndpoint.py index 84eca96de..fcb4461d3 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdExcludedmembersCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdExcludedmembersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/excludedMembers/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/excludedMembers/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersEndpoint.py index 1894a3767..084797837 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdExcludedmembersCountEndpoint import ( ServiceBoardsIdExcludedmembersCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceBoardsIdExcludedmembersIdEndpoint import ( ServiceBoardsIdExcludedmembersIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardExcludedMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdExcludedmembersEndpoint( @@ -24,10 +22,8 @@ class ServiceBoardsIdExcludedmembersEndpoint( IPostable[BoardExcludedMember, ConnectWiseManageRequestParams], IPaginateable[BoardExcludedMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "excludedMembers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "excludedMembers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardExcludedMember]) IPostable.__init__(self, BoardExcludedMember) IPaginateable.__init__(self, BoardExcludedMember) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ServiceBoardsIdExcludedmembersCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceBoardsIdExcludedmembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdExcludedmembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdExcludedmembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdExcludedmembersIdEndpoint: The initialized ServiceBoardsIdExcludedmembersIdEndpoint object. """ - child = ServiceBoardsIdExcludedmembersIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceBoardsIdExcludedmembersIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardExcludedMember]: """ Performs a GET request against the /service/boards/{id}/excludedMembers endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardExcludedMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardExcludedMember, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardExcludedMember]: """ Performs a GET request against the /service/boards/{id}/excludedMembers endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[BoardExcludedMember]: The parsed response data. """ - return self._parse_many( - BoardExcludedMember, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardExcludedMember, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardExcludedMember: """ Performs a POST request against the /service/boards/{id}/excludedMembers endpoint. @@ -114,7 +93,4 @@ def post( Returns: BoardExcludedMember: The parsed response data. """ - return self._parse_one( - BoardExcludedMember, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BoardExcludedMember, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersIdEndpoint.py index c9ae8848e..941ae7b60 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdExcludedmembersIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardExcludedMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdExcludedmembersIdEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdExcludedmembersIdEndpoint( IGettable[BoardExcludedMember, ConnectWiseManageRequestParams], IPaginateable[BoardExcludedMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardExcludedMember) IPaginateable.__init__(self, BoardExcludedMember) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardExcludedMember]: """ Performs a GET request against the /service/boards/{id}/excludedMembers/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,29 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardExcludedMember, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardExcludedMember, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardExcludedMember: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/excludedMembers/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/excludedMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardExcludedMember: The parsed response data. """ - return self._parse_one( - BoardExcludedMember, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> BoardExcludedMember: """ - Performs a DELETE request against the /service/boards/{id}/excludedMembers/{id} endpoint. + Performs a GET request against the /service/boards/{id}/excludedMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardExcludedMember: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardExcludedMember, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsCountEndpoint.py index cb6a4fcf5..0622eb223 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdItemsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/items/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/items/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsEndpoint.py index 26961d995..1f2cf8aa4 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsCountEndpoint import ( - ServiceBoardsIdItemsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdEndpoint import ( - ServiceBoardsIdItemsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsCountEndpoint import ServiceBoardsIdItemsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdEndpoint import ServiceBoardsIdItemsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsEndpoint( @@ -24,36 +18,29 @@ class ServiceBoardsIdItemsEndpoint( IPostable[BoardItem, ConnectWiseManageRequestParams], IPaginateable[BoardItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "items", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "items", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardItem]) IPostable.__init__(self, BoardItem) IPaginateable.__init__(self, BoardItem) - self.count = self._register_child_endpoint( - ServiceBoardsIdItemsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceBoardsIdItemsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceBoardsIdItemsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdItemsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdItemsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdItemsIdEndpoint: The initialized ServiceBoardsIdItemsIdEndpoint object. """ child = ServiceBoardsIdItemsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardItem]: """ Performs a GET request against the /service/boards/{id}/items endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardItem, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardItem, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BoardItem]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BoardItem]: """ Performs a GET request against the /service/boards/{id}/items endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[BoardItem]: The parsed response data. """ - return self._parse_many( - BoardItem, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardItem, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardItem: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardItem: """ Performs a POST request against the /service/boards/{id}/items endpoint. @@ -111,6 +81,4 @@ def post( Returns: BoardItem: The parsed response data. """ - return self._parse_one( - BoardItem, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BoardItem, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsCountEndpoint.py index ec971f9c0..ab7332810 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsIdAssociationsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdItemsIdAssociationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/items/{id}/associations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/items/{id}/associations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsEndpoint.py index 6acaf2482..ee54f5a78 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdAssociationsCountEndpoint import ( ServiceBoardsIdItemsIdAssociationsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdAssociationsIdEndpoint import ( ServiceBoardsIdItemsIdAssociationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardItemAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsIdAssociationsEndpoint( @@ -22,39 +21,30 @@ class ServiceBoardsIdItemsIdAssociationsEndpoint( IGettable[list[BoardItemAssociation], ConnectWiseManageRequestParams], IPaginateable[BoardItemAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "associations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "associations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardItemAssociation]) IPaginateable.__init__(self, BoardItemAssociation) self.count = self._register_child_endpoint( - ServiceBoardsIdItemsIdAssociationsCountEndpoint( - client, parent_endpoint=self - ) + ServiceBoardsIdItemsIdAssociationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceBoardsIdItemsIdAssociationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdItemsIdAssociationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdItemsIdAssociationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdItemsIdAssociationsIdEndpoint: The initialized ServiceBoardsIdItemsIdAssociationsIdEndpoint object. """ - child = ServiceBoardsIdItemsIdAssociationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceBoardsIdItemsIdAssociationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardItemAssociation]: """ Performs a GET request against the /service/boards/{id}/items/{id}/associations endpoint and returns an initialized PaginatedResponse object. @@ -72,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardItemAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardItemAssociation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardItemAssociation]: """ Performs a GET request against the /service/boards/{id}/items/{id}/associations endpoint. @@ -94,7 +77,4 @@ def get( Returns: list[BoardItemAssociation]: The parsed response data. """ - return self._parse_many( - BoardItemAssociation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardItemAssociation, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsIdEndpoint.py index c1140163a..da650a1e3 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdAssociationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardItemAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsIdAssociationsIdEndpoint( ConnectWiseEndpoint, IGettable[BoardItemAssociation, ConnectWiseManageRequestParams], - IPuttable[BoardItemAssociation, ConnectWiseManageRequestParams], IPatchable[BoardItemAssociation, ConnectWiseManageRequestParams], + IPuttable[BoardItemAssociation, ConnectWiseManageRequestParams], IPaginateable[BoardItemAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardItemAssociation) - IPuttable.__init__(self, BoardItemAssociation) IPatchable.__init__(self, BoardItemAssociation) + IPuttable.__init__(self, BoardItemAssociation) IPaginateable.__init__(self, BoardItemAssociation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardItemAssociation]: """ Performs a GET request against the /service/boards/{id}/items/{id}/associations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardItemAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardItemAssociation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardItemAssociation: """ Performs a GET request against the /service/boards/{id}/items/{id}/associations/{id} endpoint. @@ -74,18 +58,13 @@ def get( Returns: BoardItemAssociation: The parsed response data. """ - return self._parse_one( - BoardItemAssociation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(BoardItemAssociation, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> BoardItemAssociation: """ - Performs a PUT request against the /service/boards/{id}/items/{id}/associations/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/items/{id}/associations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +72,13 @@ def put( Returns: BoardItemAssociation: The parsed response data. """ - return self._parse_one( - BoardItemAssociation, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(BoardItemAssociation, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardItemAssociation: """ - Performs a PATCH request against the /service/boards/{id}/items/{id}/associations/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/items/{id}/associations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +86,4 @@ def patch( Returns: BoardItemAssociation: The parsed response data. """ - return self._parse_one( - BoardItemAssociation, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BoardItemAssociation, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdEndpoint.py index 37f6c47d6..be65bca89 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdEndpoint.py @@ -1,53 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdAssociationsEndpoint import ( ServiceBoardsIdItemsIdAssociationsEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdUsagesEndpoint import ( - ServiceBoardsIdItemsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdUsagesEndpoint import ServiceBoardsIdItemsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardItem from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsIdEndpoint( ConnectWiseEndpoint, IGettable[BoardItem, ConnectWiseManageRequestParams], - IPuttable[BoardItem, ConnectWiseManageRequestParams], IPatchable[BoardItem, ConnectWiseManageRequestParams], + IPuttable[BoardItem, ConnectWiseManageRequestParams], IPaginateable[BoardItem, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardItem) - IPuttable.__init__(self, BoardItem) IPatchable.__init__(self, BoardItem) + IPuttable.__init__(self, BoardItem) IPaginateable.__init__(self, BoardItem) self.associations = self._register_child_endpoint( ServiceBoardsIdItemsIdAssociationsEndpoint(client, parent_endpoint=self) ) - self.usages = self._register_child_endpoint( - ServiceBoardsIdItemsIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(ServiceBoardsIdItemsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardItem]: """ Performs a GET request against the /service/boards/{id}/items/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +51,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardItem, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardItem, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardItem: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/items/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/items/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardItem: The parsed response data. """ - return self._parse_one( - BoardItem, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardItem: """ - Performs a DELETE request against the /service/boards/{id}/items/{id} endpoint. + Performs a GET request against the /service/boards/{id}/items/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardItem: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardItem, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardItem: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardItem: """ - Performs a PUT request against the /service/boards/{id}/items/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/items/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +85,11 @@ def put( Returns: BoardItem: The parsed response data. """ - return self._parse_one( - BoardItem, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BoardItem, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardItem: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardItem: """ - Performs a PATCH request against the /service/boards/{id}/items/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/items/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +97,4 @@ def patch( Returns: BoardItem: The parsed response data. """ - return self._parse_one( - BoardItem, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(BoardItem, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesEndpoint.py index b31a2dcd0..39d44e8bf 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdItemsIdUsagesListEndpoint import ( ServiceBoardsIdItemsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ServiceBoardsIdItemsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/items/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/items/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesListEndpoint.py index 2fcd95984..07265e67b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdItemsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdItemsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdItemsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/items/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/items/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsCountEndpoint.py index 01a30e1eb..e02363301 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdNotificationsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdNotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/notifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/notifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsEndpoint.py index 656fcb698..eda61222b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdNotificationsCountEndpoint import ( ServiceBoardsIdNotificationsCountEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceBoardsIdNotificationsIdEndpoint import ( - ServiceBoardsIdNotificationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdNotificationsIdEndpoint import ServiceBoardsIdNotificationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdNotificationsEndpoint( @@ -24,10 +20,8 @@ class ServiceBoardsIdNotificationsEndpoint( IPostable[BoardNotification, ConnectWiseManageRequestParams], IPaginateable[BoardNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardNotification]) IPostable.__init__(self, BoardNotification) IPaginateable.__init__(self, BoardNotification) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ServiceBoardsIdNotificationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceBoardsIdNotificationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdNotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdNotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdNotificationsIdEndpoint: The initialized ServiceBoardsIdNotificationsIdEndpoint object. """ - child = ServiceBoardsIdNotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceBoardsIdNotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardNotification]: """ Performs a GET request against the /service/boards/{id}/notifications endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardNotification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardNotification]: """ Performs a GET request against the /service/boards/{id}/notifications endpoint. @@ -95,16 +77,9 @@ def get( Returns: list[BoardNotification]: The parsed response data. """ - return self._parse_many( - BoardNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardNotification, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardNotification: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardNotification: """ Performs a POST request against the /service/boards/{id}/notifications endpoint. @@ -114,7 +89,4 @@ def post( Returns: BoardNotification: The parsed response data. """ - return self._parse_one( - BoardNotification, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BoardNotification, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsIdEndpoint.py index c1d548090..4106954ca 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdNotificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdNotificationsIdEndpoint( ConnectWiseEndpoint, IGettable[BoardNotification, ConnectWiseManageRequestParams], - IPuttable[BoardNotification, ConnectWiseManageRequestParams], IPatchable[BoardNotification, ConnectWiseManageRequestParams], + IPuttable[BoardNotification, ConnectWiseManageRequestParams], IPaginateable[BoardNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardNotification) - IPuttable.__init__(self, BoardNotification) IPatchable.__init__(self, BoardNotification) + IPuttable.__init__(self, BoardNotification) IPaginateable.__init__(self, BoardNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardNotification]: """ Performs a GET request against the /service/boards/{id}/notifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardNotification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardNotification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/notifications/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardNotification: The parsed response data. """ - return self._parse_one( - BoardNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardNotification: """ - Performs a DELETE request against the /service/boards/{id}/notifications/{id} endpoint. + Performs a GET request against the /service/boards/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardNotification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardNotification, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardNotification: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardNotification: """ - Performs a PUT request against the /service/boards/{id}/notifications/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: BoardNotification: The parsed response data. """ - return self._parse_one( - BoardNotification, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(BoardNotification, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardNotification: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardNotification: """ - Performs a PATCH request against the /service/boards/{id}/notifications/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: BoardNotification: The parsed response data. """ - return self._parse_one( - BoardNotification, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BoardNotification, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesCountEndpoint.py index c84cda988..7da05daa4 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdStatusesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/statuses/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/statuses/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesEndpoint.py index 033d3891f..2693fbf0b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesCountEndpoint import ( - ServiceBoardsIdStatusesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdEndpoint import ( - ServiceBoardsIdStatusesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesInfoEndpoint import ( - ServiceBoardsIdStatusesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesCountEndpoint import ServiceBoardsIdStatusesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdEndpoint import ServiceBoardsIdStatusesIdEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesInfoEndpoint import ServiceBoardsIdStatusesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesEndpoint( @@ -27,39 +19,30 @@ class ServiceBoardsIdStatusesEndpoint( IPostable[BoardStatus, ConnectWiseManageRequestParams], IPaginateable[BoardStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "statuses", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "statuses", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardStatus]) IPostable.__init__(self, BoardStatus) IPaginateable.__init__(self, BoardStatus) - self.count = self._register_child_endpoint( - ServiceBoardsIdStatusesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceBoardsIdStatusesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceBoardsIdStatusesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceBoardsIdStatusesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceBoardsIdStatusesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdStatusesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdStatusesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdStatusesIdEndpoint: The initialized ServiceBoardsIdStatusesIdEndpoint object. """ child = ServiceBoardsIdStatusesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardStatus]: """ Performs a GET request against the /service/boards/{id}/statuses endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BoardStatus]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BoardStatus]: """ Performs a GET request against the /service/boards/{id}/statuses endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[BoardStatus]: The parsed response data. """ - return self._parse_many( - BoardStatus, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardStatus, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardStatus: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardStatus: """ Performs a POST request against the /service/boards/{id}/statuses endpoint. @@ -117,6 +85,4 @@ def post( Returns: BoardStatus: The parsed response data. """ - return self._parse_one( - BoardStatus, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BoardStatus, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdEndpoint.py index a46bce74e..f149b4070 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdEndpoint.py @@ -1,59 +1,46 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdInfoEndpoint import ( - ServiceBoardsIdStatusesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdInfoEndpoint import ServiceBoardsIdStatusesIdInfoEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdNotificationsEndpoint import ( ServiceBoardsIdStatusesIdNotificationsEndpoint, ) from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdUsagesEndpoint import ( ServiceBoardsIdStatusesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardStatus from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesIdEndpoint( ConnectWiseEndpoint, IGettable[BoardStatus, ConnectWiseManageRequestParams], - IPuttable[BoardStatus, ConnectWiseManageRequestParams], IPatchable[BoardStatus, ConnectWiseManageRequestParams], + IPuttable[BoardStatus, ConnectWiseManageRequestParams], IPaginateable[BoardStatus, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardStatus) - IPuttable.__init__(self, BoardStatus) IPatchable.__init__(self, BoardStatus) + IPuttable.__init__(self, BoardStatus) IPaginateable.__init__(self, BoardStatus) - self.usages = self._register_child_endpoint( - ServiceBoardsIdStatusesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceBoardsIdStatusesIdInfoEndpoint(client, parent_endpoint=self)) self.notifications = self._register_child_endpoint( ServiceBoardsIdStatusesIdNotificationsEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ServiceBoardsIdStatusesIdInfoEndpoint(client, parent_endpoint=self) + self.usages = self._register_child_endpoint( + ServiceBoardsIdStatusesIdUsagesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardStatus]: """ Performs a GET request against the /service/boards/{id}/statuses/{id} endpoint and returns an initialized PaginatedResponse object. @@ -71,53 +58,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardStatus, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardStatus, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardStatus: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/statuses/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardStatus: The parsed response data. """ - return self._parse_one( - BoardStatus, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardStatus: """ - Performs a DELETE request against the /service/boards/{id}/statuses/{id} endpoint. + Performs a GET request against the /service/boards/{id}/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardStatus: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardStatus, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardStatus: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardStatus: """ - Performs a PUT request against the /service/boards/{id}/statuses/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +93,11 @@ def put( Returns: BoardStatus: The parsed response data. """ - return self._parse_one( - BoardStatus, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BoardStatus, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardStatus: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardStatus: """ - Performs a PATCH request against the /service/boards/{id}/statuses/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/statuses/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,6 +105,4 @@ def patch( Returns: BoardStatus: The parsed response data. """ - return self._parse_one( - BoardStatus, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(BoardStatus, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdInfoEndpoint.py index b4304a2e6..10ee201f1 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdStatusesIdInfoEndpoint( IGettable[BoardStatusInfo, ConnectWiseManageRequestParams], IPaginateable[BoardStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardStatusInfo) IPaginateable.__init__(self, BoardStatusInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardStatusInfo]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardStatusInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardStatusInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardStatusInfo: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: BoardStatusInfo: The parsed response data. """ - return self._parse_one( - BoardStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(BoardStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsCountEndpoint.py index df0ffb1dd..53d8348df 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesIdNotificationsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdStatusesIdNotificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/notifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/notifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsEndpoint.py index 328ed8824..280692abd 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdNotificationsCountEndpoint import ( ServiceBoardsIdStatusesIdNotificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdNotificationsIdEndpoint import ( ServiceBoardsIdStatusesIdNotificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesIdNotificationsEndpoint( @@ -24,42 +22,31 @@ class ServiceBoardsIdStatusesIdNotificationsEndpoint( IPostable[BoardStatusNotification, ConnectWiseManageRequestParams], IPaginateable[BoardStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardStatusNotification]) IPostable.__init__(self, BoardStatusNotification) IPaginateable.__init__(self, BoardStatusNotification) self.count = self._register_child_endpoint( - ServiceBoardsIdStatusesIdNotificationsCountEndpoint( - client, parent_endpoint=self - ) + ServiceBoardsIdStatusesIdNotificationsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ServiceBoardsIdStatusesIdNotificationsIdEndpoint: + def id(self, _id: int) -> ServiceBoardsIdStatusesIdNotificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdStatusesIdNotificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdStatusesIdNotificationsIdEndpoint: The initialized ServiceBoardsIdStatusesIdNotificationsIdEndpoint object. """ - child = ServiceBoardsIdStatusesIdNotificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceBoardsIdStatusesIdNotificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardStatusNotification]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/notifications endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardStatusNotification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardStatusNotification]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/notifications endpoint. @@ -99,15 +79,10 @@ def get( Returns: list[BoardStatusNotification]: The parsed response data. """ - return self._parse_many( - BoardStatusNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardStatusNotification, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardStatusNotification: """ Performs a POST request against the /service/boards/{id}/statuses/{id}/notifications endpoint. @@ -118,7 +93,4 @@ def post( Returns: BoardStatusNotification: The parsed response data. """ - return self._parse_one( - BoardStatusNotification, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BoardStatusNotification, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsIdEndpoint.py index 52a7391c4..eae590fe6 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdNotificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardStatusNotification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesIdNotificationsIdEndpoint( ConnectWiseEndpoint, IGettable[BoardStatusNotification, ConnectWiseManageRequestParams], - IPuttable[BoardStatusNotification, ConnectWiseManageRequestParams], IPatchable[BoardStatusNotification, ConnectWiseManageRequestParams], + IPuttable[BoardStatusNotification, ConnectWiseManageRequestParams], IPaginateable[BoardStatusNotification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardStatusNotification) - IPuttable.__init__(self, BoardStatusNotification) IPatchable.__init__(self, BoardStatusNotification) + IPuttable.__init__(self, BoardStatusNotification) IPaginateable.__init__(self, BoardStatusNotification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardStatusNotification]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardStatusNotification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardStatusNotification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardStatusNotification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardStatusNotification: The parsed response data. """ - return self._parse_one( - BoardStatusNotification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> BoardStatusNotification: """ - Performs a DELETE request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. + Performs a GET request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardStatusNotification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardStatusNotification, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> BoardStatusNotification: """ - Performs a PUT request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: BoardStatusNotification: The parsed response data. """ - return self._parse_one( - BoardStatusNotification, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(BoardStatusNotification, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardStatusNotification: """ - Performs a PATCH request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/statuses/{id}/notifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: BoardStatusNotification: The parsed response data. """ - return self._parse_one( - BoardStatusNotification, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BoardStatusNotification, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesEndpoint.py index 927fb53a1..03a8ef00d 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesIdUsagesListEndpoint import ( ServiceBoardsIdStatusesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ServiceBoardsIdStatusesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesListEndpoint.py index b590392d6..cef198915 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdStatusesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/statuses/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoCountEndpoint.py index 0a5139481..a6cb9926d 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdStatusesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/statuses/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/statuses/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoEndpoint.py index 6f2bc7b5c..d340e39dd 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdStatusesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdStatusesInfoCountEndpoint import ( ServiceBoardsIdStatusesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardStatusInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdStatusesInfoEndpoint( @@ -19,10 +18,8 @@ class ServiceBoardsIdStatusesInfoEndpoint( IGettable[list[BoardStatusInfo], ConnectWiseManageRequestParams], IPaginateable[BoardStatusInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardStatusInfo]) IPaginateable.__init__(self, BoardStatusInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardStatusInfo]: """ Performs a GET request against the /service/boards/{id}/statuses/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardStatusInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardStatusInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardStatusInfo]: """ Performs a GET request against the /service/boards/{id}/statuses/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[BoardStatusInfo]: The parsed response data. """ - return self._parse_many( - BoardStatusInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardStatusInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesCountEndpoint.py index 248ab9217..c5843a3ae 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdSubtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/subtypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/subtypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesEndpoint.py index dbf104f75..28e0411f6 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesCountEndpoint import ( - ServiceBoardsIdSubtypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesIdEndpoint import ( - ServiceBoardsIdSubtypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesInfoEndpoint import ( - ServiceBoardsIdSubtypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesCountEndpoint import ServiceBoardsIdSubtypesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesIdEndpoint import ServiceBoardsIdSubtypesIdEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesInfoEndpoint import ServiceBoardsIdSubtypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardSubType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesEndpoint( @@ -27,39 +19,30 @@ class ServiceBoardsIdSubtypesEndpoint( IPostable[BoardSubType, ConnectWiseManageRequestParams], IPaginateable[BoardSubType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "subtypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "subtypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardSubType]) IPostable.__init__(self, BoardSubType) IPaginateable.__init__(self, BoardSubType) - self.count = self._register_child_endpoint( - ServiceBoardsIdSubtypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceBoardsIdSubtypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceBoardsIdSubtypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceBoardsIdSubtypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceBoardsIdSubtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdSubtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdSubtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdSubtypesIdEndpoint: The initialized ServiceBoardsIdSubtypesIdEndpoint object. """ child = ServiceBoardsIdSubtypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardSubType]: """ Performs a GET request against the /service/boards/{id}/subtypes endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardSubType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardSubType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BoardSubType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BoardSubType]: """ Performs a GET request against the /service/boards/{id}/subtypes endpoint. @@ -99,15 +73,9 @@ def get( Returns: list[BoardSubType]: The parsed response data. """ - return self._parse_many( - BoardSubType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardSubType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardSubType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardSubType: """ Performs a POST request against the /service/boards/{id}/subtypes endpoint. @@ -117,6 +85,4 @@ def post( Returns: BoardSubType: The parsed response data. """ - return self._parse_one( - BoardSubType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BoardSubType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdEndpoint.py index f75b768cd..9b4845ccb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdEndpoint.py @@ -1,53 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesIdInfoEndpoint import ( - ServiceBoardsIdSubtypesIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesIdInfoEndpoint import ServiceBoardsIdSubtypesIdInfoEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesIdUsagesEndpoint import ( ServiceBoardsIdSubtypesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardSubType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesIdEndpoint( ConnectWiseEndpoint, IGettable[BoardSubType, ConnectWiseManageRequestParams], - IPuttable[BoardSubType, ConnectWiseManageRequestParams], IPatchable[BoardSubType, ConnectWiseManageRequestParams], + IPuttable[BoardSubType, ConnectWiseManageRequestParams], IPaginateable[BoardSubType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardSubType) - IPuttable.__init__(self, BoardSubType) IPatchable.__init__(self, BoardSubType) + IPuttable.__init__(self, BoardSubType) IPaginateable.__init__(self, BoardSubType) + self.info = self._register_child_endpoint(ServiceBoardsIdSubtypesIdInfoEndpoint(client, parent_endpoint=self)) self.usages = self._register_child_endpoint( ServiceBoardsIdSubtypesIdUsagesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - ServiceBoardsIdSubtypesIdInfoEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardSubType]: """ Performs a GET request against the /service/boards/{id}/subtypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,53 +52,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardSubType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardSubType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardSubType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/subtypes/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/subtypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardSubType: The parsed response data. """ - return self._parse_one( - BoardSubType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardSubType: """ - Performs a DELETE request against the /service/boards/{id}/subtypes/{id} endpoint. + Performs a GET request against the /service/boards/{id}/subtypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardSubType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardSubType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardSubType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardSubType: """ - Performs a PUT request against the /service/boards/{id}/subtypes/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/subtypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +87,11 @@ def put( Returns: BoardSubType: The parsed response data. """ - return self._parse_one( - BoardSubType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BoardSubType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardSubType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardSubType: """ - Performs a PATCH request against the /service/boards/{id}/subtypes/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/subtypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,7 +99,4 @@ def patch( Returns: BoardSubType: The parsed response data. """ - return self._parse_one( - BoardSubType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(BoardSubType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdInfoEndpoint.py index de56e4b12..02b3608e5 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardSubTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdSubtypesIdInfoEndpoint( IGettable[BoardSubTypeInfo, ConnectWiseManageRequestParams], IPaginateable[BoardSubTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardSubTypeInfo) IPaginateable.__init__(self, BoardSubTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardSubTypeInfo]: """ Performs a GET request against the /service/boards/{id}/subtypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardSubTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardSubTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardSubTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardSubTypeInfo: """ Performs a GET request against the /service/boards/{id}/subtypes/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: BoardSubTypeInfo: The parsed response data. """ - return self._parse_one( - BoardSubTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(BoardSubTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesEndpoint.py index 29d516e40..fe389f98e 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesIdUsagesListEndpoint import ( ServiceBoardsIdSubtypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ServiceBoardsIdSubtypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/subtypes/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/subtypes/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesListEndpoint.py index 9755900b6..a6550e7e8 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdSubtypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/subtypes/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/subtypes/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoCountEndpoint.py index fbf094afd..aa7791408 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdSubtypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/subtypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/subtypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoEndpoint.py index 0a1410d7b..e580983b8 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdSubtypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdSubtypesInfoCountEndpoint import ( ServiceBoardsIdSubtypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardSubTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdSubtypesInfoEndpoint( @@ -19,10 +18,8 @@ class ServiceBoardsIdSubtypesInfoEndpoint( IGettable[list[BoardSubTypeInfo], ConnectWiseManageRequestParams], IPaginateable[BoardSubTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardSubTypeInfo]) IPaginateable.__init__(self, BoardSubTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardSubTypeInfo]: """ Performs a GET request against the /service/boards/{id}/subtypes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardSubTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardSubTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardSubTypeInfo]: """ Performs a GET request against the /service/boards/{id}/subtypes/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[BoardSubTypeInfo]: The parsed response data. """ - return self._parse_many( - BoardSubTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(BoardSubTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsCountEndpoint.py index 9ad5ad312..1f66eda25 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTeamsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTeamsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/teams/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/teams/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsEndpoint.py index 2f32b6114..4a63d59ab 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsCountEndpoint import ( - ServiceBoardsIdTeamsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsIdEndpoint import ( - ServiceBoardsIdTeamsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsInfoEndpoint import ( - ServiceBoardsIdTeamsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsCountEndpoint import ServiceBoardsIdTeamsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsIdEndpoint import ServiceBoardsIdTeamsIdEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsInfoEndpoint import ServiceBoardsIdTeamsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTeamsEndpoint( @@ -27,39 +19,30 @@ class ServiceBoardsIdTeamsEndpoint( IPostable[BoardTeam, ConnectWiseManageRequestParams], IPaginateable[BoardTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "teams", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "teams", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardTeam]) IPostable.__init__(self, BoardTeam) IPaginateable.__init__(self, BoardTeam) - self.count = self._register_child_endpoint( - ServiceBoardsIdTeamsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceBoardsIdTeamsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceBoardsIdTeamsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceBoardsIdTeamsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceBoardsIdTeamsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdTeamsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdTeamsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdTeamsIdEndpoint: The initialized ServiceBoardsIdTeamsIdEndpoint object. """ child = ServiceBoardsIdTeamsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTeam]: """ Performs a GET request against the /service/boards/{id}/teams endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTeam, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardTeam, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BoardTeam]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BoardTeam]: """ Performs a GET request against the /service/boards/{id}/teams endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[BoardTeam]: The parsed response data. """ - return self._parse_many( - BoardTeam, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardTeam, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardTeam: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardTeam: """ Performs a POST request against the /service/boards/{id}/teams endpoint. @@ -117,6 +83,4 @@ def post( Returns: BoardTeam: The parsed response data. """ - return self._parse_one( - BoardTeam, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BoardTeam, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdEndpoint.py index e6d8848c1..8c960b41b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsIdInfoEndpoint import ( - ServiceBoardsIdTeamsIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsIdUsagesEndpoint import ( - ServiceBoardsIdTeamsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsIdInfoEndpoint import ServiceBoardsIdTeamsIdInfoEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsIdUsagesEndpoint import ServiceBoardsIdTeamsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTeamsIdEndpoint( ConnectWiseEndpoint, IGettable[BoardTeam, ConnectWiseManageRequestParams], - IPuttable[BoardTeam, ConnectWiseManageRequestParams], IPatchable[BoardTeam, ConnectWiseManageRequestParams], + IPuttable[BoardTeam, ConnectWiseManageRequestParams], IPaginateable[BoardTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardTeam) - IPuttable.__init__(self, BoardTeam) IPatchable.__init__(self, BoardTeam) + IPuttable.__init__(self, BoardTeam) IPaginateable.__init__(self, BoardTeam) - self.usages = self._register_child_endpoint( - ServiceBoardsIdTeamsIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceBoardsIdTeamsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceBoardsIdTeamsIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ServiceBoardsIdTeamsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTeam]: """ Performs a GET request against the /service/boards/{id}/teams/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +47,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTeam, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardTeam, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardTeam: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/teams/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardTeam: The parsed response data. """ - return self._parse_one( - BoardTeam, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardTeam: """ - Performs a DELETE request against the /service/boards/{id}/teams/{id} endpoint. + Performs a GET request against the /service/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardTeam: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardTeam, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardTeam: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardTeam: """ - Performs a PUT request against the /service/boards/{id}/teams/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +81,11 @@ def put( Returns: BoardTeam: The parsed response data. """ - return self._parse_one( - BoardTeam, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BoardTeam, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardTeam: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardTeam: """ - Performs a PATCH request against the /service/boards/{id}/teams/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/teams/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +93,4 @@ def patch( Returns: BoardTeam: The parsed response data. """ - return self._parse_one( - BoardTeam, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(BoardTeam, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdInfoEndpoint.py index 2d85fd770..5dc86d574 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardTeamInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTeamsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTeamsIdInfoEndpoint( IGettable[BoardTeamInfo, ConnectWiseManageRequestParams], IPaginateable[BoardTeamInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardTeamInfo) IPaginateable.__init__(self, BoardTeamInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTeamInfo]: """ Performs a GET request against the /service/boards/{id}/teams/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTeamInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardTeamInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardTeamInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardTeamInfo: """ Performs a GET request against the /service/boards/{id}/teams/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: BoardTeamInfo: The parsed response data. """ - return self._parse_one( - BoardTeamInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(BoardTeamInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesEndpoint.py index 4d3fa92a4..6edbd8f7a 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesEndpoint.py @@ -1,14 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsIdUsagesListEndpoint import ( ServiceBoardsIdTeamsIdUsagesListEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class ServiceBoardsIdTeamsIdUsagesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) self.list = self._register_child_endpoint( ServiceBoardsIdTeamsIdUsagesListEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesListEndpoint.py index 7cce1e456..575bf2525 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTeamsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTeamsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/teams/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/teams/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoCountEndpoint.py index 8cff969bc..e95f955f5 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTeamsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTeamsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/teams/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/teams/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoEndpoint.py index 5e2b25eb6..b808886a9 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTeamsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsInfoCountEndpoint import ( - ServiceBoardsIdTeamsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdTeamsInfoCountEndpoint import ServiceBoardsIdTeamsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardTeamInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTeamsInfoEndpoint( @@ -19,22 +16,15 @@ class ServiceBoardsIdTeamsInfoEndpoint( IGettable[list[BoardTeamInfo], ConnectWiseManageRequestParams], IPaginateable[BoardTeamInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardTeamInfo]) IPaginateable.__init__(self, BoardTeamInfo) - self.count = self._register_child_endpoint( - ServiceBoardsIdTeamsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceBoardsIdTeamsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTeamInfo]: """ Performs a GET request against the /service/boards/{id}/teams/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTeamInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardTeamInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardTeamInfo]: """ Performs a GET request against the /service/boards/{id}/teams/info endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[BoardTeamInfo]: The parsed response data. """ - return self._parse_many( - BoardTeamInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardTeamInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesCountEndpoint.py index 0cb0b23da..d24c84efb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesEndpoint.py index 4f99c869d..7d4b7290d 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesCountEndpoint import ( - ServiceBoardsIdTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesIdEndpoint import ( - ServiceBoardsIdTypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesCountEndpoint import ServiceBoardsIdTypesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesIdEndpoint import ServiceBoardsIdTypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import BoardType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesEndpoint( @@ -24,36 +18,29 @@ class ServiceBoardsIdTypesEndpoint( IPostable[BoardType, ConnectWiseManageRequestParams], IPaginateable[BoardType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardType]) IPostable.__init__(self, BoardType) IPaginateable.__init__(self, BoardType) - self.count = self._register_child_endpoint( - ServiceBoardsIdTypesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceBoardsIdTypesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceBoardsIdTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceBoardsIdTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdTypesIdEndpoint: The initialized ServiceBoardsIdTypesIdEndpoint object. """ child = ServiceBoardsIdTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardType]: """ Performs a GET request against the /service/boards/{id}/types endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BoardType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BoardType]: """ Performs a GET request against the /service/boards/{id}/types endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[BoardType]: The parsed response data. """ - return self._parse_many( - BoardType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardType: """ Performs a POST request against the /service/boards/{id}/types endpoint. @@ -111,6 +81,4 @@ def post( Returns: BoardType: The parsed response data. """ - return self._parse_one( - BoardType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(BoardType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdEndpoint.py index cdd08b9e3..a2b8859b1 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesIdUsagesEndpoint import ( - ServiceBoardsIdTypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesIdUsagesEndpoint import ServiceBoardsIdTypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import BoardType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesIdEndpoint( ConnectWiseEndpoint, IGettable[BoardType, ConnectWiseManageRequestParams], - IPuttable[BoardType, ConnectWiseManageRequestParams], IPatchable[BoardType, ConnectWiseManageRequestParams], + IPuttable[BoardType, ConnectWiseManageRequestParams], IPaginateable[BoardType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardType) - IPuttable.__init__(self, BoardType) IPatchable.__init__(self, BoardType) + IPuttable.__init__(self, BoardType) IPaginateable.__init__(self, BoardType) - self.usages = self._register_child_endpoint( - ServiceBoardsIdTypesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(ServiceBoardsIdTypesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardType]: """ Performs a GET request against the /service/boards/{id}/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/boards/{id}/types/{id} endpoint. + Performs a DELETE request against the /service/boards/{id}/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - BoardType: The parsed response data. """ - return self._parse_one( - BoardType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardType: """ - Performs a DELETE request against the /service/boards/{id}/types/{id} endpoint. + Performs a GET request against the /service/boards/{id}/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + BoardType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(BoardType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> BoardType: """ - Performs a PUT request against the /service/boards/{id}/types/{id} endpoint. + Performs a PATCH request against the /service/boards/{id}/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: BoardType: The parsed response data. """ - return self._parse_one( - BoardType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BoardType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardType: """ - Performs a PATCH request against the /service/boards/{id}/types/{id} endpoint. + Performs a PUT request against the /service/boards/{id}/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: BoardType: The parsed response data. """ - return self._parse_one( - BoardType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(BoardType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesEndpoint.py index 247b90b0a..323acfe0d 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesIdUsagesListEndpoint import ( ServiceBoardsIdTypesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ServiceBoardsIdTypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/types/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/types/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesListEndpoint.py index d9021aa22..63d35afda 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/types/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/types/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint.py index a1df93b3c..5cbff9430 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/boards/{id}/typeSubTypeItemAssociations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/boards/{id}/typeSubTypeItemAssociations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsEndpoint.py index 528dfae63..476a08828 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint import ( ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint import ( ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardTypeSubTypeItemAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesubtypeitemassociationsEndpoint( @@ -22,41 +21,30 @@ class ServiceBoardsIdTypesubtypeitemassociationsEndpoint( IGettable[list[BoardTypeSubTypeItemAssociation], ConnectWiseManageRequestParams], IPaginateable[BoardTypeSubTypeItemAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "typeSubTypeItemAssociations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "typeSubTypeItemAssociations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardTypeSubTypeItemAssociation]) IPaginateable.__init__(self, BoardTypeSubTypeItemAssociation) self.count = self._register_child_endpoint( - ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint( - client, parent_endpoint=self - ) + ServiceBoardsIdTypesubtypeitemassociationsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint: + def id(self, _id: int) -> ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint: The initialized ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint object. """ - child = ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTypeSubTypeItemAssociation]: """ Performs a GET request against the /service/boards/{id}/typeSubTypeItemAssociations endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTypeSubTypeItemAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardTypeSubTypeItemAssociation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardTypeSubTypeItemAssociation]: """ Performs a GET request against the /service/boards/{id}/typeSubTypeItemAssociations endpoint. @@ -97,6 +78,5 @@ def get( list[BoardTypeSubTypeItemAssociation]: The parsed response data. """ return self._parse_many( - BoardTypeSubTypeItemAssociation, - super()._make_request("GET", data=data, params=params).json(), + BoardTypeSubTypeItemAssociation, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint.py index 797d75558..a5d5f17ca 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardTypeSubTypeItemAssociation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdTypesubtypeitemassociationsIdEndpoint( IGettable[BoardTypeSubTypeItemAssociation, ConnectWiseManageRequestParams], IPaginateable[BoardTypeSubTypeItemAssociation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardTypeSubTypeItemAssociation) IPaginateable.__init__(self, BoardTypeSubTypeItemAssociation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTypeSubTypeItemAssociation]: """ Performs a GET request against the /service/boards/{id}/typeSubTypeItemAssociations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTypeSubTypeItemAssociation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardTypeSubTypeItemAssociation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BoardTypeSubTypeItemAssociation: """ Performs a GET request against the /service/boards/{id}/typeSubTypeItemAssociations/{id} endpoint. @@ -68,6 +55,5 @@ def get( BoardTypeSubTypeItemAssociation: The parsed response data. """ return self._parse_one( - BoardTypeSubTypeItemAssociation, - super()._make_request("GET", data=data, params=params).json(), + BoardTypeSubTypeItemAssociation, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesEndpoint.py index 560fdea30..61ec75c6c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceBoardsIdUsagesListEndpoint import ( - ServiceBoardsIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceBoardsIdUsagesListEndpoint import ServiceBoardsIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ServiceBoardsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ServiceBoardsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ServiceBoardsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesListEndpoint.py index dbe0cc4aa..10eae2bde 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceBoardsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceBoardsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceBoardsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/boards/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/boards/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceCodesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceCodesCountEndpoint.py index a80d96c1d..604c17e4c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceCodesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceCodesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceCodesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceCodesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/codes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/codes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceCodesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceCodesEndpoint.py index 654cf1c1b..43c85333b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceCodesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceCodesEndpoint.py @@ -1,19 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceCodesCountEndpoint import ( - ServiceCodesCountEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceCodesCountEndpoint import ServiceCodesCountEndpoint from pyconnectwise.endpoints.manage.ServiceCodesIdEndpoint import ServiceCodesIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Code from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceCodesEndpoint( @@ -22,36 +18,29 @@ class ServiceCodesEndpoint( IPostable[Code, ConnectWiseManageRequestParams], IPaginateable[Code, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "codes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "codes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Code]) IPostable.__init__(self, Code) IPaginateable.__init__(self, Code) - self.count = self._register_child_endpoint( - ServiceCodesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceCodesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceCodesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceCodesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceCodesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceCodesIdEndpoint: The initialized ServiceCodesIdEndpoint object. """ child = ServiceCodesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Code]: """ Performs a GET request against the /service/codes endpoint and returns an initialized PaginatedResponse object. @@ -68,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Code, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Code, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Code]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Code]: """ Performs a GET request against the /service/codes endpoint. @@ -91,15 +69,9 @@ def get( Returns: list[Code]: The parsed response data. """ - return self._parse_many( - Code, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Code, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Code: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Code: """ Performs a POST request against the /service/codes endpoint. @@ -109,6 +81,4 @@ def post( Returns: Code: The parsed response data. """ - return self._parse_one( - Code, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Code, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceCodesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceCodesIdEndpoint.py index de6562a1b..fda029a57 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceCodesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceCodesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Code from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceCodesIdEndpoint( ConnectWiseEndpoint, IGettable[Code, ConnectWiseManageRequestParams], - IPuttable[Code, ConnectWiseManageRequestParams], IPatchable[Code, ConnectWiseManageRequestParams], + IPuttable[Code, ConnectWiseManageRequestParams], IPaginateable[Code, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Code) - IPuttable.__init__(self, Code) IPatchable.__init__(self, Code) + IPuttable.__init__(self, Code) IPaginateable.__init__(self, Code) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Code]: """ Performs a GET request against the /service/codes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Code, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Code, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Code: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/codes/{id} endpoint. + Performs a DELETE request against the /service/codes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Code: The parsed response data. """ - return self._parse_one( - Code, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Code: """ - Performs a DELETE request against the /service/codes/{id} endpoint. + Performs a GET request against the /service/codes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Code: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Code, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Code: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Code: """ - Performs a PUT request against the /service/codes/{id} endpoint. + Performs a PATCH request against the /service/codes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Code: The parsed response data. """ - return self._parse_one( - Code, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Code, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Code: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Code: """ - Performs a PATCH request against the /service/codes/{id} endpoint. + Performs a PUT request against the /service/codes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Code: The parsed response data. """ - return self._parse_one( - Code, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Code, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesCountEndpoint.py index 8c257cf9a..826b040f5 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceEmailtemplatesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceEmailtemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/emailTemplates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/emailTemplates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesEndpoint.py index 7df1b7ce7..0a7b35b09 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceEmailtemplatesCountEndpoint import ( - ServiceEmailtemplatesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceEmailtemplatesIdEndpoint import ( - ServiceEmailtemplatesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceEmailtemplatesCountEndpoint import ServiceEmailtemplatesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceEmailtemplatesIdEndpoint import ServiceEmailtemplatesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ServiceEmailTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceEmailtemplatesEndpoint( @@ -24,36 +18,29 @@ class ServiceEmailtemplatesEndpoint( IPostable[ServiceEmailTemplate, ConnectWiseManageRequestParams], IPaginateable[ServiceEmailTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailTemplates", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailTemplates", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceEmailTemplate]) IPostable.__init__(self, ServiceEmailTemplate) IPaginateable.__init__(self, ServiceEmailTemplate) - self.count = self._register_child_endpoint( - ServiceEmailtemplatesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceEmailtemplatesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceEmailtemplatesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceEmailtemplatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceEmailtemplatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceEmailtemplatesIdEndpoint: The initialized ServiceEmailtemplatesIdEndpoint object. """ child = ServiceEmailtemplatesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceEmailTemplate]: """ Performs a GET request against the /service/emailTemplates endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceEmailTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceEmailTemplate, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceEmailTemplate]: """ Performs a GET request against the /service/emailTemplates endpoint. @@ -93,15 +73,10 @@ def get( Returns: list[ServiceEmailTemplate]: The parsed response data. """ - return self._parse_many( - ServiceEmailTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceEmailTemplate, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceEmailTemplate: """ Performs a POST request against the /service/emailTemplates endpoint. @@ -112,7 +87,4 @@ def post( Returns: ServiceEmailTemplate: The parsed response data. """ - return self._parse_one( - ServiceEmailTemplate, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceEmailTemplate, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdEndpoint.py index 45dd63259..4ea54ab83 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceEmailtemplatesIdUsagesEndpoint import ( - ServiceEmailtemplatesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceEmailtemplatesIdUsagesEndpoint import ServiceEmailtemplatesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ServiceEmailTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceEmailtemplatesIdEndpoint( ConnectWiseEndpoint, IGettable[ServiceEmailTemplate, ConnectWiseManageRequestParams], - IPuttable[ServiceEmailTemplate, ConnectWiseManageRequestParams], IPatchable[ServiceEmailTemplate, ConnectWiseManageRequestParams], + IPuttable[ServiceEmailTemplate, ConnectWiseManageRequestParams], IPaginateable[ServiceEmailTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceEmailTemplate) - IPuttable.__init__(self, ServiceEmailTemplate) IPatchable.__init__(self, ServiceEmailTemplate) + IPuttable.__init__(self, ServiceEmailTemplate) IPaginateable.__init__(self, ServiceEmailTemplate) - self.usages = self._register_child_endpoint( - ServiceEmailtemplatesIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(ServiceEmailtemplatesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceEmailTemplate]: """ Performs a GET request against the /service/emailTemplates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceEmailTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceEmailTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceEmailTemplate: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/emailTemplates/{id} endpoint. + Performs a DELETE request against the /service/emailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ServiceEmailTemplate: The parsed response data. """ - return self._parse_one( - ServiceEmailTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ServiceEmailTemplate: """ - Performs a DELETE request against the /service/emailTemplates/{id} endpoint. + Performs a GET request against the /service/emailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ServiceEmailTemplate: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ServiceEmailTemplate, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ServiceEmailTemplate: """ - Performs a PUT request against the /service/emailTemplates/{id} endpoint. + Performs a PATCH request against the /service/emailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +85,13 @@ def put( Returns: ServiceEmailTemplate: The parsed response data. """ - return self._parse_one( - ServiceEmailTemplate, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ServiceEmailTemplate, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceEmailTemplate: """ - Performs a PATCH request against the /service/emailTemplates/{id} endpoint. + Performs a PUT request against the /service/emailTemplates/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +99,4 @@ def patch( Returns: ServiceEmailTemplate: The parsed response data. """ - return self._parse_one( - ServiceEmailTemplate, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ServiceEmailTemplate, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesEndpoint.py index 2effb3d8f..cd6cef438 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceEmailtemplatesIdUsagesListEndpoint import ( ServiceEmailtemplatesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceEmailtemplatesIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ServiceEmailtemplatesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/emailTemplates/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/emailTemplates/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesListEndpoint.py index a8280c607..bbaf13cd2 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceEmailtemplatesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceEmailtemplatesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceEmailtemplatesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/emailTemplates/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/emailTemplates/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceEndpoint.py index fbb461415..46bd127b0 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceEndpoint.py @@ -1,138 +1,75 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceBoardsEndpoint import ServiceBoardsEndpoint from pyconnectwise.endpoints.manage.ServiceCodesEndpoint import ServiceCodesEndpoint -from pyconnectwise.endpoints.manage.ServiceEmailtemplatesEndpoint import ( - ServiceEmailtemplatesEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceEmailtemplatesEndpoint import ServiceEmailtemplatesEndpoint from pyconnectwise.endpoints.manage.ServiceImpactsEndpoint import ServiceImpactsEndpoint from pyconnectwise.endpoints.manage.ServiceInfoEndpoint import ServiceInfoEndpoint -from pyconnectwise.endpoints.manage.ServiceKnowledgebasearticlesEndpoint import ( - ServiceKnowledgebasearticlesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceKnowledgebasecategoriesEndpoint import ( - ServiceKnowledgebasecategoriesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceKnowledgebasesettingsEndpoint import ( - ServiceKnowledgebasesettingsEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceKnowledgebasearticlesEndpoint import ServiceKnowledgebasearticlesEndpoint +from pyconnectwise.endpoints.manage.ServiceKnowledgebasecategoriesEndpoint import ServiceKnowledgebasecategoriesEndpoint +from pyconnectwise.endpoints.manage.ServiceKnowledgebasesettingsEndpoint import ServiceKnowledgebasesettingsEndpoint from pyconnectwise.endpoints.manage.ServiceKnowledgebasesubcategoriesEndpoint import ( ServiceKnowledgebasesubcategoriesEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceLocationsEndpoint import ( - ServiceLocationsEndpoint, -) -from pyconnectwise.endpoints.manage.ServicePrioritiesEndpoint import ( - ServicePrioritiesEndpoint, -) -from pyconnectwise.endpoints.manage.ServicePriorityEndpoint import ( - ServicePriorityEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSchedulingEndpoint import ( - ServiceSchedulingEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceServicesignoffEndpoint import ( - ServiceServicesignoffEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSeveritiesEndpoint import ( - ServiceSeveritiesEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceLocationsEndpoint import ServiceLocationsEndpoint +from pyconnectwise.endpoints.manage.ServicePrioritiesEndpoint import ServicePrioritiesEndpoint +from pyconnectwise.endpoints.manage.ServicePriorityEndpoint import ServicePriorityEndpoint +from pyconnectwise.endpoints.manage.ServiceSchedulingEndpoint import ServiceSchedulingEndpoint +from pyconnectwise.endpoints.manage.ServiceServicesignoffEndpoint import ServiceServicesignoffEndpoint +from pyconnectwise.endpoints.manage.ServiceSeveritiesEndpoint import ServiceSeveritiesEndpoint from pyconnectwise.endpoints.manage.ServiceSlasEndpoint import ServiceSlasEndpoint from pyconnectwise.endpoints.manage.ServiceSourcesEndpoint import ServiceSourcesEndpoint from pyconnectwise.endpoints.manage.ServiceSurveysEndpoint import ServiceSurveysEndpoint -from pyconnectwise.endpoints.manage.ServiceTeammembersEndpoint import ( - ServiceTeammembersEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceTeammembersEndpoint import ServiceTeammembersEndpoint from pyconnectwise.endpoints.manage.ServiceTeamsEndpoint import ServiceTeamsEndpoint -from pyconnectwise.endpoints.manage.ServiceTemplatesEndpoint import ( - ServiceTemplatesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketlinksEndpoint import ( - ServiceTicketlinksEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceTemplatesEndpoint import ServiceTemplatesEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketlinksEndpoint import ServiceTicketlinksEndpoint from pyconnectwise.endpoints.manage.ServiceTicketsEndpoint import ServiceTicketsEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsyncsEndpoint import ( - ServiceTicketsyncsEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceTicketsyncsEndpoint import ServiceTicketsyncsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "service", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "service", parent_endpoint=parent_endpoint) - self.priorities = self._register_child_endpoint( - ServicePrioritiesEndpoint(client, parent_endpoint=self) - ) - self.templates = self._register_child_endpoint( - ServiceTemplatesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceInfoEndpoint(client, parent_endpoint=self) - ) - self.teams = self._register_child_endpoint( - ServiceTeamsEndpoint(client, parent_endpoint=self) - ) - self.locations = self._register_child_endpoint( - ServiceLocationsEndpoint(client, parent_endpoint=self) - ) - self.service_signoff = self._register_child_endpoint( - ServiceServicesignoffEndpoint(client, parent_endpoint=self) - ) - self.codes = self._register_child_endpoint( - ServiceCodesEndpoint(client, parent_endpoint=self) - ) - self.s_l_as = self._register_child_endpoint( - ServiceSlasEndpoint(client, parent_endpoint=self) - ) - self.tickets = self._register_child_endpoint( - ServiceTicketsEndpoint(client, parent_endpoint=self) - ) - self.ticket_links = self._register_child_endpoint( - ServiceTicketlinksEndpoint(client, parent_endpoint=self) - ) + self.boards = self._register_child_endpoint(ServiceBoardsEndpoint(client, parent_endpoint=self)) + self.codes = self._register_child_endpoint(ServiceCodesEndpoint(client, parent_endpoint=self)) self.email_templates = self._register_child_endpoint( ServiceEmailtemplatesEndpoint(client, parent_endpoint=self) ) - self.scheduling = self._register_child_endpoint( - ServiceSchedulingEndpoint(client, parent_endpoint=self) - ) - self.ticket_syncs = self._register_child_endpoint( - ServiceTicketsyncsEndpoint(client, parent_endpoint=self) - ) - self.surveys = self._register_child_endpoint( - ServiceSurveysEndpoint(client, parent_endpoint=self) - ) - self.priority = self._register_child_endpoint( - ServicePriorityEndpoint(client, parent_endpoint=self) - ) - self.severities = self._register_child_endpoint( - ServiceSeveritiesEndpoint(client, parent_endpoint=self) - ) - self.slas = self._register_child_endpoint( - ServiceSlasEndpoint(client, parent_endpoint=self) - ) - self.boards = self._register_child_endpoint( - ServiceBoardsEndpoint(client, parent_endpoint=self) - ) - self.team_members = self._register_child_endpoint( - ServiceTeammembersEndpoint(client, parent_endpoint=self) - ) + self.impacts = self._register_child_endpoint(ServiceImpactsEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceInfoEndpoint(client, parent_endpoint=self)) self.knowledge_base_articles = self._register_child_endpoint( ServiceKnowledgebasearticlesEndpoint(client, parent_endpoint=self) ) self.knowledge_base_categories = self._register_child_endpoint( ServiceKnowledgebasecategoriesEndpoint(client, parent_endpoint=self) ) - self.sources = self._register_child_endpoint( - ServiceSourcesEndpoint(client, parent_endpoint=self) - ) self.knowledge_base_sub_categories = self._register_child_endpoint( ServiceKnowledgebasesubcategoriesEndpoint(client, parent_endpoint=self) ) self.knowledgebasesettings = self._register_child_endpoint( ServiceKnowledgebasesettingsEndpoint(client, parent_endpoint=self) ) - self.impacts = self._register_child_endpoint( - ServiceImpactsEndpoint(client, parent_endpoint=self) + self.locations = self._register_child_endpoint(ServiceLocationsEndpoint(client, parent_endpoint=self)) + self.priorities = self._register_child_endpoint(ServicePrioritiesEndpoint(client, parent_endpoint=self)) + self.priority = self._register_child_endpoint(ServicePriorityEndpoint(client, parent_endpoint=self)) + self.s_l_as = self._register_child_endpoint(ServiceSlasEndpoint(client, parent_endpoint=self)) + self.scheduling = self._register_child_endpoint(ServiceSchedulingEndpoint(client, parent_endpoint=self)) + self.service_signoff = self._register_child_endpoint( + ServiceServicesignoffEndpoint(client, parent_endpoint=self) ) + self.severities = self._register_child_endpoint(ServiceSeveritiesEndpoint(client, parent_endpoint=self)) + self.slas = self._register_child_endpoint(ServiceSlasEndpoint(client, parent_endpoint=self)) + self.sources = self._register_child_endpoint(ServiceSourcesEndpoint(client, parent_endpoint=self)) + self.surveys = self._register_child_endpoint(ServiceSurveysEndpoint(client, parent_endpoint=self)) + self.team_members = self._register_child_endpoint(ServiceTeammembersEndpoint(client, parent_endpoint=self)) + self.teams = self._register_child_endpoint(ServiceTeamsEndpoint(client, parent_endpoint=self)) + self.templates = self._register_child_endpoint(ServiceTemplatesEndpoint(client, parent_endpoint=self)) + self.ticket_links = self._register_child_endpoint(ServiceTicketlinksEndpoint(client, parent_endpoint=self)) + self.ticket_syncs = self._register_child_endpoint(ServiceTicketsyncsEndpoint(client, parent_endpoint=self)) + self.tickets = self._register_child_endpoint(ServiceTicketsEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ServiceImpactsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceImpactsCountEndpoint.py index da40b6375..ddb6d76bb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceImpactsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceImpactsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceImpactsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceImpactsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/impacts/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/impacts/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceImpactsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceImpactsEndpoint.py index bc966bdce..ee45757cb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceImpactsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceImpactsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceImpactsCountEndpoint import ( - ServiceImpactsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceImpactsIdEndpoint import ( - ServiceImpactsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceImpactsCountEndpoint import ServiceImpactsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceImpactsIdEndpoint import ServiceImpactsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Impact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceImpactsEndpoint( @@ -22,35 +17,28 @@ class ServiceImpactsEndpoint( IGettable[list[Impact], ConnectWiseManageRequestParams], IPaginateable[Impact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "impacts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "impacts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Impact]) IPaginateable.__init__(self, Impact) - self.count = self._register_child_endpoint( - ServiceImpactsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceImpactsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceImpactsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceImpactsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceImpactsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceImpactsIdEndpoint: The initialized ServiceImpactsIdEndpoint object. """ child = ServiceImpactsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Impact]: """ Performs a GET request against the /service/impacts endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Impact, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Impact, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Impact]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Impact]: """ Performs a GET request against the /service/impacts endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[Impact]: The parsed response data. """ - return self._parse_many( - Impact, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Impact, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceImpactsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceImpactsIdEndpoint.py index 0daa17266..561ff1fb4 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceImpactsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceImpactsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Impact from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceImpactsIdEndpoint( ConnectWiseEndpoint, IGettable[Impact, ConnectWiseManageRequestParams], - IPuttable[Impact, ConnectWiseManageRequestParams], IPatchable[Impact, ConnectWiseManageRequestParams], + IPuttable[Impact, ConnectWiseManageRequestParams], IPaginateable[Impact, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Impact) - IPuttable.__init__(self, Impact) IPatchable.__init__(self, Impact) + IPuttable.__init__(self, Impact) IPaginateable.__init__(self, Impact) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Impact]: """ Performs a GET request against the /service/impacts/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +42,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Impact, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Impact, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Impact: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Impact: """ Performs a GET request against the /service/impacts/{id} endpoint. @@ -74,17 +54,11 @@ def get( Returns: Impact: The parsed response data. """ - return self._parse_one( - Impact, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Impact, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Impact: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Impact: """ - Performs a PUT request against the /service/impacts/{id} endpoint. + Performs a PATCH request against the /service/impacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +66,11 @@ def put( Returns: Impact: The parsed response data. """ - return self._parse_one( - Impact, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Impact, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Impact: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Impact: """ - Performs a PATCH request against the /service/impacts/{id} endpoint. + Performs a PUT request against the /service/impacts/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +78,4 @@ def patch( Returns: Impact: The parsed response data. """ - return self._parse_one( - Impact, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Impact, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsCountEndpoint.py index e74e454f9..53ba4df56 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceInfoBoardsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceInfoBoardsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/info/boards/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/info/boards/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsEndpoint.py index 3de4c1f40..435b4ee64 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceInfoBoardsCountEndpoint import ( - ServiceInfoBoardsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceInfoBoardsIdEndpoint import ( - ServiceInfoBoardsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceInfoBoardsCountEndpoint import ServiceInfoBoardsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceInfoBoardsIdEndpoint import ServiceInfoBoardsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceInfoBoardsEndpoint( @@ -22,35 +17,28 @@ class ServiceInfoBoardsEndpoint( IGettable[list[BoardInfo], ConnectWiseManageRequestParams], IPaginateable[BoardInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "boards", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "boards", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardInfo]) IPaginateable.__init__(self, BoardInfo) - self.count = self._register_child_endpoint( - ServiceInfoBoardsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceInfoBoardsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceInfoBoardsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceInfoBoardsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceInfoBoardsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceInfoBoardsIdEndpoint: The initialized ServiceInfoBoardsIdEndpoint object. """ child = ServiceInfoBoardsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardInfo]: """ Performs a GET request against the /service/info/boards endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[BoardInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[BoardInfo]: """ Performs a GET request against the /service/info/boards endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[BoardInfo]: The parsed response data. """ - return self._parse_many( - BoardInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsIdEndpoint.py index 85932e41a..34b1e2b52 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceInfoBoardsIdEndpoint( @@ -16,18 +15,13 @@ class ServiceInfoBoardsIdEndpoint( IGettable[BoardInfo, ConnectWiseManageRequestParams], IPaginateable[BoardInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardInfo) IPaginateable.__init__(self, BoardInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardInfo]: """ Performs a GET request against the /service/info/boards/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - BoardInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), BoardInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardInfo: """ Performs a GET request against the /service/info/boards/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: BoardInfo: The parsed response data. """ - return self._parse_one( - BoardInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(BoardInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesCountEndpoint.py index d909432cd..5e602679e 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceInfoBoardtypesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceInfoBoardtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/info/boardtypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/info/boardtypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesEndpoint.py index 493676895..6fc057105 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceInfoBoardtypesCountEndpoint import ( - ServiceInfoBoardtypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceInfoBoardtypesIdEndpoint import ( - ServiceInfoBoardtypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceInfoBoardtypesCountEndpoint import ServiceInfoBoardtypesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceInfoBoardtypesIdEndpoint import ServiceInfoBoardtypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceInfoBoardtypesEndpoint( @@ -22,35 +17,28 @@ class ServiceInfoBoardtypesEndpoint( IGettable[list[BoardTypeInfo], ConnectWiseManageRequestParams], IPaginateable[BoardTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "boardtypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "boardtypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[BoardTypeInfo]) IPaginateable.__init__(self, BoardTypeInfo) - self.count = self._register_child_endpoint( - ServiceInfoBoardtypesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceInfoBoardtypesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceInfoBoardtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceInfoBoardtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceInfoBoardtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceInfoBoardtypesIdEndpoint: The initialized ServiceInfoBoardtypesIdEndpoint object. """ child = ServiceInfoBoardtypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTypeInfo]: """ Performs a GET request against the /service/info/boardtypes endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[BoardTypeInfo]: """ Performs a GET request against the /service/info/boardtypes endpoint. @@ -90,6 +71,4 @@ def get( Returns: list[BoardTypeInfo]: The parsed response data. """ - return self._parse_many( - BoardTypeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(BoardTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesIdEndpoint.py index 64135a7a5..79dc026ec 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceInfoBoardtypesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import BoardTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceInfoBoardtypesIdEndpoint( @@ -16,18 +15,13 @@ class ServiceInfoBoardtypesIdEndpoint( IGettable[BoardTypeInfo, ConnectWiseManageRequestParams], IPaginateable[BoardTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, BoardTypeInfo) IPaginateable.__init__(self, BoardTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[BoardTypeInfo]: """ Performs a GET request against the /service/info/boardtypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - BoardTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), BoardTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BoardTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BoardTypeInfo: """ Performs a GET request against the /service/info/boardtypes/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: BoardTypeInfo: The parsed response data. """ - return self._parse_one( - BoardTypeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(BoardTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceInfoEndpoint.py index 420ead67c..908bf90e0 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceInfoEndpoint.py @@ -1,21 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceInfoBoardsEndpoint import ( - ServiceInfoBoardsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceInfoBoardtypesEndpoint import ( - ServiceInfoBoardtypesEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceInfoBoardsEndpoint import ServiceInfoBoardsEndpoint +from pyconnectwise.endpoints.manage.ServiceInfoBoardtypesEndpoint import ServiceInfoBoardtypesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) - self.boards = self._register_child_endpoint( - ServiceInfoBoardsEndpoint(client, parent_endpoint=self) - ) - self.boardtypes = self._register_child_endpoint( - ServiceInfoBoardtypesEndpoint(client, parent_endpoint=self) - ) + self.boards = self._register_child_endpoint(ServiceInfoBoardsEndpoint(client, parent_endpoint=self)) + self.boardtypes = self._register_child_endpoint(ServiceInfoBoardtypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesCountEndpoint.py index 62240f581..27edda2be 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasearticlesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceKnowledgebasearticlesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/knowledgeBaseArticles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/knowledgeBaseArticles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesEndpoint.py index 010996b90..a417f8e9d 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceKnowledgebasearticlesCountEndpoint import ( ServiceKnowledgebasearticlesCountEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceKnowledgebasearticlesIdEndpoint import ( - ServiceKnowledgebasearticlesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceKnowledgebasearticlesIdEndpoint import ServiceKnowledgebasearticlesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import KnowledgeBaseArticle from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasearticlesEndpoint( @@ -24,10 +20,8 @@ class ServiceKnowledgebasearticlesEndpoint( IPostable[KnowledgeBaseArticle, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseArticle, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "knowledgeBaseArticles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "knowledgeBaseArticles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[KnowledgeBaseArticle]) IPostable.__init__(self, KnowledgeBaseArticle) IPaginateable.__init__(self, KnowledgeBaseArticle) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ServiceKnowledgebasearticlesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceKnowledgebasearticlesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceKnowledgebasearticlesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceKnowledgebasearticlesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceKnowledgebasearticlesIdEndpoint: The initialized ServiceKnowledgebasearticlesIdEndpoint object. """ - child = ServiceKnowledgebasearticlesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceKnowledgebasearticlesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseArticle]: """ Performs a GET request against the /service/knowledgeBaseArticles endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseArticle, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseArticle, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[KnowledgeBaseArticle]: """ Performs a GET request against the /service/knowledgeBaseArticles endpoint. @@ -95,15 +77,10 @@ def get( Returns: list[KnowledgeBaseArticle]: The parsed response data. """ - return self._parse_many( - KnowledgeBaseArticle, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(KnowledgeBaseArticle, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseArticle: """ Performs a POST request against the /service/knowledgeBaseArticles endpoint. @@ -114,7 +91,4 @@ def post( Returns: KnowledgeBaseArticle: The parsed response data. """ - return self._parse_one( - KnowledgeBaseArticle, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseArticle, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesIdEndpoint.py index f3e4be187..f7c5ad8fc 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasearticlesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import KnowledgeBaseArticle from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasearticlesIdEndpoint( ConnectWiseEndpoint, IGettable[KnowledgeBaseArticle, ConnectWiseManageRequestParams], - IPuttable[KnowledgeBaseArticle, ConnectWiseManageRequestParams], IPatchable[KnowledgeBaseArticle, ConnectWiseManageRequestParams], + IPuttable[KnowledgeBaseArticle, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseArticle, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, KnowledgeBaseArticle) - IPuttable.__init__(self, KnowledgeBaseArticle) IPatchable.__init__(self, KnowledgeBaseArticle) + IPuttable.__init__(self, KnowledgeBaseArticle) IPaginateable.__init__(self, KnowledgeBaseArticle) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseArticle]: """ Performs a GET request against the /service/knowledgeBaseArticles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseArticle, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseArticle, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> KnowledgeBaseArticle: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/knowledgeBaseArticles/{id} endpoint. + Performs a DELETE request against the /service/knowledgeBaseArticles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - KnowledgeBaseArticle: The parsed response data. """ - return self._parse_one( - KnowledgeBaseArticle, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> KnowledgeBaseArticle: """ - Performs a DELETE request against the /service/knowledgeBaseArticles/{id} endpoint. + Performs a GET request against the /service/knowledgeBaseArticles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + KnowledgeBaseArticle: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(KnowledgeBaseArticle, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseArticle: """ - Performs a PUT request against the /service/knowledgeBaseArticles/{id} endpoint. + Performs a PATCH request against the /service/knowledgeBaseArticles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: KnowledgeBaseArticle: The parsed response data. """ - return self._parse_one( - KnowledgeBaseArticle, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseArticle, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseArticle: """ - Performs a PATCH request against the /service/knowledgeBaseArticles/{id} endpoint. + Performs a PUT request against the /service/knowledgeBaseArticles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: KnowledgeBaseArticle: The parsed response data. """ - return self._parse_one( - KnowledgeBaseArticle, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseArticle, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesCountEndpoint.py index 4c40d6d12..a745ef724 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasecategoriesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceKnowledgebasecategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/knowledgeBaseCategories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/knowledgeBaseCategories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesEndpoint.py index 9d35493d0..65fee4f1c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceKnowledgebasecategoriesCountEndpoint import ( ServiceKnowledgebasecategoriesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceKnowledgebasecategoriesIdEndpoint import ( ServiceKnowledgebasecategoriesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import KnowledgeBaseCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasecategoriesEndpoint( @@ -24,10 +22,8 @@ class ServiceKnowledgebasecategoriesEndpoint( IPostable[KnowledgeBaseCategory, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "knowledgeBaseCategories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "knowledgeBaseCategories", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[KnowledgeBaseCategory]) IPostable.__init__(self, KnowledgeBaseCategory) IPaginateable.__init__(self, KnowledgeBaseCategory) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ServiceKnowledgebasecategoriesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceKnowledgebasecategoriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceKnowledgebasecategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceKnowledgebasecategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceKnowledgebasecategoriesIdEndpoint: The initialized ServiceKnowledgebasecategoriesIdEndpoint object. """ - child = ServiceKnowledgebasecategoriesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceKnowledgebasecategoriesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseCategory]: """ Performs a GET request against the /service/knowledgeBaseCategories endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseCategory, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[KnowledgeBaseCategory]: """ Performs a GET request against the /service/knowledgeBaseCategories endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[KnowledgeBaseCategory]: The parsed response data. """ - return self._parse_many( - KnowledgeBaseCategory, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(KnowledgeBaseCategory, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseCategory: """ Performs a POST request against the /service/knowledgeBaseCategories endpoint. @@ -114,7 +93,4 @@ def post( Returns: KnowledgeBaseCategory: The parsed response data. """ - return self._parse_one( - KnowledgeBaseCategory, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseCategory, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesIdEndpoint.py index 7c57dd463..e696d2ee7 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasecategoriesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import KnowledgeBaseCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasecategoriesIdEndpoint( ConnectWiseEndpoint, IGettable[KnowledgeBaseCategory, ConnectWiseManageRequestParams], - IPuttable[KnowledgeBaseCategory, ConnectWiseManageRequestParams], IPatchable[KnowledgeBaseCategory, ConnectWiseManageRequestParams], + IPuttable[KnowledgeBaseCategory, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, KnowledgeBaseCategory) - IPuttable.__init__(self, KnowledgeBaseCategory) IPatchable.__init__(self, KnowledgeBaseCategory) + IPuttable.__init__(self, KnowledgeBaseCategory) IPaginateable.__init__(self, KnowledgeBaseCategory) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseCategory]: """ Performs a GET request against the /service/knowledgeBaseCategories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseCategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> KnowledgeBaseCategory: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/knowledgeBaseCategories/{id} endpoint. + Performs a DELETE request against the /service/knowledgeBaseCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - KnowledgeBaseCategory: The parsed response data. """ - return self._parse_one( - KnowledgeBaseCategory, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> KnowledgeBaseCategory: """ - Performs a DELETE request against the /service/knowledgeBaseCategories/{id} endpoint. + Performs a GET request against the /service/knowledgeBaseCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + KnowledgeBaseCategory: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(KnowledgeBaseCategory, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseCategory: """ - Performs a PUT request against the /service/knowledgeBaseCategories/{id} endpoint. + Performs a PATCH request against the /service/knowledgeBaseCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: KnowledgeBaseCategory: The parsed response data. """ - return self._parse_one( - KnowledgeBaseCategory, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseCategory, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseCategory: """ - Performs a PATCH request against the /service/knowledgeBaseCategories/{id} endpoint. + Performs a PUT request against the /service/knowledgeBaseCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: KnowledgeBaseCategory: The parsed response data. """ - return self._parse_one( - KnowledgeBaseCategory, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseCategory, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsEndpoint.py index 94bff36da..ce6203548 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsEndpoint.py @@ -1,18 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceKnowledgebasesettingsIdEndpoint import ( - ServiceKnowledgebasesettingsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceKnowledgebasesettingsIdEndpoint import ServiceKnowledgebasesettingsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import KnowledgeBaseSettings from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasesettingsEndpoint( @@ -21,34 +17,27 @@ class ServiceKnowledgebasesettingsEndpoint( IPostable[KnowledgeBaseSettings, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseSettings, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "knowledgebasesettings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "knowledgebasesettings", parent_endpoint=parent_endpoint) IGettable.__init__(self, KnowledgeBaseSettings) IPostable.__init__(self, KnowledgeBaseSettings) IPaginateable.__init__(self, KnowledgeBaseSettings) - def id(self, id: int) -> ServiceKnowledgebasesettingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceKnowledgebasesettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceKnowledgebasesettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceKnowledgebasesettingsIdEndpoint: The initialized ServiceKnowledgebasesettingsIdEndpoint object. """ - child = ServiceKnowledgebasesettingsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceKnowledgebasesettingsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseSettings]: """ Performs a GET request against the /service/knowledgebasesettings endpoint and returns an initialized PaginatedResponse object. @@ -66,18 +55,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseSettings, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseSettings, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSettings: """ Performs a GET request against the /service/knowledgebasesettings endpoint. @@ -88,15 +70,10 @@ def get( Returns: KnowledgeBaseSettings: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSettings, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseSettings, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSettings: """ Performs a POST request against the /service/knowledgebasesettings endpoint. @@ -107,7 +84,4 @@ def post( Returns: KnowledgeBaseSettings: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSettings, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseSettings, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsIdEndpoint.py index 04dc51b09..4477e040b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesettingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import KnowledgeBaseSettings from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasesettingsIdEndpoint( ConnectWiseEndpoint, IGettable[KnowledgeBaseSettings, ConnectWiseManageRequestParams], - IPuttable[KnowledgeBaseSettings, ConnectWiseManageRequestParams], IPatchable[KnowledgeBaseSettings, ConnectWiseManageRequestParams], + IPuttable[KnowledgeBaseSettings, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseSettings, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, KnowledgeBaseSettings) - IPuttable.__init__(self, KnowledgeBaseSettings) IPatchable.__init__(self, KnowledgeBaseSettings) + IPuttable.__init__(self, KnowledgeBaseSettings) IPaginateable.__init__(self, KnowledgeBaseSettings) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseSettings]: """ Performs a GET request against the /service/knowledgebasesettings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +43,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseSettings, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseSettings, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSettings: """ Performs a GET request against the /service/knowledgebasesettings/{id} endpoint. @@ -74,18 +58,13 @@ def get( Returns: KnowledgeBaseSettings: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSettings, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseSettings, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSettings: """ - Performs a PUT request against the /service/knowledgebasesettings/{id} endpoint. + Performs a PATCH request against the /service/knowledgebasesettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +72,13 @@ def put( Returns: KnowledgeBaseSettings: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSettings, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseSettings, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSettings: """ - Performs a PATCH request against the /service/knowledgebasesettings/{id} endpoint. + Performs a PUT request against the /service/knowledgebasesettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +86,4 @@ def patch( Returns: KnowledgeBaseSettings: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSettings, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseSettings, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesCountEndpoint.py index 61afea56a..3b2b08273 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasesubcategoriesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceKnowledgebasesubcategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/knowledgeBaseSubCategories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/knowledgeBaseSubCategories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesEndpoint.py index 92f73d026..5c7518d79 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceKnowledgebasesubcategoriesCountEndpoint import ( ServiceKnowledgebasesubcategoriesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceKnowledgebasesubcategoriesIdEndpoint import ( ServiceKnowledgebasesubcategoriesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import KnowledgeBaseSubCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasesubcategoriesEndpoint( @@ -24,10 +22,8 @@ class ServiceKnowledgebasesubcategoriesEndpoint( IPostable[KnowledgeBaseSubCategory, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseSubCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "knowledgeBaseSubCategories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "knowledgeBaseSubCategories", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[KnowledgeBaseSubCategory]) IPostable.__init__(self, KnowledgeBaseSubCategory) IPaginateable.__init__(self, KnowledgeBaseSubCategory) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ServiceKnowledgebasesubcategoriesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceKnowledgebasesubcategoriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceKnowledgebasesubcategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceKnowledgebasesubcategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceKnowledgebasesubcategoriesIdEndpoint: The initialized ServiceKnowledgebasesubcategoriesIdEndpoint object. """ - child = ServiceKnowledgebasesubcategoriesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceKnowledgebasesubcategoriesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseSubCategory]: """ Performs a GET request against the /service/knowledgeBaseSubCategories endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseSubCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseSubCategory, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[KnowledgeBaseSubCategory]: """ Performs a GET request against the /service/knowledgeBaseSubCategories endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[KnowledgeBaseSubCategory]: The parsed response data. """ - return self._parse_many( - KnowledgeBaseSubCategory, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(KnowledgeBaseSubCategory, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSubCategory: """ Performs a POST request against the /service/knowledgeBaseSubCategories endpoint. @@ -114,7 +93,4 @@ def post( Returns: KnowledgeBaseSubCategory: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSubCategory, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseSubCategory, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdEndpoint.py index afb266110..a2e466ae3 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceKnowledgebasesubcategoriesIdUsagesEndpoint import ( ServiceKnowledgebasesubcategoriesIdUsagesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import KnowledgeBaseSubCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasesubcategoriesIdEndpoint( ConnectWiseEndpoint, IGettable[KnowledgeBaseSubCategory, ConnectWiseManageRequestParams], - IPuttable[KnowledgeBaseSubCategory, ConnectWiseManageRequestParams], IPatchable[KnowledgeBaseSubCategory, ConnectWiseManageRequestParams], + IPuttable[KnowledgeBaseSubCategory, ConnectWiseManageRequestParams], IPaginateable[KnowledgeBaseSubCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, KnowledgeBaseSubCategory) - IPuttable.__init__(self, KnowledgeBaseSubCategory) IPatchable.__init__(self, KnowledgeBaseSubCategory) + IPuttable.__init__(self, KnowledgeBaseSubCategory) IPaginateable.__init__(self, KnowledgeBaseSubCategory) self.usages = self._register_child_endpoint( - ServiceKnowledgebasesubcategoriesIdUsagesEndpoint( - client, parent_endpoint=self - ) + ServiceKnowledgebasesubcategoriesIdUsagesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KnowledgeBaseSubCategory]: """ Performs a GET request against the /service/knowledgeBaseSubCategories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KnowledgeBaseSubCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KnowledgeBaseSubCategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> KnowledgeBaseSubCategory: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/knowledgeBaseSubCategories/{id} endpoint. + Performs a DELETE request against the /service/knowledgeBaseSubCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - KnowledgeBaseSubCategory: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSubCategory, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> KnowledgeBaseSubCategory: """ - Performs a DELETE request against the /service/knowledgeBaseSubCategories/{id} endpoint. + Performs a GET request against the /service/knowledgeBaseSubCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + KnowledgeBaseSubCategory: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(KnowledgeBaseSubCategory, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSubCategory: """ - Performs a PUT request against the /service/knowledgeBaseSubCategories/{id} endpoint. + Performs a PATCH request against the /service/knowledgeBaseSubCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -117,17 +90,14 @@ def put( KnowledgeBaseSubCategory: The parsed response data. """ return self._parse_one( - KnowledgeBaseSubCategory, - super()._make_request("PUT", data=data, params=params).json(), + KnowledgeBaseSubCategory, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> KnowledgeBaseSubCategory: """ - Performs a PATCH request against the /service/knowledgeBaseSubCategories/{id} endpoint. + Performs a PUT request against the /service/knowledgeBaseSubCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,7 +105,4 @@ def patch( Returns: KnowledgeBaseSubCategory: The parsed response data. """ - return self._parse_one( - KnowledgeBaseSubCategory, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(KnowledgeBaseSubCategory, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesEndpoint.py index 00ff334cf..507afa0c3 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint import ( ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasesubcategoriesIdUsagesEndpoint( @@ -19,24 +18,17 @@ class ServiceKnowledgebasesubcategoriesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) self.list = self._register_child_endpoint( - ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint( - client, parent_endpoint=self - ) + ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/knowledgeBaseSubCategories/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -53,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/knowledgeBaseSubCategories/{id}/usages endpoint. @@ -76,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint.py index 29dbe3219..4cc78a3ee 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceKnowledgebasesubcategoriesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/knowledgeBaseSubCategories/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/knowledgeBaseSubCategories/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceLocationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceLocationsCountEndpoint.py index ee77e8722..f1353e8f7 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceLocationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceLocationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceLocationsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceLocationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/locations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/locations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceLocationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceLocationsEndpoint.py index 19f4b32db..3ea496df4 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceLocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceLocationsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceLocationsCountEndpoint import ( - ServiceLocationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceLocationsIdEndpoint import ( - ServiceLocationsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceLocationsInfoEndpoint import ( - ServiceLocationsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceLocationsCountEndpoint import ServiceLocationsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceLocationsIdEndpoint import ServiceLocationsIdEndpoint +from pyconnectwise.endpoints.manage.ServiceLocationsInfoEndpoint import ServiceLocationsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ServiceLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceLocationsEndpoint( @@ -27,39 +19,30 @@ class ServiceLocationsEndpoint( IPostable[ServiceLocation, ConnectWiseManageRequestParams], IPaginateable[ServiceLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "locations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "locations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceLocation]) IPostable.__init__(self, ServiceLocation) IPaginateable.__init__(self, ServiceLocation) - self.count = self._register_child_endpoint( - ServiceLocationsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceLocationsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceLocationsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceLocationsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceLocationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceLocationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceLocationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceLocationsIdEndpoint: The initialized ServiceLocationsIdEndpoint object. """ child = ServiceLocationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceLocation]: """ Performs a GET request against the /service/locations endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceLocation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceLocation]: """ Performs a GET request against the /service/locations endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[ServiceLocation]: The parsed response data. """ - return self._parse_many( - ServiceLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceLocation, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceLocation: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceLocation: """ Performs a POST request against the /service/locations endpoint. @@ -118,7 +87,4 @@ def post( Returns: ServiceLocation: The parsed response data. """ - return self._parse_one( - ServiceLocation, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceLocation, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceLocationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceLocationsIdEndpoint.py index 983da0175..426c2d859 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceLocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceLocationsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceLocationsIdInfoEndpoint import ( - ServiceLocationsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceLocationsIdInfoEndpoint import ServiceLocationsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ServiceLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceLocationsIdEndpoint( ConnectWiseEndpoint, IGettable[ServiceLocation, ConnectWiseManageRequestParams], - IPuttable[ServiceLocation, ConnectWiseManageRequestParams], IPatchable[ServiceLocation, ConnectWiseManageRequestParams], + IPuttable[ServiceLocation, ConnectWiseManageRequestParams], IPaginateable[ServiceLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceLocation) - IPuttable.__init__(self, ServiceLocation) IPatchable.__init__(self, ServiceLocation) + IPuttable.__init__(self, ServiceLocation) IPaginateable.__init__(self, ServiceLocation) - self.info = self._register_child_endpoint( - ServiceLocationsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceLocationsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceLocation]: """ Performs a GET request against the /service/locations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceLocation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceLocation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/locations/{id} endpoint. + Performs a DELETE request against the /service/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ServiceLocation: The parsed response data. """ - return self._parse_one( - ServiceLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceLocation: """ - Performs a DELETE request against the /service/locations/{id} endpoint. + Performs a GET request against the /service/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ServiceLocation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ServiceLocation, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceLocation: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ServiceLocation: """ - Performs a PUT request against the /service/locations/{id} endpoint. + Performs a PATCH request against the /service/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +81,11 @@ def put( Returns: ServiceLocation: The parsed response data. """ - return self._parse_one( - ServiceLocation, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ServiceLocation, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceLocation: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceLocation: """ - Performs a PATCH request against the /service/locations/{id} endpoint. + Performs a PUT request against the /service/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +93,4 @@ def patch( Returns: ServiceLocation: The parsed response data. """ - return self._parse_one( - ServiceLocation, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ServiceLocation, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceLocationsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceLocationsIdInfoEndpoint.py index f2a776501..4874f6cac 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceLocationsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceLocationsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceLocationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceLocationsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceLocationsIdInfoEndpoint( IGettable[ServiceLocationInfo, ConnectWiseManageRequestParams], IPaginateable[ServiceLocationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceLocationInfo) IPaginateable.__init__(self, ServiceLocationInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceLocationInfo]: """ Performs a GET request against the /service/locations/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceLocationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceLocationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceLocationInfo: """ Performs a GET request against the /service/locations/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: ServiceLocationInfo: The parsed response data. """ - return self._parse_one( - ServiceLocationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ServiceLocationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoCountEndpoint.py index 9fca66bd8..c826d9011 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceLocationsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceLocationsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/locations/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/locations/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoEndpoint.py index 431ab5237..73020194f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceLocationsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceLocationsInfoCountEndpoint import ( - ServiceLocationsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceLocationsInfoCountEndpoint import ServiceLocationsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceLocationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceLocationsInfoEndpoint( @@ -19,22 +16,15 @@ class ServiceLocationsInfoEndpoint( IGettable[list[ServiceLocationInfo], ConnectWiseManageRequestParams], IPaginateable[ServiceLocationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceLocationInfo]) IPaginateable.__init__(self, ServiceLocationInfo) - self.count = self._register_child_endpoint( - ServiceLocationsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceLocationsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceLocationInfo]: """ Performs a GET request against the /service/locations/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceLocationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceLocationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceLocationInfo]: """ Performs a GET request against the /service/locations/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ServiceLocationInfo]: The parsed response data. """ - return self._parse_many( - ServiceLocationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceLocationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServicePrioritiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePrioritiesCountEndpoint.py index fd7ab05d1..0c9d426d2 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePrioritiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePrioritiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePrioritiesCountEndpoint( @@ -16,18 +15,13 @@ class ServicePrioritiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/priorities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/priorities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServicePrioritiesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePrioritiesEndpoint.py index 057e9f63f..7b11d5278 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePrioritiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePrioritiesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServicePrioritiesCountEndpoint import ( - ServicePrioritiesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServicePrioritiesIdEndpoint import ( - ServicePrioritiesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServicePrioritiesCountEndpoint import ServicePrioritiesCountEndpoint +from pyconnectwise.endpoints.manage.ServicePrioritiesIdEndpoint import ServicePrioritiesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Priority from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePrioritiesEndpoint( @@ -24,36 +18,29 @@ class ServicePrioritiesEndpoint( IPostable[Priority, ConnectWiseManageRequestParams], IPaginateable[Priority, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "priorities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "priorities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Priority]) IPostable.__init__(self, Priority) IPaginateable.__init__(self, Priority) - self.count = self._register_child_endpoint( - ServicePrioritiesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServicePrioritiesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServicePrioritiesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServicePrioritiesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServicePrioritiesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServicePrioritiesIdEndpoint: The initialized ServicePrioritiesIdEndpoint object. """ child = ServicePrioritiesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Priority]: """ Performs a GET request against the /service/priorities endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Priority, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Priority, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Priority]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Priority]: """ Performs a GET request against the /service/priorities endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Priority]: The parsed response data. """ - return self._parse_many( - Priority, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Priority, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Priority: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Priority: """ Performs a POST request against the /service/priorities endpoint. @@ -111,6 +81,4 @@ def post( Returns: Priority: The parsed response data. """ - return self._parse_one( - Priority, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Priority, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdEndpoint.py index 3495bc074..64e6d9312 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServicePrioritiesIdImageEndpoint import ( - ServicePrioritiesIdImageEndpoint, -) -from pyconnectwise.endpoints.manage.ServicePrioritiesIdUsagesEndpoint import ( - ServicePrioritiesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServicePrioritiesIdImageEndpoint import ServicePrioritiesIdImageEndpoint +from pyconnectwise.endpoints.manage.ServicePrioritiesIdUsagesEndpoint import ServicePrioritiesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Priority from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePrioritiesIdEndpoint( ConnectWiseEndpoint, IGettable[Priority, ConnectWiseManageRequestParams], - IPuttable[Priority, ConnectWiseManageRequestParams], IPatchable[Priority, ConnectWiseManageRequestParams], + IPuttable[Priority, ConnectWiseManageRequestParams], IPaginateable[Priority, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Priority) - IPuttable.__init__(self, Priority) IPatchable.__init__(self, Priority) + IPuttable.__init__(self, Priority) IPaginateable.__init__(self, Priority) - self.usages = self._register_child_endpoint( - ServicePrioritiesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.image = self._register_child_endpoint( - ServicePrioritiesIdImageEndpoint(client, parent_endpoint=self) - ) + self.image = self._register_child_endpoint(ServicePrioritiesIdImageEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ServicePrioritiesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Priority]: """ Performs a GET request against the /service/priorities/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +47,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Priority, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Priority, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Priority: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/priorities/{id} endpoint. + Performs a DELETE request against the /service/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Priority: The parsed response data. """ - return self._parse_one( - Priority, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Priority: """ - Performs a DELETE request against the /service/priorities/{id} endpoint. + Performs a GET request against the /service/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Priority: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Priority, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Priority: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Priority: """ - Performs a PUT request against the /service/priorities/{id} endpoint. + Performs a PATCH request against the /service/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +81,11 @@ def put( Returns: Priority: The parsed response data. """ - return self._parse_one( - Priority, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Priority, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Priority: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Priority: """ - Performs a PATCH request against the /service/priorities/{id} endpoint. + Performs a PUT request against the /service/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +93,4 @@ def patch( Returns: Priority: The parsed response data. """ - return self._parse_one( - Priority, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Priority, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdImageEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdImageEndpoint.py index fc4abe2e8..0736f1af6 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdImageEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdImageEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePrioritiesIdImageEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "image", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "image", parent_endpoint=parent_endpoint) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a GET request against the /service/priorities/{id}/image endpoint. diff --git a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesEndpoint.py index 2faa39e4a..c6091bb89 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServicePrioritiesIdUsagesListEndpoint import ( - ServicePrioritiesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServicePrioritiesIdUsagesListEndpoint import ServicePrioritiesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePrioritiesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ServicePrioritiesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ServicePrioritiesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ServicePrioritiesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/priorities/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/priorities/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesListEndpoint.py index 541e161b9..0ac1efa6b 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePrioritiesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePrioritiesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServicePrioritiesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/priorities/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/priorities/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServicePriorityEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePriorityEndpoint.py index 056f763d3..b7c519967 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePriorityEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePriorityEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServicePriorityIdEndpoint import ( - ServicePriorityIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServicePriorityInfoEndpoint import ( - ServicePriorityInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServicePriorityIdEndpoint import ServicePriorityIdEndpoint +from pyconnectwise.endpoints.manage.ServicePriorityInfoEndpoint import ServicePriorityInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePriorityEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "priority", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "priority", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - ServicePriorityInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServicePriorityInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServicePriorityIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServicePriorityIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServicePriorityIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServicePriorityIdEndpoint: The initialized ServicePriorityIdEndpoint object. """ child = ServicePriorityIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ServicePriorityIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePriorityIdEndpoint.py index 74d9d323b..13b08e937 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePriorityIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePriorityIdEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServicePriorityIdInfoEndpoint import ( - ServicePriorityIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServicePriorityIdInfoEndpoint import ServicePriorityIdInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePriorityIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - ServicePriorityIdInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(ServicePriorityIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ServicePriorityIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePriorityIdInfoEndpoint.py index 5f9271e5b..b8f9c7319 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePriorityIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePriorityIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PriorityInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePriorityIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServicePriorityIdInfoEndpoint( IGettable[PriorityInfo, ConnectWiseManageRequestParams], IPaginateable[PriorityInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, PriorityInfo) IPaginateable.__init__(self, PriorityInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PriorityInfo]: """ Performs a GET request against the /service/priority/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PriorityInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PriorityInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PriorityInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PriorityInfo: """ Performs a GET request against the /service/priority/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: PriorityInfo: The parsed response data. """ - return self._parse_one( - PriorityInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(PriorityInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServicePriorityInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServicePriorityInfoEndpoint.py index bf310cffe..c7ce77c60 100644 --- a/src/pyconnectwise/endpoints/manage/ServicePriorityInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServicePriorityInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PriorityInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServicePriorityInfoEndpoint( @@ -16,18 +15,13 @@ class ServicePriorityInfoEndpoint( IGettable[list[PriorityInfo], ConnectWiseManageRequestParams], IPaginateable[PriorityInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PriorityInfo]) IPaginateable.__init__(self, PriorityInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PriorityInfo]: """ Performs a GET request against the /service/priority/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PriorityInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PriorityInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[PriorityInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[PriorityInfo]: """ Performs a GET request against the /service/priority/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: list[PriorityInfo]: The parsed response data. """ - return self._parse_many( - PriorityInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PriorityInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSchedulingEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSchedulingEndpoint.py index 5b324f91c..7ad8f8fdb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSchedulingEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSchedulingEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSchedulingMembersEndpoint import ( - ServiceSchedulingMembersEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceSchedulingMembersEndpoint import ServiceSchedulingMembersEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSchedulingEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "scheduling", parent_endpoint=parent_endpoint - ) - - self.members = self._register_child_endpoint( - ServiceSchedulingMembersEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "scheduling", parent_endpoint=parent_endpoint) + + self.members = self._register_child_endpoint(ServiceSchedulingMembersEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersEndpoint.py index 944c49160..afebbf203 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSchedulingMembersIdEndpoint import ( - ServiceSchedulingMembersIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSchedulingMembersInfoEndpoint import ( - ServiceSchedulingMembersInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceSchedulingMembersIdEndpoint import ServiceSchedulingMembersIdEndpoint +from pyconnectwise.endpoints.manage.ServiceSchedulingMembersInfoEndpoint import ServiceSchedulingMembersInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSchedulingMembersEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "members", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "members", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - ServiceSchedulingMembersInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceSchedulingMembersInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSchedulingMembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSchedulingMembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSchedulingMembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSchedulingMembersIdEndpoint: The initialized ServiceSchedulingMembersIdEndpoint object. """ child = ServiceSchedulingMembersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdEndpoint.py index 3f906bf44..2197b114b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSchedulingMembersIdInfoEndpoint import ( - ServiceSchedulingMembersIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceSchedulingMembersIdInfoEndpoint import ServiceSchedulingMembersIdInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSchedulingMembersIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - ServiceSchedulingMembersIdInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(ServiceSchedulingMembersIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdInfoEndpoint.py index 3966a2312..78dfdd530 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SchedulingMemberInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSchedulingMembersIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceSchedulingMembersIdInfoEndpoint( IGettable[SchedulingMemberInfo, ConnectWiseManageRequestParams], IPaginateable[SchedulingMemberInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SchedulingMemberInfo) IPaginateable.__init__(self, SchedulingMemberInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SchedulingMemberInfo]: """ Performs a GET request against the /service/scheduling/members/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SchedulingMemberInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SchedulingMemberInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> SchedulingMemberInfo: """ Performs a GET request against the /service/scheduling/members/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: SchedulingMemberInfo: The parsed response data. """ - return self._parse_one( - SchedulingMemberInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SchedulingMemberInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoCountEndpoint.py index 5a2cee0f1..1256cbecf 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSchedulingMembersInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSchedulingMembersInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/scheduling/members/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/scheduling/members/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoEndpoint.py index 4fa9f2aa6..d03a54cf1 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSchedulingMembersInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceSchedulingMembersInfoCountEndpoint import ( ServiceSchedulingMembersInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SchedulingMemberInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSchedulingMembersInfoEndpoint( @@ -19,10 +18,8 @@ class ServiceSchedulingMembersInfoEndpoint( IGettable[list[SchedulingMemberInfo], ConnectWiseManageRequestParams], IPaginateable[SchedulingMemberInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SchedulingMemberInfo]) IPaginateable.__init__(self, SchedulingMemberInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SchedulingMemberInfo]: """ Performs a GET request against the /service/scheduling/members/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SchedulingMemberInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SchedulingMemberInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SchedulingMemberInfo]: """ Performs a GET request against the /service/scheduling/members/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[SchedulingMemberInfo]: The parsed response data. """ - return self._parse_many( - SchedulingMemberInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SchedulingMemberInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffCountEndpoint.py index 10cda2987..d41729a2f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffCountEndpoint( @@ -16,18 +15,13 @@ class ServiceServicesignoffCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/serviceSignoff/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/serviceSignoff/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffEndpoint.py index 011b1875d..c34f92430 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceServicesignoffCountEndpoint import ( - ServiceServicesignoffCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceServicesignoffIdEndpoint import ( - ServiceServicesignoffIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceServicesignoffInfoEndpoint import ( - ServiceServicesignoffInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceServicesignoffCountEndpoint import ServiceServicesignoffCountEndpoint +from pyconnectwise.endpoints.manage.ServiceServicesignoffIdEndpoint import ServiceServicesignoffIdEndpoint +from pyconnectwise.endpoints.manage.ServiceServicesignoffInfoEndpoint import ServiceServicesignoffInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ServiceSignoff from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffEndpoint( @@ -27,39 +19,30 @@ class ServiceServicesignoffEndpoint( IPostable[ServiceSignoff, ConnectWiseManageRequestParams], IPaginateable[ServiceSignoff, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "serviceSignoff", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "serviceSignoff", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceSignoff]) IPostable.__init__(self, ServiceSignoff) IPaginateable.__init__(self, ServiceSignoff) - self.count = self._register_child_endpoint( - ServiceServicesignoffCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceServicesignoffInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceServicesignoffCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceServicesignoffInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceServicesignoffIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceServicesignoffIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceServicesignoffIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceServicesignoffIdEndpoint: The initialized ServiceServicesignoffIdEndpoint object. """ child = ServiceServicesignoffIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSignoff]: """ Performs a GET request against the /service/serviceSignoff endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSignoff, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSignoff, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceSignoff]: """ Performs a GET request against the /service/serviceSignoff endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[ServiceSignoff]: The parsed response data. """ - return self._parse_many( - ServiceSignoff, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceSignoff, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSignoff: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSignoff: """ Performs a POST request against the /service/serviceSignoff endpoint. @@ -118,7 +87,4 @@ def post( Returns: ServiceSignoff: The parsed response data. """ - return self._parse_one( - ServiceSignoff, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceSignoff, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdEndpoint.py index 2e5a7d85e..3cdc5b3eb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdEndpoint.py @@ -1,61 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceServicesignoffIdInfoEndpoint import ( - ServiceServicesignoffIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceServicesignoffIdSignoffcustomfieldsEndpoint import ( - ServiceServicesignoffIdSignoffcustomfieldsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceServicesignoffIdUsagesEndpoint import ( - ServiceServicesignoffIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceServicesignoffIdInfoEndpoint import ServiceServicesignoffIdInfoEndpoint +from pyconnectwise.endpoints.manage.ServiceServicesignoffIdUsagesEndpoint import ServiceServicesignoffIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ServiceSignoff from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffIdEndpoint( ConnectWiseEndpoint, IGettable[ServiceSignoff, ConnectWiseManageRequestParams], - IPuttable[ServiceSignoff, ConnectWiseManageRequestParams], IPatchable[ServiceSignoff, ConnectWiseManageRequestParams], + IPuttable[ServiceSignoff, ConnectWiseManageRequestParams], IPaginateable[ServiceSignoff, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceSignoff) - IPuttable.__init__(self, ServiceSignoff) IPatchable.__init__(self, ServiceSignoff) + IPuttable.__init__(self, ServiceSignoff) IPaginateable.__init__(self, ServiceSignoff) - self.usages = self._register_child_endpoint( - ServiceServicesignoffIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.signoffcustomfields = self._register_child_endpoint( - ServiceServicesignoffIdSignoffcustomfieldsEndpoint( - client, parent_endpoint=self - ) - ) - self.info = self._register_child_endpoint( - ServiceServicesignoffIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceServicesignoffIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ServiceServicesignoffIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSignoff]: """ Performs a GET request against the /service/serviceSignoff/{id} endpoint and returns an initialized PaginatedResponse object. @@ -73,54 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSignoff, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSignoff, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSignoff: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/serviceSignoff/{id} endpoint. + Performs a DELETE request against the /service/serviceSignoff/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ServiceSignoff: The parsed response data. """ - return self._parse_one( - ServiceSignoff, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSignoff: """ - Performs a DELETE request against the /service/serviceSignoff/{id} endpoint. + Performs a GET request against the /service/serviceSignoff/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ServiceSignoff: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ServiceSignoff, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSignoff: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ServiceSignoff: """ - Performs a PUT request against the /service/serviceSignoff/{id} endpoint. + Performs a PATCH request against the /service/serviceSignoff/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -128,18 +83,11 @@ def put( Returns: ServiceSignoff: The parsed response data. """ - return self._parse_one( - ServiceSignoff, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ServiceSignoff, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSignoff: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSignoff: """ - Performs a PATCH request against the /service/serviceSignoff/{id} endpoint. + Performs a PUT request against the /service/serviceSignoff/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -147,7 +95,4 @@ def patch( Returns: ServiceSignoff: The parsed response data. """ - return self._parse_one( - ServiceSignoff, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ServiceSignoff, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdInfoEndpoint.py index c29d0cf59..5132348f5 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceSignoffInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceServicesignoffIdInfoEndpoint( IGettable[ServiceSignoffInfo, ConnectWiseManageRequestParams], IPaginateable[ServiceSignoffInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceSignoffInfo) IPaginateable.__init__(self, ServiceSignoffInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSignoffInfo]: """ Performs a GET request against the /service/serviceSignoff/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSignoffInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSignoffInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSignoffInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSignoffInfo: """ Performs a GET request against the /service/serviceSignoff/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ServiceSignoffInfo: The parsed response data. """ - return self._parse_one( - ServiceSignoffInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ServiceSignoffInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsCountEndpoint.py index c017a3add..1a1da1e7f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsCountEndpoint.py @@ -17,9 +17,7 @@ class ServiceServicesignoffIdSignoffcustomfieldsCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsEndpoint.py index 40f4a68f4..2e8222076 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsEndpoint.py @@ -25,22 +25,16 @@ class ServiceServicesignoffIdSignoffcustomfieldsEndpoint( IPaginateable[ServiceSignoffCustomField, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "signoffcustomfields", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "signoffcustomfields", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceSignoffCustomField]) IPostable.__init__(self, ServiceSignoffCustomField) IPaginateable.__init__(self, ServiceSignoffCustomField) self.count = self._register_child_endpoint( - ServiceServicesignoffIdSignoffcustomfieldsCountEndpoint( - client, parent_endpoint=self - ) + ServiceServicesignoffIdSignoffcustomfieldsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint: + def id(self, id: int) -> ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint: # noqa: A002 """ Sets the ID for this endpoint and returns an initialized ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint object to move down the chain. @@ -49,9 +43,7 @@ def id( Returns: ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint: The initialized ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint object. """ - child = ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint( - self.client, parent_endpoint=self - ) + child = ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint.py index c1afb73e5..b42fb1003 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint.py @@ -22,9 +22,7 @@ class ServiceServicesignoffIdSignoffcustomfieldsIdEndpoint( IPaginateable[ServiceSignoffCustomField, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceSignoffCustomField) IPuttable.__init__(self, ServiceSignoffCustomField) IPatchable.__init__(self, ServiceSignoffCustomField) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesEndpoint.py index 8ecc91da7..ed135db12 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceServicesignoffIdUsagesListEndpoint import ( ServiceServicesignoffIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffIdUsagesEndpoint( @@ -19,10 +18,8 @@ class ServiceServicesignoffIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/serviceSignoff/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/serviceSignoff/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesListEndpoint.py index d5aa4c2bd..4e1620d7d 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceServicesignoffIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/serviceSignoff/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/serviceSignoff/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoCountEndpoint.py index f99d5c9a2..cb291596f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceServicesignoffInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/serviceSignoff/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/serviceSignoff/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoEndpoint.py index cf586ebf4..f9f494d57 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceServicesignoffInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceServicesignoffInfoCountEndpoint import ( - ServiceServicesignoffInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceServicesignoffInfoCountEndpoint import ServiceServicesignoffInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceSignoffInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceServicesignoffInfoEndpoint( @@ -19,22 +16,15 @@ class ServiceServicesignoffInfoEndpoint( IGettable[list[ServiceSignoffInfo], ConnectWiseManageRequestParams], IPaginateable[ServiceSignoffInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceSignoffInfo]) IPaginateable.__init__(self, ServiceSignoffInfo) - self.count = self._register_child_endpoint( - ServiceServicesignoffInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceServicesignoffInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSignoffInfo]: """ Performs a GET request against the /service/serviceSignoff/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSignoffInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSignoffInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceSignoffInfo]: """ Performs a GET request against the /service/serviceSignoff/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ServiceSignoffInfo]: The parsed response data. """ - return self._parse_many( - ServiceSignoffInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceSignoffInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSeveritiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSeveritiesCountEndpoint.py index a2afa73c3..51a020f33 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSeveritiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSeveritiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSeveritiesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSeveritiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/severities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/severities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSeveritiesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSeveritiesEndpoint.py index 7be733618..7a0dbb20c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSeveritiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSeveritiesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSeveritiesCountEndpoint import ( - ServiceSeveritiesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSeveritiesIdEndpoint import ( - ServiceSeveritiesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceSeveritiesCountEndpoint import ServiceSeveritiesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceSeveritiesIdEndpoint import ServiceSeveritiesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Severity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSeveritiesEndpoint( @@ -22,35 +17,28 @@ class ServiceSeveritiesEndpoint( IGettable[list[Severity], ConnectWiseManageRequestParams], IPaginateable[Severity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "severities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "severities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Severity]) IPaginateable.__init__(self, Severity) - self.count = self._register_child_endpoint( - ServiceSeveritiesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceSeveritiesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSeveritiesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSeveritiesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSeveritiesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSeveritiesIdEndpoint: The initialized ServiceSeveritiesIdEndpoint object. """ child = ServiceSeveritiesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Severity]: """ Performs a GET request against the /service/severities endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Severity, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Severity, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Severity]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Severity]: """ Performs a GET request against the /service/severities endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[Severity]: The parsed response data. """ - return self._parse_many( - Severity, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Severity, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSeveritiesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSeveritiesIdEndpoint.py index a2c206f37..b6d24b21a 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSeveritiesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSeveritiesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Severity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSeveritiesIdEndpoint( ConnectWiseEndpoint, IGettable[Severity, ConnectWiseManageRequestParams], - IPuttable[Severity, ConnectWiseManageRequestParams], IPatchable[Severity, ConnectWiseManageRequestParams], + IPuttable[Severity, ConnectWiseManageRequestParams], IPaginateable[Severity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Severity) - IPuttable.__init__(self, Severity) IPatchable.__init__(self, Severity) + IPuttable.__init__(self, Severity) IPaginateable.__init__(self, Severity) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Severity]: """ Performs a GET request against the /service/severities/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +42,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Severity, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Severity, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Severity: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Severity: """ Performs a GET request against the /service/severities/{id} endpoint. @@ -74,17 +54,11 @@ def get( Returns: Severity: The parsed response data. """ - return self._parse_one( - Severity, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Severity, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Severity: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Severity: """ - Performs a PUT request against the /service/severities/{id} endpoint. + Performs a PATCH request against the /service/severities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +66,11 @@ def put( Returns: Severity: The parsed response data. """ - return self._parse_one( - Severity, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Severity, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Severity: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Severity: """ - Performs a PATCH request against the /service/severities/{id} endpoint. + Performs a PUT request against the /service/severities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +78,4 @@ def patch( Returns: Severity: The parsed response data. """ - return self._parse_one( - Severity, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Severity, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasCountEndpoint.py index 563ee3bd9..bc713088b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSlasCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/SLAs/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/SLAs/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasEndpoint.py index a2a45637b..e79aa0869 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasEndpoint.py @@ -1,29 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceSlasIdEndpoint import ServiceSlasIdEndpoint -from pyconnectwise.endpoints.manage.ServiceSlasInfoEndpoint import ( - ServiceSlasInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceSlasInfoEndpoint import ServiceSlasInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "slas", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "slas", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - ServiceSlasInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceSlasInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSlasIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSlasIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSlasIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSlasIdEndpoint: The initialized ServiceSlasIdEndpoint object. """ child = ServiceSlasIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasIdEndpoint.py index 0a7386b9e..4d9fef01f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasIdEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSlasIdInfoEndpoint import ( - ServiceSlasIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceSlasIdInfoEndpoint import ServiceSlasIdInfoEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - - self.info = self._register_child_endpoint( - ServiceSlasIdInfoEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + + self.info = self._register_child_endpoint(ServiceSlasIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasIdInfoEndpoint.py index ada2bc638..ba57ce0d1 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SLAInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceSlasIdInfoEndpoint( IGettable[SLAInfo, ConnectWiseManageRequestParams], IPaginateable[SLAInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SLAInfo) IPaginateable.__init__(self, SLAInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SLAInfo]: """ Performs a GET request against the /service/slas/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SLAInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SLAInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SLAInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SLAInfo: """ Performs a GET request against the /service/slas/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: SLAInfo: The parsed response data. """ - return self._parse_one( - SLAInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(SLAInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesCountEndpoint.py index 81f6aa72c..b54e36a5b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasIdPrioritiesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSlasIdPrioritiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/SLAs/{id}/priorities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/SLAs/{id}/priorities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesEndpoint.py index b67bbd445..dcadaa56c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSlasIdPrioritiesCountEndpoint import ( - ServiceSlasIdPrioritiesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSlasIdPrioritiesIdEndpoint import ( - ServiceSlasIdPrioritiesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceSlasIdPrioritiesCountEndpoint import ServiceSlasIdPrioritiesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceSlasIdPrioritiesIdEndpoint import ServiceSlasIdPrioritiesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SLAPriority from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasIdPrioritiesEndpoint( @@ -24,36 +18,29 @@ class ServiceSlasIdPrioritiesEndpoint( IPostable[SLAPriority, ConnectWiseManageRequestParams], IPaginateable[SLAPriority, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "priorities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "priorities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SLAPriority]) IPostable.__init__(self, SLAPriority) IPaginateable.__init__(self, SLAPriority) - self.count = self._register_child_endpoint( - ServiceSlasIdPrioritiesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceSlasIdPrioritiesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSlasIdPrioritiesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSlasIdPrioritiesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSlasIdPrioritiesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSlasIdPrioritiesIdEndpoint: The initialized ServiceSlasIdPrioritiesIdEndpoint object. """ child = ServiceSlasIdPrioritiesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SLAPriority]: """ Performs a GET request against the /service/SLAs/{id}/priorities endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SLAPriority, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SLAPriority, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SLAPriority]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SLAPriority]: """ Performs a GET request against the /service/SLAs/{id}/priorities endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[SLAPriority]: The parsed response data. """ - return self._parse_many( - SLAPriority, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SLAPriority, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SLAPriority: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SLAPriority: """ Performs a POST request against the /service/SLAs/{id}/priorities endpoint. @@ -111,6 +83,4 @@ def post( Returns: SLAPriority: The parsed response data. """ - return self._parse_one( - SLAPriority, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(SLAPriority, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesIdEndpoint.py index f200e8d39..9ddeda404 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasIdPrioritiesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SLAPriority from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasIdPrioritiesIdEndpoint( ConnectWiseEndpoint, IGettable[SLAPriority, ConnectWiseManageRequestParams], - IPuttable[SLAPriority, ConnectWiseManageRequestParams], IPatchable[SLAPriority, ConnectWiseManageRequestParams], + IPuttable[SLAPriority, ConnectWiseManageRequestParams], IPaginateable[SLAPriority, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SLAPriority) - IPuttable.__init__(self, SLAPriority) IPatchable.__init__(self, SLAPriority) + IPuttable.__init__(self, SLAPriority) IPaginateable.__init__(self, SLAPriority) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SLAPriority]: """ Performs a GET request against the /service/SLAs/{id}/priorities/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SLAPriority, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SLAPriority, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SLAPriority: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/SLAs/{id}/priorities/{id} endpoint. + Performs a DELETE request against the /service/SLAs/{id}/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SLAPriority: The parsed response data. """ - return self._parse_one( - SLAPriority, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SLAPriority: """ - Performs a DELETE request against the /service/SLAs/{id}/priorities/{id} endpoint. + Performs a GET request against the /service/SLAs/{id}/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SLAPriority: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SLAPriority, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SLAPriority: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SLAPriority: """ - Performs a PUT request against the /service/SLAs/{id}/priorities/{id} endpoint. + Performs a PATCH request against the /service/SLAs/{id}/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: SLAPriority: The parsed response data. """ - return self._parse_one( - SLAPriority, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SLAPriority, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SLAPriority: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SLAPriority: """ - Performs a PATCH request against the /service/SLAs/{id}/priorities/{id} endpoint. + Performs a PUT request against the /service/SLAs/{id}/priorities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: SLAPriority: The parsed response data. """ - return self._parse_one( - SLAPriority, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(SLAPriority, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesEndpoint.py index e2b540161..30e9c653f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSlasIdUsagesListEndpoint import ( - ServiceSlasIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceSlasIdUsagesListEndpoint import ServiceSlasIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ServiceSlasIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ServiceSlasIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ServiceSlasIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/SLAs/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/SLAs/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesListEndpoint.py index e28cf50a2..a5d437fcf 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceSlasIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/SLAs/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/SLAs/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasInfoCountEndpoint.py index babfc8b5d..bd6becb3e 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSlasInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSlasInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/SLAs/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/SLAs/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSlasInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSlasInfoEndpoint.py index c684a543d..4f03daada 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSlasInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSlasInfoEndpoint.py @@ -1,15 +1,53 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSlasInfoCountEndpoint import ( - ServiceSlasInfoCountEndpoint, -) +from pyconnectwise.interfaces import IGettable, IPaginateable +from pyconnectwise.models.manage import SLAInfo +from pyconnectwise.responses.paginated_response import PaginatedResponse +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + + +class ServiceSlasInfoEndpoint( + ConnectWiseEndpoint, + IGettable[list[SLAInfo], ConnectWiseManageRequestParams], + IPaginateable[SLAInfo, ConnectWiseManageRequestParams], +): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[SLAInfo]) + IPaginateable.__init__(self, SLAInfo) + + def paginated( + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[SLAInfo]: + """ + Performs a GET request against the /service/slas/info endpoint and returns an initialized PaginatedResponse object. + Parameters: + page (int): The page number to request. + page_size (int): The number of results to return per page. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaginatedResponse[SLAInfo]: The initialized PaginatedResponse object. + """ + if params: + params["page"] = page + params["pageSize"] = page_size + else: + params = {"page": page, "pageSize": page_size} + return PaginatedResponse(super()._make_request("GET", params=params), SLAInfo, self, page, page_size, params) -class ServiceSlasInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SLAInfo]: + """ + Performs a GET request against the /service/slas/info endpoint. - self.count = self._register_child_endpoint( - ServiceSlasInfoCountEndpoint(client, parent_endpoint=self) - ) + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + list[SLAInfo]: The parsed response data. + """ + return self._parse_many(SLAInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesCountEndpoint.py index d051c29d1..4df472c59 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSourcesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/sources/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/sources/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesEndpoint.py index ffbaaaedd..d2ff32154 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSourcesCountEndpoint import ( - ServiceSourcesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSourcesIdEndpoint import ( - ServiceSourcesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSourcesInfoEndpoint import ( - ServiceSourcesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceSourcesCountEndpoint import ServiceSourcesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceSourcesIdEndpoint import ServiceSourcesIdEndpoint +from pyconnectwise.endpoints.manage.ServiceSourcesInfoEndpoint import ServiceSourcesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Source from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesEndpoint( @@ -27,39 +19,30 @@ class ServiceSourcesEndpoint( IPostable[Source, ConnectWiseManageRequestParams], IPaginateable[Source, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "sources", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "sources", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Source]) IPostable.__init__(self, Source) IPaginateable.__init__(self, Source) - self.count = self._register_child_endpoint( - ServiceSourcesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceSourcesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceSourcesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceSourcesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSourcesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSourcesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSourcesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSourcesIdEndpoint: The initialized ServiceSourcesIdEndpoint object. """ child = ServiceSourcesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Source]: """ Performs a GET request against the /service/sources endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Source, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Source, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Source]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Source]: """ Performs a GET request against the /service/sources endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Source]: The parsed response data. """ - return self._parse_many( - Source, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Source, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Source: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Source: """ Performs a POST request against the /service/sources endpoint. @@ -117,6 +83,4 @@ def post( Returns: Source: The parsed response data. """ - return self._parse_one( - Source, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Source, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdEndpoint.py index 3dcc899c3..ab09a063e 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSourcesIdInfoEndpoint import ( - ServiceSourcesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSourcesIdUsagesEndpoint import ( - ServiceSourcesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceSourcesIdInfoEndpoint import ServiceSourcesIdInfoEndpoint +from pyconnectwise.endpoints.manage.ServiceSourcesIdUsagesEndpoint import ServiceSourcesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Source from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesIdEndpoint( ConnectWiseEndpoint, IGettable[Source, ConnectWiseManageRequestParams], - IPuttable[Source, ConnectWiseManageRequestParams], IPatchable[Source, ConnectWiseManageRequestParams], + IPuttable[Source, ConnectWiseManageRequestParams], IPaginateable[Source, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Source) - IPuttable.__init__(self, Source) IPatchable.__init__(self, Source) + IPuttable.__init__(self, Source) IPaginateable.__init__(self, Source) - self.usages = self._register_child_endpoint( - ServiceSourcesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceSourcesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceSourcesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ServiceSourcesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Source]: """ Performs a GET request against the /service/sources/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +47,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Source, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Source, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Source: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/sources/{id} endpoint. + Performs a DELETE request against the /service/sources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Source: The parsed response data. """ - return self._parse_one( - Source, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Source: """ - Performs a DELETE request against the /service/sources/{id} endpoint. + Performs a GET request against the /service/sources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Source: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Source, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Source: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Source: """ - Performs a PUT request against the /service/sources/{id} endpoint. + Performs a PATCH request against the /service/sources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +81,11 @@ def put( Returns: Source: The parsed response data. """ - return self._parse_one( - Source, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Source, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Source: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Source: """ - Performs a PATCH request against the /service/sources/{id} endpoint. + Performs a PUT request against the /service/sources/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +93,4 @@ def patch( Returns: Source: The parsed response data. """ - return self._parse_one( - Source, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Source, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdInfoEndpoint.py index 23d9556e4..f9f3f34d7 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SourceInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceSourcesIdInfoEndpoint( IGettable[SourceInfo, ConnectWiseManageRequestParams], IPaginateable[SourceInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SourceInfo) IPaginateable.__init__(self, SourceInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SourceInfo]: """ Performs a GET request against the /service/sources/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SourceInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SourceInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SourceInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SourceInfo: """ Performs a GET request against the /service/sources/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: SourceInfo: The parsed response data. """ - return self._parse_one( - SourceInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(SourceInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesEndpoint.py index 3fd8a242c..3cf9c80eb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSourcesIdUsagesListEndpoint import ( - ServiceSourcesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceSourcesIdUsagesListEndpoint import ServiceSourcesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ServiceSourcesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ServiceSourcesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ServiceSourcesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/sources/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/sources/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesListEndpoint.py index 9352c4c83..02e71ff74 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceSourcesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/sources/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/sources/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoCountEndpoint.py index 316a0040d..d4391cac1 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSourcesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/sources/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/sources/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoEndpoint.py index 6f7a5fa13..ad09eae72 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSourcesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSourcesInfoCountEndpoint import ( - ServiceSourcesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceSourcesInfoCountEndpoint import ServiceSourcesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SourceInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSourcesInfoEndpoint( @@ -19,22 +16,15 @@ class ServiceSourcesInfoEndpoint( IGettable[list[SourceInfo], ConnectWiseManageRequestParams], IPaginateable[SourceInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SourceInfo]) IPaginateable.__init__(self, SourceInfo) - self.count = self._register_child_endpoint( - ServiceSourcesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceSourcesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SourceInfo]: """ Performs a GET request against the /service/sources/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SourceInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SourceInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SourceInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SourceInfo]: """ Performs a GET request against the /service/sources/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[SourceInfo]: The parsed response data. """ - return self._parse_many( - SourceInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SourceInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysCountEndpoint.py index a8f6da460..ce4528699 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSurveysCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/surveys/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/surveys/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysEndpoint.py index cdf888b04..27e2b8ef2 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSurveysCountEndpoint import ( - ServiceSurveysCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSurveysIdEndpoint import ( - ServiceSurveysIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceSurveysCountEndpoint import ServiceSurveysCountEndpoint +from pyconnectwise.endpoints.manage.ServiceSurveysIdEndpoint import ServiceSurveysIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ServiceSurvey from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysEndpoint( @@ -24,36 +18,29 @@ class ServiceSurveysEndpoint( IPostable[ServiceSurvey, ConnectWiseManageRequestParams], IPaginateable[ServiceSurvey, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "surveys", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "surveys", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceSurvey]) IPostable.__init__(self, ServiceSurvey) IPaginateable.__init__(self, ServiceSurvey) - self.count = self._register_child_endpoint( - ServiceSurveysCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceSurveysCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSurveysIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSurveysIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSurveysIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSurveysIdEndpoint: The initialized ServiceSurveysIdEndpoint object. """ child = ServiceSurveysIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSurvey]: """ Performs a GET request against the /service/surveys endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSurvey, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSurvey, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceSurvey]: """ Performs a GET request against the /service/surveys endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[ServiceSurvey]: The parsed response data. """ - return self._parse_many( - ServiceSurvey, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ServiceSurvey, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSurvey: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSurvey: """ Performs a POST request against the /service/surveys endpoint. @@ -111,7 +85,4 @@ def post( Returns: ServiceSurvey: The parsed response data. """ - return self._parse_one( - ServiceSurvey, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceSurvey, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdCopyEndpoint.py index c8c5b7921..33dafde90 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdCopyEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ServiceSurvey -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ServiceSurveysIdCopyEndpoint( - ConnectWiseEndpoint, IPostable[ServiceSurvey, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) +class ServiceSurveysIdCopyEndpoint(ConnectWiseEndpoint, IPostable[ServiceSurvey, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, ServiceSurvey) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSurvey: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSurvey: """ Performs a POST request against the /service/surveys/{id}/copy endpoint. @@ -32,7 +24,4 @@ def post( Returns: ServiceSurvey: The parsed response data. """ - return self._parse_one( - ServiceSurvey, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceSurvey, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdEndpoint.py index e07588773..04c7b1deb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdEndpoint.py @@ -1,65 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSurveysIdCopyEndpoint import ( - ServiceSurveysIdCopyEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsEndpoint import ( - ServiceSurveysIdQuestionsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSurveysIdResultsEndpoint import ( - ServiceSurveysIdResultsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSurveysIdUsagesEndpoint import ( - ServiceSurveysIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceSurveysIdCopyEndpoint import ServiceSurveysIdCopyEndpoint +from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsEndpoint import ServiceSurveysIdQuestionsEndpoint +from pyconnectwise.endpoints.manage.ServiceSurveysIdResultsEndpoint import ServiceSurveysIdResultsEndpoint +from pyconnectwise.endpoints.manage.ServiceSurveysIdUsagesEndpoint import ServiceSurveysIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ServiceSurvey from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdEndpoint( ConnectWiseEndpoint, IGettable[ServiceSurvey, ConnectWiseManageRequestParams], - IPuttable[ServiceSurvey, ConnectWiseManageRequestParams], IPatchable[ServiceSurvey, ConnectWiseManageRequestParams], + IPuttable[ServiceSurvey, ConnectWiseManageRequestParams], IPaginateable[ServiceSurvey, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceSurvey) - IPuttable.__init__(self, ServiceSurvey) IPatchable.__init__(self, ServiceSurvey) + IPuttable.__init__(self, ServiceSurvey) IPaginateable.__init__(self, ServiceSurvey) - self.copy = self._register_child_endpoint( - ServiceSurveysIdCopyEndpoint(client, parent_endpoint=self) - ) - self.results = self._register_child_endpoint( - ServiceSurveysIdResultsEndpoint(client, parent_endpoint=self) - ) - self.usages = self._register_child_endpoint( - ServiceSurveysIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.questions = self._register_child_endpoint( - ServiceSurveysIdQuestionsEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(ServiceSurveysIdCopyEndpoint(client, parent_endpoint=self)) + self.questions = self._register_child_endpoint(ServiceSurveysIdQuestionsEndpoint(client, parent_endpoint=self)) + self.results = self._register_child_endpoint(ServiceSurveysIdResultsEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(ServiceSurveysIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSurvey]: """ Performs a GET request against the /service/surveys/{id} endpoint and returns an initialized PaginatedResponse object. @@ -77,53 +52,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSurvey, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSurvey, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSurvey: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/surveys/{id} endpoint. + Performs a DELETE request against the /service/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ServiceSurvey: The parsed response data. """ - return self._parse_one( - ServiceSurvey, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSurvey: """ - Performs a DELETE request against the /service/surveys/{id} endpoint. + Performs a GET request against the /service/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ServiceSurvey: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ServiceSurvey, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSurvey: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ServiceSurvey: """ - Performs a PUT request against the /service/surveys/{id} endpoint. + Performs a PATCH request against the /service/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,17 +87,11 @@ def put( Returns: ServiceSurvey: The parsed response data. """ - return self._parse_one( - ServiceSurvey, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ServiceSurvey, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSurvey: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceSurvey: """ - Performs a PATCH request against the /service/surveys/{id} endpoint. + Performs a PUT request against the /service/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -149,7 +99,4 @@ def patch( Returns: ServiceSurvey: The parsed response data. """ - return self._parse_one( - ServiceSurvey, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ServiceSurvey, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsCountEndpoint.py index 29c034305..0b25b5cbb 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdQuestionsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSurveysIdQuestionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/surveys/{id}/questions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/surveys/{id}/questions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsEndpoint.py index 29d728694..1902146b7 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsCountEndpoint import ( - ServiceSurveysIdQuestionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsIdEndpoint import ( - ServiceSurveysIdQuestionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsCountEndpoint import ServiceSurveysIdQuestionsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsIdEndpoint import ServiceSurveysIdQuestionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ServiceSurveyQuestion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdQuestionsEndpoint( @@ -24,36 +18,29 @@ class ServiceSurveysIdQuestionsEndpoint( IPostable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], IPaginateable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "questions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "questions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceSurveyQuestion]) IPostable.__init__(self, ServiceSurveyQuestion) IPaginateable.__init__(self, ServiceSurveyQuestion) - self.count = self._register_child_endpoint( - ServiceSurveysIdQuestionsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceSurveysIdQuestionsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSurveysIdQuestionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSurveysIdQuestionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSurveysIdQuestionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSurveysIdQuestionsIdEndpoint: The initialized ServiceSurveysIdQuestionsIdEndpoint object. """ child = ServiceSurveysIdQuestionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSurveyQuestion]: """ Performs a GET request against the /service/surveys/{id}/questions endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSurveyQuestion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSurveyQuestion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceSurveyQuestion]: """ Performs a GET request against the /service/surveys/{id}/questions endpoint. @@ -93,15 +73,10 @@ def get( Returns: list[ServiceSurveyQuestion]: The parsed response data. """ - return self._parse_many( - ServiceSurveyQuestion, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceSurveyQuestion, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceSurveyQuestion: """ Performs a POST request against the /service/surveys/{id}/questions endpoint. @@ -112,7 +87,4 @@ def post( Returns: ServiceSurveyQuestion: The parsed response data. """ - return self._parse_one( - ServiceSurveyQuestion, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceSurveyQuestion, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdCopyEndpoint.py index 5b22c750b..47b6b7482 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdCopyEndpoint.py @@ -1,28 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ServiceSurveyQuestion -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdQuestionsIdCopyEndpoint( - ConnectWiseEndpoint, - IPostable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], + ConnectWiseEndpoint, IPostable[ServiceSurveyQuestion, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, ServiceSurveyQuestion) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceSurveyQuestion: """ Performs a POST request against the /service/surveys/{id}/questions/{id}/copy endpoint. @@ -33,7 +28,4 @@ def post( Returns: ServiceSurveyQuestion: The parsed response data. """ - return self._parse_one( - ServiceSurveyQuestion, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceSurveyQuestion, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdEndpoint.py index 80db73218..0ef3238f0 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsIdCopyEndpoint import ( ServiceSurveysIdQuestionsIdCopyEndpoint, @@ -5,49 +7,36 @@ from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsIdOptionsEndpoint import ( ServiceSurveysIdQuestionsIdOptionsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ServiceSurveyQuestion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdQuestionsIdEndpoint( ConnectWiseEndpoint, IGettable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], - IPuttable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], IPatchable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], + IPuttable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], IPaginateable[ServiceSurveyQuestion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceSurveyQuestion) - IPuttable.__init__(self, ServiceSurveyQuestion) IPatchable.__init__(self, ServiceSurveyQuestion) + IPuttable.__init__(self, ServiceSurveyQuestion) IPaginateable.__init__(self, ServiceSurveyQuestion) - self.copy = self._register_child_endpoint( - ServiceSurveysIdQuestionsIdCopyEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(ServiceSurveysIdQuestionsIdCopyEndpoint(client, parent_endpoint=self)) self.options = self._register_child_endpoint( ServiceSurveysIdQuestionsIdOptionsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceSurveyQuestion]: """ Performs a GET request against the /service/surveys/{id}/questions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +54,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceSurveyQuestion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceSurveyQuestion, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceSurveyQuestion: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/surveys/{id}/questions/{id} endpoint. + Performs a DELETE request against the /service/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ServiceSurveyQuestion: The parsed response data. """ - return self._parse_one( - ServiceSurveyQuestion, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ServiceSurveyQuestion: """ - Performs a DELETE request against the /service/surveys/{id}/questions/{id} endpoint. + Performs a GET request against the /service/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ServiceSurveyQuestion: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ServiceSurveyQuestion, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ServiceSurveyQuestion: """ - Performs a PUT request against the /service/surveys/{id}/questions/{id} endpoint. + Performs a PATCH request against the /service/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +93,13 @@ def put( Returns: ServiceSurveyQuestion: The parsed response data. """ - return self._parse_one( - ServiceSurveyQuestion, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ServiceSurveyQuestion, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceSurveyQuestion: """ - Performs a PATCH request against the /service/surveys/{id}/questions/{id} endpoint. + Performs a PUT request against the /service/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +107,4 @@ def patch( Returns: ServiceSurveyQuestion: The parsed response data. """ - return self._parse_one( - ServiceSurveyQuestion, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ServiceSurveyQuestion, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsCountEndpoint.py index c90b18b4d..e96f15f3a 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdQuestionsIdOptionsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSurveysIdQuestionsIdOptionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/surveys/{id}/questions/{id}/options/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/surveys/{id}/questions/{id}/options/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsEndpoint.py index c0f1374ca..040829b2f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsIdOptionsCountEndpoint import ( ServiceSurveysIdQuestionsIdOptionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceSurveysIdQuestionsIdOptionsIdEndpoint import ( ServiceSurveysIdQuestionsIdOptionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SurveyOption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdQuestionsIdOptionsEndpoint( @@ -24,40 +22,31 @@ class ServiceSurveysIdQuestionsIdOptionsEndpoint( IPostable[SurveyOption, ConnectWiseManageRequestParams], IPaginateable[SurveyOption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "options", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "options", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SurveyOption]) IPostable.__init__(self, SurveyOption) IPaginateable.__init__(self, SurveyOption) self.count = self._register_child_endpoint( - ServiceSurveysIdQuestionsIdOptionsCountEndpoint( - client, parent_endpoint=self - ) + ServiceSurveysIdQuestionsIdOptionsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceSurveysIdQuestionsIdOptionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSurveysIdQuestionsIdOptionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSurveysIdQuestionsIdOptionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSurveysIdQuestionsIdOptionsIdEndpoint: The initialized ServiceSurveysIdQuestionsIdOptionsIdEndpoint object. """ - child = ServiceSurveysIdQuestionsIdOptionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceSurveysIdQuestionsIdOptionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyOption]: """ Performs a GET request against the /service/surveys/{id}/questions/{id}/options endpoint and returns an initialized PaginatedResponse object. @@ -75,19 +64,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyOption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyOption, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SurveyOption]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SurveyOption]: """ Performs a GET request against the /service/surveys/{id}/questions/{id}/options endpoint. @@ -97,15 +77,9 @@ def get( Returns: list[SurveyOption]: The parsed response data. """ - return self._parse_many( - SurveyOption, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SurveyOption, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyOption: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyOption: """ Performs a POST request against the /service/surveys/{id}/questions/{id}/options endpoint. @@ -115,6 +89,4 @@ def post( Returns: SurveyOption: The parsed response data. """ - return self._parse_one( - SurveyOption, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(SurveyOption, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsIdEndpoint.py index 6de2a99c5..016c6e0cc 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdQuestionsIdOptionsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SurveyOption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdQuestionsIdOptionsIdEndpoint( ConnectWiseEndpoint, IGettable[SurveyOption, ConnectWiseManageRequestParams], - IPuttable[SurveyOption, ConnectWiseManageRequestParams], IPatchable[SurveyOption, ConnectWiseManageRequestParams], + IPuttable[SurveyOption, ConnectWiseManageRequestParams], IPaginateable[SurveyOption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SurveyOption) - IPuttable.__init__(self, SurveyOption) IPatchable.__init__(self, SurveyOption) + IPuttable.__init__(self, SurveyOption) IPaginateable.__init__(self, SurveyOption) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyOption]: """ Performs a GET request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyOption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyOption, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyOption: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. + Performs a DELETE request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SurveyOption: The parsed response data. """ - return self._parse_one( - SurveyOption, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyOption: """ - Performs a DELETE request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. + Performs a GET request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SurveyOption: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SurveyOption, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyOption: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SurveyOption: """ - Performs a PUT request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. + Performs a PATCH request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: SurveyOption: The parsed response data. """ - return self._parse_one( - SurveyOption, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SurveyOption, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyOption: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyOption: """ - Performs a PATCH request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. + Performs a PUT request against the /service/surveys/{id}/questions/{id}/options/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: SurveyOption: The parsed response data. """ - return self._parse_one( - SurveyOption, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SurveyOption, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsCountEndpoint.py index f5e5581f4..3c4b88d77 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdResultsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceSurveysIdResultsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/surveys/{id}/results/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/surveys/{id}/results/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsEndpoint.py index bf91b75c5..c396a168b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSurveysIdResultsCountEndpoint import ( - ServiceSurveysIdResultsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceSurveysIdResultsIdEndpoint import ( - ServiceSurveysIdResultsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceSurveysIdResultsCountEndpoint import ServiceSurveysIdResultsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceSurveysIdResultsIdEndpoint import ServiceSurveysIdResultsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SurveyResult from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdResultsEndpoint( @@ -24,36 +18,29 @@ class ServiceSurveysIdResultsEndpoint( IPostable[SurveyResult, ConnectWiseManageRequestParams], IPaginateable[SurveyResult, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "results", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "results", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SurveyResult]) IPostable.__init__(self, SurveyResult) IPaginateable.__init__(self, SurveyResult) - self.count = self._register_child_endpoint( - ServiceSurveysIdResultsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceSurveysIdResultsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceSurveysIdResultsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceSurveysIdResultsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceSurveysIdResultsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceSurveysIdResultsIdEndpoint: The initialized ServiceSurveysIdResultsIdEndpoint object. """ child = ServiceSurveysIdResultsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyResult]: """ Performs a GET request against the /service/surveys/{id}/results endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyResult, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyResult, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SurveyResult]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SurveyResult]: """ Performs a GET request against the /service/surveys/{id}/results endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[SurveyResult]: The parsed response data. """ - return self._parse_many( - SurveyResult, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SurveyResult, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyResult: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyResult: """ Performs a POST request against the /service/surveys/{id}/results endpoint. @@ -111,6 +83,4 @@ def post( Returns: SurveyResult: The parsed response data. """ - return self._parse_one( - SurveyResult, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(SurveyResult, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsIdEndpoint.py index aee2c0b51..5591c87a6 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdResultsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SurveyResult from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdResultsIdEndpoint( ConnectWiseEndpoint, IGettable[SurveyResult, ConnectWiseManageRequestParams], - IPuttable[SurveyResult, ConnectWiseManageRequestParams], IPatchable[SurveyResult, ConnectWiseManageRequestParams], + IPuttable[SurveyResult, ConnectWiseManageRequestParams], IPaginateable[SurveyResult, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SurveyResult) - IPuttable.__init__(self, SurveyResult) IPatchable.__init__(self, SurveyResult) + IPuttable.__init__(self, SurveyResult) IPaginateable.__init__(self, SurveyResult) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyResult]: """ Performs a GET request against the /service/surveys/{id}/results/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyResult, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyResult, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyResult: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/surveys/{id}/results/{id} endpoint. + Performs a DELETE request against the /service/surveys/{id}/results/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SurveyResult: The parsed response data. """ - return self._parse_one( - SurveyResult, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyResult: """ - Performs a DELETE request against the /service/surveys/{id}/results/{id} endpoint. + Performs a GET request against the /service/surveys/{id}/results/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SurveyResult: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SurveyResult, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyResult: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SurveyResult: """ - Performs a PUT request against the /service/surveys/{id}/results/{id} endpoint. + Performs a PATCH request against the /service/surveys/{id}/results/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: SurveyResult: The parsed response data. """ - return self._parse_one( - SurveyResult, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SurveyResult, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyResult: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyResult: """ - Performs a PATCH request against the /service/surveys/{id}/results/{id} endpoint. + Performs a PUT request against the /service/surveys/{id}/results/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: SurveyResult: The parsed response data. """ - return self._parse_one( - SurveyResult, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SurveyResult, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesEndpoint.py index e701c5e80..0fdd827dc 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceSurveysIdUsagesListEndpoint import ( - ServiceSurveysIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceSurveysIdUsagesListEndpoint import ServiceSurveysIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdUsagesEndpoint( @@ -19,22 +16,15 @@ class ServiceSurveysIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - ServiceSurveysIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(ServiceSurveysIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/surveys/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/surveys/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesListEndpoint.py index 2e22f0555..067b99756 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceSurveysIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceSurveysIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class ServiceSurveysIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /service/surveys/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /service/surveys/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTeammembersEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTeammembersEndpoint.py index c02477a96..3b7100025 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTeammembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTeammembersEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import TeamMember -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ServiceTeammembersEndpoint( - ConnectWiseEndpoint, IPostable[TeamMember, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "teamMembers", parent_endpoint=parent_endpoint - ) +class ServiceTeammembersEndpoint(ConnectWiseEndpoint, IPostable[TeamMember, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "teamMembers", parent_endpoint=parent_endpoint) IPostable.__init__(self, TeamMember) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TeamMember: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TeamMember: """ Performs a POST request against the /service/teamMembers endpoint. @@ -32,6 +24,4 @@ def post( Returns: TeamMember: The parsed response data. """ - return self._parse_one( - TeamMember, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TeamMember, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTeamsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTeamsCountEndpoint.py index 46c75c5c5..b050817d8 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTeamsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTeamsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTeamsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTeamsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/teams/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/teams/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTeamsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTeamsEndpoint.py index 68f4c419a..3f484243a 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTeamsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTeamsEndpoint.py @@ -1,18 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTeamsCountEndpoint import ( - ServiceTeamsCountEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceTeamsCountEndpoint import ServiceTeamsCountEndpoint from pyconnectwise.endpoints.manage.ServiceTeamsIdEndpoint import ServiceTeamsIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTeamsEndpoint( @@ -20,35 +17,28 @@ class ServiceTeamsEndpoint( IGettable[list[ServiceTeam], ConnectWiseManageRequestParams], IPaginateable[ServiceTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "teams", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "teams", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceTeam]) IPaginateable.__init__(self, ServiceTeam) - self.count = self._register_child_endpoint( - ServiceTeamsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTeamsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceTeamsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTeamsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTeamsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTeamsIdEndpoint: The initialized ServiceTeamsIdEndpoint object. """ child = ServiceTeamsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTeam]: """ Performs a GET request against the /service/teams endpoint and returns an initialized PaginatedResponse object. @@ -66,19 +56,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTeam, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTeam, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ServiceTeam]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ServiceTeam]: """ Performs a GET request against the /service/teams endpoint. @@ -88,6 +69,4 @@ def get( Returns: list[ServiceTeam]: The parsed response data. """ - return self._parse_many( - ServiceTeam, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ServiceTeam, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTeamsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTeamsIdEndpoint.py index 8007ed054..e67b50730 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTeamsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTeamsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTeam from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTeamsIdEndpoint( @@ -16,18 +15,13 @@ class ServiceTeamsIdEndpoint( IGettable[ServiceTeam, ConnectWiseManageRequestParams], IPaginateable[ServiceTeam, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceTeam) IPaginateable.__init__(self, ServiceTeam) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTeam]: """ Performs a GET request against the /service/teams/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTeam, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTeam, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceTeam: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceTeam: """ Performs a GET request against the /service/teams/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: ServiceTeam: The parsed response data. """ - return self._parse_one( - ServiceTeam, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ServiceTeam, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTemplatesCountEndpoint.py index beaa8c3aa..11805e93c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTemplatesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTemplatesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTemplatesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/templates/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/templates/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTemplatesEndpoint.py index 291131266..00c965586 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTemplatesEndpoint.py @@ -1,23 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTemplatesCountEndpoint import ( - ServiceTemplatesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTemplatesIdEndpoint import ( - ServiceTemplatesIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTemplatesInfoEndpoint import ( - ServiceTemplatesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceTemplatesCountEndpoint import ServiceTemplatesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceTemplatesIdEndpoint import ServiceTemplatesIdEndpoint +from pyconnectwise.endpoints.manage.ServiceTemplatesInfoEndpoint import ServiceTemplatesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTemplatesEndpoint( @@ -25,38 +18,29 @@ class ServiceTemplatesEndpoint( IGettable[list[ServiceTemplate], ConnectWiseManageRequestParams], IPaginateable[ServiceTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "templates", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "templates", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceTemplate]) IPaginateable.__init__(self, ServiceTemplate) - self.count = self._register_child_endpoint( - ServiceTemplatesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceTemplatesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTemplatesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceTemplatesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceTemplatesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTemplatesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTemplatesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTemplatesIdEndpoint: The initialized ServiceTemplatesIdEndpoint object. """ child = ServiceTemplatesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTemplate]: """ Performs a GET request against the /service/templates endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTemplate, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceTemplate]: """ Performs a GET request against the /service/templates endpoint. @@ -96,7 +73,4 @@ def get( Returns: list[ServiceTemplate]: The parsed response data. """ - return self._parse_many( - ServiceTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceTemplate, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdEndpoint.py index 1f99c674b..e53471b14 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTemplatesIdGenerateEndpoint import ( - ServiceTemplatesIdGenerateEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTemplatesIdInfoEndpoint import ( - ServiceTemplatesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceTemplatesIdGenerateEndpoint import ServiceTemplatesIdGenerateEndpoint +from pyconnectwise.endpoints.manage.ServiceTemplatesIdInfoEndpoint import ServiceTemplatesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTemplate from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTemplatesIdEndpoint( @@ -22,25 +17,16 @@ class ServiceTemplatesIdEndpoint( IGettable[ServiceTemplate, ConnectWiseManageRequestParams], IPaginateable[ServiceTemplate, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceTemplate) IPaginateable.__init__(self, ServiceTemplate) - self.generate = self._register_child_endpoint( - ServiceTemplatesIdGenerateEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceTemplatesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.generate = self._register_child_endpoint(ServiceTemplatesIdGenerateEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceTemplatesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTemplate]: """ Performs a GET request against the /service/templates/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,19 +44,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTemplate, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTemplate, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceTemplate: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceTemplate: """ Performs a GET request against the /service/templates/{id} endpoint. @@ -80,7 +57,4 @@ def get( Returns: ServiceTemplate: The parsed response data. """ - return self._parse_one( - ServiceTemplate, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ServiceTemplate, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdGenerateEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdGenerateEndpoint.py index 2d9f5d9e1..2a05d4586 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdGenerateEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdGenerateEndpoint.py @@ -1,28 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import TemplateGeneratedCountsModel -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTemplatesIdGenerateEndpoint( - ConnectWiseEndpoint, - IPostable[TemplateGeneratedCountsModel, ConnectWiseManageRequestParams], + ConnectWiseEndpoint, IPostable[TemplateGeneratedCountsModel, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "generate", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "generate", parent_endpoint=parent_endpoint) IPostable.__init__(self, TemplateGeneratedCountsModel) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TemplateGeneratedCountsModel: """ Performs a POST request against the /service/templates/{id}/generate endpoint. @@ -34,6 +29,5 @@ def post( TemplateGeneratedCountsModel: The parsed response data. """ return self._parse_one( - TemplateGeneratedCountsModel, - super()._make_request("POST", data=data, params=params).json(), + TemplateGeneratedCountsModel, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdInfoEndpoint.py index f38575ae9..48daa5ff7 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTemplatesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTemplateInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTemplatesIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceTemplatesIdInfoEndpoint( IGettable[ServiceTemplateInfo, ConnectWiseManageRequestParams], IPaginateable[ServiceTemplateInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceTemplateInfo) IPaginateable.__init__(self, ServiceTemplateInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTemplateInfo]: """ Performs a GET request against the /service/templates/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTemplateInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTemplateInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceTemplateInfo: """ Performs a GET request against the /service/templates/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: ServiceTemplateInfo: The parsed response data. """ - return self._parse_one( - ServiceTemplateInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ServiceTemplateInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoCountEndpoint.py index 3d5344633..0239b4c13 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTemplatesInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTemplatesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/templates/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/templates/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoEndpoint.py index 01aa5c7dd..481026335 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTemplatesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTemplatesInfoCountEndpoint import ( - ServiceTemplatesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceTemplatesInfoCountEndpoint import ServiceTemplatesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTemplateInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTemplatesInfoEndpoint( @@ -19,22 +16,15 @@ class ServiceTemplatesInfoEndpoint( IGettable[list[ServiceTemplateInfo], ConnectWiseManageRequestParams], IPaginateable[ServiceTemplateInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceTemplateInfo]) IPaginateable.__init__(self, ServiceTemplateInfo) - self.count = self._register_child_endpoint( - ServiceTemplatesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTemplatesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTemplateInfo]: """ Performs a GET request against the /service/templates/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTemplateInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTemplateInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceTemplateInfo]: """ Performs a GET request against the /service/templates/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ServiceTemplateInfo]: The parsed response data. """ - return self._parse_many( - ServiceTemplateInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceTemplateInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksCountEndpoint.py index e0b7327c6..e23b70a3b 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketlinksCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketlinksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/ticketLinks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/ticketLinks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksEndpoint.py index 3dd3eaf2b..93cb6446d 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketlinksCountEndpoint import ( - ServiceTicketlinksCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketlinksIdEndpoint import ( - ServiceTicketlinksIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketlinksInfoEndpoint import ( - ServiceTicketlinksInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceTicketlinksCountEndpoint import ServiceTicketlinksCountEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketlinksIdEndpoint import ServiceTicketlinksIdEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketlinksInfoEndpoint import ServiceTicketlinksInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ServiceTicketLink from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketlinksEndpoint( @@ -27,39 +19,30 @@ class ServiceTicketlinksEndpoint( IPostable[ServiceTicketLink, ConnectWiseManageRequestParams], IPaginateable[ServiceTicketLink, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ticketLinks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ticketLinks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceTicketLink]) IPostable.__init__(self, ServiceTicketLink) IPaginateable.__init__(self, ServiceTicketLink) - self.count = self._register_child_endpoint( - ServiceTicketlinksCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceTicketlinksInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketlinksCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceTicketlinksInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceTicketlinksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTicketlinksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTicketlinksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTicketlinksIdEndpoint: The initialized ServiceTicketlinksIdEndpoint object. """ child = ServiceTicketlinksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTicketLink]: """ Performs a GET request against the /service/ticketLinks endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTicketLink, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTicketLink, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceTicketLink]: """ Performs a GET request against the /service/ticketLinks endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[ServiceTicketLink]: The parsed response data. """ - return self._parse_many( - ServiceTicketLink, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceTicketLink, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceTicketLink: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceTicketLink: """ Performs a POST request against the /service/ticketLinks endpoint. @@ -118,7 +87,4 @@ def post( Returns: ServiceTicketLink: The parsed response data. """ - return self._parse_one( - ServiceTicketLink, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ServiceTicketLink, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdEndpoint.py index b6106661d..00c4c02e4 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketlinksIdInfoEndpoint import ( - ServiceTicketlinksIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceTicketlinksIdInfoEndpoint import ServiceTicketlinksIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ServiceTicketLink from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketlinksIdEndpoint( ConnectWiseEndpoint, IGettable[ServiceTicketLink, ConnectWiseManageRequestParams], - IPuttable[ServiceTicketLink, ConnectWiseManageRequestParams], IPatchable[ServiceTicketLink, ConnectWiseManageRequestParams], + IPuttable[ServiceTicketLink, ConnectWiseManageRequestParams], IPaginateable[ServiceTicketLink, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceTicketLink) - IPuttable.__init__(self, ServiceTicketLink) IPatchable.__init__(self, ServiceTicketLink) + IPuttable.__init__(self, ServiceTicketLink) IPaginateable.__init__(self, ServiceTicketLink) - self.info = self._register_child_endpoint( - ServiceTicketlinksIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(ServiceTicketlinksIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTicketLink]: """ Performs a GET request against the /service/ticketLinks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTicketLink, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTicketLink, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceTicketLink: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/ticketLinks/{id} endpoint. + Performs a DELETE request against the /service/ticketLinks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ServiceTicketLink: The parsed response data. """ - return self._parse_one( - ServiceTicketLink, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceTicketLink: """ - Performs a DELETE request against the /service/ticketLinks/{id} endpoint. + Performs a GET request against the /service/ticketLinks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ServiceTicketLink: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ServiceTicketLink, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceTicketLink: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ServiceTicketLink: """ - Performs a PUT request against the /service/ticketLinks/{id} endpoint. + Performs a PATCH request against the /service/ticketLinks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +81,11 @@ def put( Returns: ServiceTicketLink: The parsed response data. """ - return self._parse_one( - ServiceTicketLink, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ServiceTicketLink, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceTicketLink: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceTicketLink: """ - Performs a PATCH request against the /service/ticketLinks/{id} endpoint. + Performs a PUT request against the /service/ticketLinks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +93,4 @@ def patch( Returns: ServiceTicketLink: The parsed response data. """ - return self._parse_one( - ServiceTicketLink, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ServiceTicketLink, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdInfoEndpoint.py index a35a5849a..5f69aba50 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTicketLinkInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketlinksIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketlinksIdInfoEndpoint( IGettable[ServiceTicketLinkInfo, ConnectWiseManageRequestParams], IPaginateable[ServiceTicketLinkInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceTicketLinkInfo) IPaginateable.__init__(self, ServiceTicketLinkInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTicketLinkInfo]: """ Performs a GET request against the /service/ticketLinks/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTicketLinkInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTicketLinkInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ServiceTicketLinkInfo: """ Performs a GET request against the /service/ticketLinks/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: ServiceTicketLinkInfo: The parsed response data. """ - return self._parse_one( - ServiceTicketLinkInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ServiceTicketLinkInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoCountEndpoint.py index dd9f3b12e..4534c2973 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketlinksInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketlinksInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/ticketLinks/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/ticketLinks/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoEndpoint.py index 789c74e77..05d96d170 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketlinksInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketlinksInfoCountEndpoint import ( - ServiceTicketlinksInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceTicketlinksInfoCountEndpoint import ServiceTicketlinksInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTicketLinkInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketlinksInfoEndpoint( @@ -19,22 +16,15 @@ class ServiceTicketlinksInfoEndpoint( IGettable[list[ServiceTicketLinkInfo], ConnectWiseManageRequestParams], IPaginateable[ServiceTicketLinkInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceTicketLinkInfo]) IPaginateable.__init__(self, ServiceTicketLinkInfo) - self.count = self._register_child_endpoint( - ServiceTicketlinksInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketlinksInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTicketLinkInfo]: """ Performs a GET request against the /service/ticketLinks/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTicketLinkInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTicketLinkInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceTicketLinkInfo]: """ Performs a GET request against the /service/ticketLinks/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ServiceTicketLinkInfo]: The parsed response data. """ - return self._parse_many( - ServiceTicketLinkInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceTicketLinkInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsCountEndpoint.py index 1da5626ca..de2fa35ed 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsEndpoint.py index d0ca29e6d..7fd38bde2 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsEndpoint.py @@ -1,27 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsCountEndpoint import ( - ServiceTicketsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdEndpoint import ( - ServiceTicketsIdEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsInfoEndpoint import ( - ServiceTicketsInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsSearchEndpoint import ( - ServiceTicketsSearchEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsCountEndpoint import ServiceTicketsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdEndpoint import ServiceTicketsIdEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsInfoEndpoint import ServiceTicketsInfoEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsSearchEndpoint import ServiceTicketsSearchEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Ticket from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsEndpoint( @@ -30,42 +20,31 @@ class ServiceTicketsEndpoint( IPostable[Ticket, ConnectWiseManageRequestParams], IPaginateable[Ticket, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tickets", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tickets", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Ticket]) IPostable.__init__(self, Ticket) IPaginateable.__init__(self, Ticket) - self.count = self._register_child_endpoint( - ServiceTicketsCountEndpoint(client, parent_endpoint=self) - ) - self.search = self._register_child_endpoint( - ServiceTicketsSearchEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceTicketsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceTicketsInfoEndpoint(client, parent_endpoint=self)) + self.search = self._register_child_endpoint(ServiceTicketsSearchEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceTicketsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTicketsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTicketsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTicketsIdEndpoint: The initialized ServiceTicketsIdEndpoint object. """ child = ServiceTicketsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Ticket]: """ Performs a GET request against the /service/tickets endpoint and returns an initialized PaginatedResponse object. @@ -82,20 +61,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Ticket, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Ticket, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Ticket]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Ticket]: """ Performs a GET request against the /service/tickets endpoint. @@ -105,15 +73,9 @@ def get( Returns: list[Ticket]: The parsed response data. """ - return self._parse_many( - Ticket, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Ticket, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Ticket: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Ticket: """ Performs a POST request against the /service/tickets endpoint. @@ -123,6 +85,4 @@ def post( Returns: Ticket: The parsed response data. """ - return self._parse_one( - Ticket, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Ticket, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesCountEndpoint.py index be4926b14..69166195f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdActivitiesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdActivitiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/activities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/activities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesEndpoint.py index 19a85ea4f..3a9f12a35 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdActivitiesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceTicketsIdActivitiesCountEndpoint import ( ServiceTicketsIdActivitiesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ActivityReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdActivitiesEndpoint( @@ -19,10 +18,8 @@ class ServiceTicketsIdActivitiesEndpoint( IGettable[list[ActivityReference], ConnectWiseManageRequestParams], IPaginateable[ActivityReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "activities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "activities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ActivityReference]) IPaginateable.__init__(self, ActivityReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityReference]: """ Performs a GET request against the /service/tickets/{id}/activities endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ActivityReference]: """ Performs a GET request against the /service/tickets/{id}/activities endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ActivityReference]: The parsed response data. """ - return self._parse_many( - ActivityReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ActivityReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAllnotesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAllnotesEndpoint.py index b5477c992..dc63ff52c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAllnotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAllnotesEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceTicketNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdAllnotesEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdAllnotesEndpoint( IGettable[list[ServiceTicketNote], ConnectWiseManageRequestParams], IPaginateable[ServiceTicketNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "allNotes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "allNotes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceTicketNote]) IPaginateable.__init__(self, ServiceTicketNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceTicketNote]: """ Performs a GET request against the /service/tickets/{id}/allNotes endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceTicketNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceTicketNote, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ServiceTicketNote]: """ Performs a GET request against the /service/tickets/{id}/allNotes endpoint. @@ -67,7 +54,4 @@ def get( Returns: list[ServiceTicketNote]: The parsed response data. """ - return self._parse_many( - ServiceTicketNote, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ServiceTicketNote, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAttachchildrenEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAttachchildrenEndpoint.py index 1ebf1e5a3..2dbb142e7 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAttachchildrenEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdAttachchildrenEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdAttachchildrenEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "attachChildren", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "attachChildren", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /service/tickets/{id}/attachChildren endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsCountEndpoint.py index bed06d3d2..72bec1ca5 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdConfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdConfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/configurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/configurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsEndpoint.py index 0ae9d17ee..7964a8330 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceTicketsIdConfigurationsCountEndpoint import ( ServiceTicketsIdConfigurationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.ServiceTicketsIdConfigurationsIdEndpoint import ( ServiceTicketsIdConfigurationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConfigurationReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdConfigurationsEndpoint( @@ -24,10 +22,8 @@ class ServiceTicketsIdConfigurationsEndpoint( IPostable[ConfigurationReference, ConnectWiseManageRequestParams], IPaginateable[ConfigurationReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "configurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "configurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConfigurationReference]) IPostable.__init__(self, ConfigurationReference) IPaginateable.__init__(self, ConfigurationReference) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ServiceTicketsIdConfigurationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> ServiceTicketsIdConfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTicketsIdConfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTicketsIdConfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTicketsIdConfigurationsIdEndpoint: The initialized ServiceTicketsIdConfigurationsIdEndpoint object. """ - child = ServiceTicketsIdConfigurationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = ServiceTicketsIdConfigurationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationReference]: """ Performs a GET request against the /service/tickets/{id}/configurations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConfigurationReference]: """ Performs a GET request against the /service/tickets/{id}/configurations endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[ConfigurationReference]: The parsed response data. """ - return self._parse_many( - ConfigurationReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConfigurationReference, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConfigurationReference: """ Performs a POST request against the /service/tickets/{id}/configurations endpoint. @@ -114,7 +93,4 @@ def post( Returns: ConfigurationReference: The parsed response data. """ - return self._parse_one( - ConfigurationReference, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ConfigurationReference, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsIdEndpoint.py index b13cf98dc..8f1c16262 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConfigurationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConfigurationReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdConfigurationsIdEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdConfigurationsIdEndpoint( IGettable[ConfigurationReference, ConnectWiseManageRequestParams], IPaginateable[ConfigurationReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConfigurationReference) IPaginateable.__init__(self, ConfigurationReference) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConfigurationReference]: """ Performs a GET request against the /service/tickets/{id}/configurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,29 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConfigurationReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConfigurationReference, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConfigurationReference: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/tickets/{id}/configurations/{id} endpoint. + Performs a DELETE request against the /service/tickets/{id}/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConfigurationReference: The parsed response data. """ - return self._parse_one( - ConfigurationReference, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ConfigurationReference: """ - Performs a DELETE request against the /service/tickets/{id}/configurations/{id} endpoint. + Performs a GET request against the /service/tickets/{id}/configurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConfigurationReference: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ConfigurationReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConvertEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConvertEndpoint.py index 370200e1e..48f7f21a9 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConvertEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdConvertEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ServiceTicketsIdConvertEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "convert", parent_endpoint=parent_endpoint - ) +class ServiceTicketsIdConvertEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "convert", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /service/tickets/{id}/convert endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsCountEndpoint.py index 70c781e2f..e02d1ee75 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdDocumentsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdDocumentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/documents/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/documents/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsEndpoint.py index 263887c6e..84e905bfc 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdDocumentsEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsIdDocumentsCountEndpoint import ( - ServiceTicketsIdDocumentsCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsIdDocumentsCountEndpoint import ServiceTicketsIdDocumentsCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import DocumentReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdDocumentsEndpoint( @@ -19,22 +16,15 @@ class ServiceTicketsIdDocumentsEndpoint( IGettable[list[DocumentReference], ConnectWiseManageRequestParams], IPaginateable[DocumentReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "documents", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "documents", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DocumentReference]) IPaginateable.__init__(self, DocumentReference) - self.count = self._register_child_endpoint( - ServiceTicketsIdDocumentsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketsIdDocumentsCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DocumentReference]: """ Performs a GET request against the /service/tickets/{id}/documents endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DocumentReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DocumentReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[DocumentReference]: """ Performs a GET request against the /service/tickets/{id}/documents endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[DocumentReference]: The parsed response data. """ - return self._parse_many( - DocumentReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(DocumentReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdEndpoint.py index 578f2cc89..c0ccd672c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdEndpoint.py @@ -1,119 +1,70 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsIdActivitiesEndpoint import ( - ServiceTicketsIdActivitiesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdAllnotesEndpoint import ( - ServiceTicketsIdAllnotesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdAttachchildrenEndpoint import ( - ServiceTicketsIdAttachchildrenEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdConfigurationsEndpoint import ( - ServiceTicketsIdConfigurationsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdConvertEndpoint import ( - ServiceTicketsIdConvertEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdDocumentsEndpoint import ( - ServiceTicketsIdDocumentsEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdInfoEndpoint import ( - ServiceTicketsIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdMergeEndpoint import ( - ServiceTicketsIdMergeEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdNotesEndpoint import ( - ServiceTicketsIdNotesEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdProductsEndpoint import ( - ServiceTicketsIdProductsEndpoint, -) +from pyconnectwise.endpoints.manage.ServiceTicketsIdActivitiesEndpoint import ServiceTicketsIdActivitiesEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdAllnotesEndpoint import ServiceTicketsIdAllnotesEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdAttachchildrenEndpoint import ServiceTicketsIdAttachchildrenEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdConfigurationsEndpoint import ServiceTicketsIdConfigurationsEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdConvertEndpoint import ServiceTicketsIdConvertEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdDocumentsEndpoint import ServiceTicketsIdDocumentsEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdInfoEndpoint import ServiceTicketsIdInfoEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdMergeEndpoint import ServiceTicketsIdMergeEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdNotesEndpoint import ServiceTicketsIdNotesEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdProductsEndpoint import ServiceTicketsIdProductsEndpoint from pyconnectwise.endpoints.manage.ServiceTicketsIdScheduleentriesEndpoint import ( ServiceTicketsIdScheduleentriesEndpoint, ) -from pyconnectwise.endpoints.manage.ServiceTicketsIdTasksEndpoint import ( - ServiceTicketsIdTasksEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdTimeentriesEndpoint import ( - ServiceTicketsIdTimeentriesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsIdTasksEndpoint import ServiceTicketsIdTasksEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdTimeentriesEndpoint import ServiceTicketsIdTimeentriesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Ticket from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdEndpoint( ConnectWiseEndpoint, IGettable[Ticket, ConnectWiseManageRequestParams], - IPuttable[Ticket, ConnectWiseManageRequestParams], IPatchable[Ticket, ConnectWiseManageRequestParams], + IPuttable[Ticket, ConnectWiseManageRequestParams], IPaginateable[Ticket, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Ticket) - IPuttable.__init__(self, Ticket) IPatchable.__init__(self, Ticket) + IPuttable.__init__(self, Ticket) IPaginateable.__init__(self, Ticket) - self.configurations = self._register_child_endpoint( - ServiceTicketsIdConfigurationsEndpoint(client, parent_endpoint=self) - ) - self.documents = self._register_child_endpoint( - ServiceTicketsIdDocumentsEndpoint(client, parent_endpoint=self) - ) - self.convert = self._register_child_endpoint( - ServiceTicketsIdConvertEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - ServiceTicketsIdInfoEndpoint(client, parent_endpoint=self) - ) - self.timeentries = self._register_child_endpoint( - ServiceTicketsIdTimeentriesEndpoint(client, parent_endpoint=self) - ) - self.products = self._register_child_endpoint( - ServiceTicketsIdProductsEndpoint(client, parent_endpoint=self) - ) - self.merge = self._register_child_endpoint( - ServiceTicketsIdMergeEndpoint(client, parent_endpoint=self) - ) - self.scheduleentries = self._register_child_endpoint( - ServiceTicketsIdScheduleentriesEndpoint(client, parent_endpoint=self) + self.activities = self._register_child_endpoint( + ServiceTicketsIdActivitiesEndpoint(client, parent_endpoint=self) ) + self.all_notes = self._register_child_endpoint(ServiceTicketsIdAllnotesEndpoint(client, parent_endpoint=self)) self.attach_children = self._register_child_endpoint( ServiceTicketsIdAttachchildrenEndpoint(client, parent_endpoint=self) ) - self.all_notes = self._register_child_endpoint( - ServiceTicketsIdAllnotesEndpoint(client, parent_endpoint=self) - ) - self.notes = self._register_child_endpoint( - ServiceTicketsIdNotesEndpoint(client, parent_endpoint=self) + self.configurations = self._register_child_endpoint( + ServiceTicketsIdConfigurationsEndpoint(client, parent_endpoint=self) ) - self.tasks = self._register_child_endpoint( - ServiceTicketsIdTasksEndpoint(client, parent_endpoint=self) + self.convert = self._register_child_endpoint(ServiceTicketsIdConvertEndpoint(client, parent_endpoint=self)) + self.documents = self._register_child_endpoint(ServiceTicketsIdDocumentsEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(ServiceTicketsIdInfoEndpoint(client, parent_endpoint=self)) + self.merge = self._register_child_endpoint(ServiceTicketsIdMergeEndpoint(client, parent_endpoint=self)) + self.notes = self._register_child_endpoint(ServiceTicketsIdNotesEndpoint(client, parent_endpoint=self)) + self.products = self._register_child_endpoint(ServiceTicketsIdProductsEndpoint(client, parent_endpoint=self)) + self.scheduleentries = self._register_child_endpoint( + ServiceTicketsIdScheduleentriesEndpoint(client, parent_endpoint=self) ) - self.activities = self._register_child_endpoint( - ServiceTicketsIdActivitiesEndpoint(client, parent_endpoint=self) + self.tasks = self._register_child_endpoint(ServiceTicketsIdTasksEndpoint(client, parent_endpoint=self)) + self.timeentries = self._register_child_endpoint( + ServiceTicketsIdTimeentriesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Ticket]: """ Performs a GET request against the /service/tickets/{id} endpoint and returns an initialized PaginatedResponse object. @@ -130,54 +81,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Ticket, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Ticket, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Ticket: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/tickets/{id} endpoint. + Performs a DELETE request against the /service/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Ticket: The parsed response data. """ - return self._parse_one( - Ticket, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Ticket: """ - Performs a DELETE request against the /service/tickets/{id} endpoint. + Performs a GET request against the /service/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Ticket: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Ticket, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Ticket: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Ticket: """ - Performs a PUT request against the /service/tickets/{id} endpoint. + Performs a PATCH request against the /service/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -185,17 +115,11 @@ def put( Returns: Ticket: The parsed response data. """ - return self._parse_one( - Ticket, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Ticket, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Ticket: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Ticket: """ - Performs a PATCH request against the /service/tickets/{id} endpoint. + Performs a PUT request against the /service/tickets/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -203,6 +127,4 @@ def patch( Returns: Ticket: The parsed response data. """ - return self._parse_one( - Ticket, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Ticket, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdInfoEndpoint.py index d5447d99e..ae3e03253 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TicketInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdInfoEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdInfoEndpoint( IGettable[TicketInfo, ConnectWiseManageRequestParams], IPaginateable[TicketInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, TicketInfo) IPaginateable.__init__(self, TicketInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketInfo]: """ Performs a GET request against the /service/tickets/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketInfo: """ Performs a GET request against the /service/tickets/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: TicketInfo: The parsed response data. """ - return self._parse_one( - TicketInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(TicketInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdMergeEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdMergeEndpoint.py index 8ac0a4657..52c1c23ba 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdMergeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdMergeEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ServiceTicketsIdMergeEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "merge", parent_endpoint=parent_endpoint - ) +class ServiceTicketsIdMergeEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "merge", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /service/tickets/{id}/merge endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesCountEndpoint.py index cb4eab077..2a911998c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdNotesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdNotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/notes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/notes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesEndpoint.py index cc12498ef..ed23be2ec 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsIdNotesCountEndpoint import ( - ServiceTicketsIdNotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdNotesIdEndpoint import ( - ServiceTicketsIdNotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsIdNotesCountEndpoint import ServiceTicketsIdNotesCountEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdNotesIdEndpoint import ServiceTicketsIdNotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ServiceNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdNotesEndpoint( @@ -24,36 +18,29 @@ class ServiceTicketsIdNotesEndpoint( IPostable[ServiceNote, ConnectWiseManageRequestParams], IPaginateable[ServiceNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceNote]) IPostable.__init__(self, ServiceNote) IPaginateable.__init__(self, ServiceNote) - self.count = self._register_child_endpoint( - ServiceTicketsIdNotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketsIdNotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceTicketsIdNotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTicketsIdNotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTicketsIdNotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTicketsIdNotesIdEndpoint: The initialized ServiceTicketsIdNotesIdEndpoint object. """ child = ServiceTicketsIdNotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceNote]: """ Performs a GET request against the /service/tickets/{id}/notes endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ServiceNote]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ServiceNote]: """ Performs a GET request against the /service/tickets/{id}/notes endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[ServiceNote]: The parsed response data. """ - return self._parse_many( - ServiceNote, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ServiceNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceNote: """ Performs a POST request against the /service/tickets/{id}/notes endpoint. @@ -111,6 +83,4 @@ def post( Returns: ServiceNote: The parsed response data. """ - return self._parse_one( - ServiceNote, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ServiceNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesIdEndpoint.py index 931980ad4..a83f3ac78 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdNotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ServiceNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdNotesIdEndpoint( ConnectWiseEndpoint, IGettable[ServiceNote, ConnectWiseManageRequestParams], - IPuttable[ServiceNote, ConnectWiseManageRequestParams], IPatchable[ServiceNote, ConnectWiseManageRequestParams], + IPuttable[ServiceNote, ConnectWiseManageRequestParams], IPaginateable[ServiceNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceNote) - IPuttable.__init__(self, ServiceNote) IPatchable.__init__(self, ServiceNote) + IPuttable.__init__(self, ServiceNote) IPaginateable.__init__(self, ServiceNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceNote]: """ Performs a GET request against the /service/tickets/{id}/notes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/tickets/{id}/notes/{id} endpoint. + Performs a DELETE request against the /service/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ServiceNote: The parsed response data. """ - return self._parse_one( - ServiceNote, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceNote: """ - Performs a DELETE request against the /service/tickets/{id}/notes/{id} endpoint. + Performs a GET request against the /service/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ServiceNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ServiceNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ServiceNote: """ - Performs a PUT request against the /service/tickets/{id}/notes/{id} endpoint. + Performs a PATCH request against the /service/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: ServiceNote: The parsed response data. """ - return self._parse_one( - ServiceNote, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ServiceNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceNote: """ - Performs a PATCH request against the /service/tickets/{id}/notes/{id} endpoint. + Performs a PUT request against the /service/tickets/{id}/notes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: ServiceNote: The parsed response data. """ - return self._parse_one( - ServiceNote, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ServiceNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsCountEndpoint.py index ac75ef675..4f1d06038 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdProductsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdProductsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/products/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/products/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsEndpoint.py index 2df4fb849..21ba1da0c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdProductsEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsIdProductsCountEndpoint import ( - ServiceTicketsIdProductsCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsIdProductsCountEndpoint import ServiceTicketsIdProductsCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ProductReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdProductsEndpoint( @@ -19,22 +16,15 @@ class ServiceTicketsIdProductsEndpoint( IGettable[list[ProductReference], ConnectWiseManageRequestParams], IPaginateable[ProductReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "products", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "products", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ProductReference]) IPaginateable.__init__(self, ProductReference) - self.count = self._register_child_endpoint( - ServiceTicketsIdProductsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketsIdProductsCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ProductReference]: """ Performs a GET request against the /service/tickets/{id}/products endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ProductReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ProductReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ProductReference]: """ Performs a GET request against the /service/tickets/{id}/products endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ProductReference]: The parsed response data. """ - return self._parse_many( - ProductReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ProductReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesCountEndpoint.py index 4d95c6380..1642b518c 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdScheduleentriesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdScheduleentriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/scheduleentries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/scheduleentries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesEndpoint.py index eff49c6cd..b622f5aba 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdScheduleentriesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceTicketsIdScheduleentriesCountEndpoint import ( ServiceTicketsIdScheduleentriesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ScheduleEntryReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdScheduleentriesEndpoint( @@ -19,10 +18,8 @@ class ServiceTicketsIdScheduleentriesEndpoint( IGettable[list[ScheduleEntryReference], ConnectWiseManageRequestParams], IPaginateable[ScheduleEntryReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "scheduleentries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "scheduleentries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleEntryReference]) IPaginateable.__init__(self, ScheduleEntryReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleEntryReference]: """ Performs a GET request against the /service/tickets/{id}/scheduleentries endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleEntryReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleEntryReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleEntryReference]: """ Performs a GET request against the /service/tickets/{id}/scheduleentries endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ScheduleEntryReference]: The parsed response data. """ - return self._parse_many( - ScheduleEntryReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleEntryReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksCountEndpoint.py index 069b8f601..34e801443 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdTasksCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdTasksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/tasks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/tasks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksEndpoint.py index 545b4a852..94e7e6b88 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsIdTasksCountEndpoint import ( - ServiceTicketsIdTasksCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsIdTasksIdEndpoint import ( - ServiceTicketsIdTasksIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsIdTasksCountEndpoint import ServiceTicketsIdTasksCountEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsIdTasksIdEndpoint import ServiceTicketsIdTasksIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Task from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdTasksEndpoint( @@ -24,36 +18,29 @@ class ServiceTicketsIdTasksEndpoint( IPostable[Task, ConnectWiseManageRequestParams], IPaginateable[Task, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tasks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tasks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Task]) IPostable.__init__(self, Task) IPaginateable.__init__(self, Task) - self.count = self._register_child_endpoint( - ServiceTicketsIdTasksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketsIdTasksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceTicketsIdTasksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTicketsIdTasksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTicketsIdTasksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTicketsIdTasksIdEndpoint: The initialized ServiceTicketsIdTasksIdEndpoint object. """ child = ServiceTicketsIdTasksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Task]: """ Performs a GET request against the /service/tickets/{id}/tasks endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Task, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Task, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Task]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Task]: """ Performs a GET request against the /service/tickets/{id}/tasks endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Task]: The parsed response data. """ - return self._parse_many( - Task, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Task, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Task: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Task: """ Performs a POST request against the /service/tickets/{id}/tasks endpoint. @@ -111,6 +81,4 @@ def post( Returns: Task: The parsed response data. """ - return self._parse_one( - Task, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Task, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksIdEndpoint.py index 1eaf3213f..dfee1481a 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTasksIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Task from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdTasksIdEndpoint( ConnectWiseEndpoint, IGettable[Task, ConnectWiseManageRequestParams], - IPuttable[Task, ConnectWiseManageRequestParams], IPatchable[Task, ConnectWiseManageRequestParams], + IPuttable[Task, ConnectWiseManageRequestParams], IPaginateable[Task, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Task) - IPuttable.__init__(self, Task) IPatchable.__init__(self, Task) + IPuttable.__init__(self, Task) IPaginateable.__init__(self, Task) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Task]: """ Performs a GET request against the /service/tickets/{id}/tasks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Task, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Task, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Task: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/tickets/{id}/tasks/{id} endpoint. + Performs a DELETE request against the /service/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Task: The parsed response data. """ - return self._parse_one( - Task, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Task: """ - Performs a DELETE request against the /service/tickets/{id}/tasks/{id} endpoint. + Performs a GET request against the /service/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Task: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Task, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Task: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Task: """ - Performs a PUT request against the /service/tickets/{id}/tasks/{id} endpoint. + Performs a PATCH request against the /service/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Task: The parsed response data. """ - return self._parse_one( - Task, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Task, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Task: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Task: """ - Performs a PATCH request against the /service/tickets/{id}/tasks/{id} endpoint. + Performs a PUT request against the /service/tickets/{id}/tasks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Task: The parsed response data. """ - return self._parse_one( - Task, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Task, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesCountEndpoint.py index fc2a4d742..5484bcfee 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdTimeentriesCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsIdTimeentriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/{id}/timeentries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/{id}/timeentries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesEndpoint.py index 899de20e6..0169225dd 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsIdTimeentriesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.ServiceTicketsIdTimeentriesCountEndpoint import ( ServiceTicketsIdTimeentriesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeEntryReference from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsIdTimeentriesEndpoint( @@ -19,10 +18,8 @@ class ServiceTicketsIdTimeentriesEndpoint( IGettable[list[TimeEntryReference], ConnectWiseManageRequestParams], IPaginateable[TimeEntryReference, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "timeentries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "timeentries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeEntryReference]) IPaginateable.__init__(self, TimeEntryReference) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeEntryReference]: """ Performs a GET request against the /service/tickets/{id}/timeentries endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeEntryReference, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeEntryReference, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimeEntryReference]: """ Performs a GET request against the /service/tickets/{id}/timeentries endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[TimeEntryReference]: The parsed response data. """ - return self._parse_many( - TimeEntryReference, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TimeEntryReference, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoCountEndpoint.py index 067f12b49..a403ffe01 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsInfoCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/tickets/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/tickets/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoEndpoint.py index 0e2939ec5..8a46801e3 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsInfoCountEndpoint import ( - ServiceTicketsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsInfoCountEndpoint import ServiceTicketsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TicketInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsInfoEndpoint( @@ -19,22 +16,15 @@ class ServiceTicketsInfoEndpoint( IGettable[list[TicketInfo], ConnectWiseManageRequestParams], IPaginateable[TicketInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TicketInfo]) IPaginateable.__init__(self, TicketInfo) - self.count = self._register_child_endpoint( - ServiceTicketsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketInfo]: """ Performs a GET request against the /service/tickets/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TicketInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TicketInfo]: """ Performs a GET request against the /service/tickets/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[TicketInfo]: The parsed response data. """ - return self._parse_many( - TicketInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TicketInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsSearchEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsSearchEndpoint.py index 695cf9006..d742f880a 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsSearchEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsSearchEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Ticket -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class ServiceTicketsSearchEndpoint( - ConnectWiseEndpoint, IPostable[list[Ticket], ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "search", parent_endpoint=parent_endpoint - ) +class ServiceTicketsSearchEndpoint(ConnectWiseEndpoint, IPostable[list[Ticket], ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "search", parent_endpoint=parent_endpoint) IPostable.__init__(self, list[Ticket]) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Ticket]: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Ticket]: """ Performs a POST request against the /service/tickets/search endpoint. @@ -32,6 +24,4 @@ def post( Returns: list[Ticket]: The parsed response data. """ - return self._parse_many( - Ticket, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_many(Ticket, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsCountEndpoint.py index c1ae4d990..b0aaa6b2f 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsyncsCountEndpoint( @@ -16,18 +15,13 @@ class ServiceTicketsyncsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /service/ticketSyncs/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /service/ticketSyncs/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsEndpoint.py index 3cbc29f2e..f2c33a30e 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.ServiceTicketsyncsCountEndpoint import ( - ServiceTicketsyncsCountEndpoint, -) -from pyconnectwise.endpoints.manage.ServiceTicketsyncsIdEndpoint import ( - ServiceTicketsyncsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.ServiceTicketsyncsCountEndpoint import ServiceTicketsyncsCountEndpoint +from pyconnectwise.endpoints.manage.ServiceTicketsyncsIdEndpoint import ServiceTicketsyncsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TicketSync from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsyncsEndpoint( @@ -24,36 +18,29 @@ class ServiceTicketsyncsEndpoint( IPostable[TicketSync, ConnectWiseManageRequestParams], IPaginateable[TicketSync, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ticketSyncs", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ticketSyncs", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TicketSync]) IPostable.__init__(self, TicketSync) IPaginateable.__init__(self, TicketSync) - self.count = self._register_child_endpoint( - ServiceTicketsyncsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(ServiceTicketsyncsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> ServiceTicketsyncsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> ServiceTicketsyncsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized ServiceTicketsyncsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: ServiceTicketsyncsIdEndpoint: The initialized ServiceTicketsyncsIdEndpoint object. """ child = ServiceTicketsyncsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketSync]: """ Performs a GET request against the /service/ticketSyncs endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketSync, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketSync, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TicketSync]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TicketSync]: """ Performs a GET request against the /service/ticketSyncs endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[TicketSync]: The parsed response data. """ - return self._parse_many( - TicketSync, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TicketSync, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketSync: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketSync: """ Performs a POST request against the /service/ticketSyncs endpoint. @@ -111,6 +81,4 @@ def post( Returns: TicketSync: The parsed response data. """ - return self._parse_one( - TicketSync, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TicketSync, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsIdEndpoint.py index ca61b781a..d57b60167 100644 --- a/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/ServiceTicketsyncsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TicketSync from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class ServiceTicketsyncsIdEndpoint( ConnectWiseEndpoint, IGettable[TicketSync, ConnectWiseManageRequestParams], - IPuttable[TicketSync, ConnectWiseManageRequestParams], IPatchable[TicketSync, ConnectWiseManageRequestParams], + IPuttable[TicketSync, ConnectWiseManageRequestParams], IPaginateable[TicketSync, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TicketSync) - IPuttable.__init__(self, TicketSync) IPatchable.__init__(self, TicketSync) + IPuttable.__init__(self, TicketSync) IPaginateable.__init__(self, TicketSync) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketSync]: """ Performs a GET request against the /service/ticketSyncs/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TicketSync, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TicketSync, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketSync: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /service/ticketSyncs/{id} endpoint. + Performs a DELETE request against the /service/ticketSyncs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TicketSync: The parsed response data. """ - return self._parse_one( - TicketSync, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketSync: """ - Performs a DELETE request against the /service/ticketSyncs/{id} endpoint. + Performs a GET request against the /service/ticketSyncs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TicketSync: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TicketSync, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketSync: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TicketSync: """ - Performs a PUT request against the /service/ticketSyncs/{id} endpoint. + Performs a PATCH request against the /service/ticketSyncs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: TicketSync: The parsed response data. """ - return self._parse_one( - TicketSync, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TicketSync, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketSync: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketSync: """ - Performs a PATCH request against the /service/ticketSyncs/{id} endpoint. + Performs a PUT request against the /service/ticketSyncs/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: TicketSync: The parsed response data. """ - return self._parse_one( - TicketSync, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TicketSync, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesCountEndpoint.py index 2c079c8cb..5e53760d5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAllowedfiletypesCountEndpoint( @@ -16,18 +15,13 @@ class SystemAllowedfiletypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/allowedfiletypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/allowedfiletypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesEndpoint.py index 623e66495..e926b9610 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesEndpoint.py @@ -1,8 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +from pyconnectwise.endpoints.manage.SystemAllowedfiletypesCountEndpoint import SystemAllowedfiletypesCountEndpoint +from pyconnectwise.endpoints.manage.SystemAllowedfiletypesIdEndpoint import SystemAllowedfiletypesIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAllowedfiletypesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "AllowedFileTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "allowedfiletypes", parent_endpoint=parent_endpoint) + + self.count = self._register_child_endpoint(SystemAllowedfiletypesCountEndpoint(client, parent_endpoint=self)) + + def id(self, _id: int) -> SystemAllowedfiletypesIdEndpoint: + """ + Sets the ID for this endpoint and returns an initialized SystemAllowedfiletypesIdEndpoint object to move down the chain. + + Parameters: + _id (int): The ID to set. + Returns: + SystemAllowedfiletypesIdEndpoint: The initialized SystemAllowedfiletypesIdEndpoint object. + """ + child = SystemAllowedfiletypesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id + return child diff --git a/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesIdEndpoint.py index 158a2ad83..64a042d9b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAllowedfiletypesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AllowedFileType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAllowedfiletypesIdEndpoint( ConnectWiseEndpoint, IGettable[AllowedFileType, ConnectWiseManageRequestParams], - IPuttable[AllowedFileType, ConnectWiseManageRequestParams], IPatchable[AllowedFileType, ConnectWiseManageRequestParams], + IPuttable[AllowedFileType, ConnectWiseManageRequestParams], IPaginateable[AllowedFileType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AllowedFileType) - IPuttable.__init__(self, AllowedFileType) IPatchable.__init__(self, AllowedFileType) + IPuttable.__init__(self, AllowedFileType) IPaginateable.__init__(self, AllowedFileType) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AllowedFileType]: """ Performs a GET request against the /system/allowedfiletypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AllowedFileType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AllowedFileType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AllowedFileType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/allowedfiletypes/{id} endpoint. + Performs a DELETE request against the /system/allowedfiletypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AllowedFileType: The parsed response data. """ - return self._parse_one( - AllowedFileType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AllowedFileType: """ - Performs a DELETE request against the /system/allowedfiletypes/{id} endpoint. + Performs a GET request against the /system/allowedfiletypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AllowedFileType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AllowedFileType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AllowedFileType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AllowedFileType: """ - Performs a PUT request against the /system/allowedfiletypes/{id} endpoint. + Performs a PATCH request against the /system/allowedfiletypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: AllowedFileType: The parsed response data. """ - return self._parse_one( - AllowedFileType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(AllowedFileType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AllowedFileType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AllowedFileType: """ - Performs a PATCH request against the /system/allowedfiletypes/{id} endpoint. + Performs a PUT request against the /system/allowedfiletypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: AllowedFileType: The parsed response data. """ - return self._parse_one( - AllowedFileType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AllowedFileType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsCountEndpoint.py index 3ae449817..e3493b4cc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAllowedoriginsCountEndpoint( @@ -16,18 +15,13 @@ class SystemAllowedoriginsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/allowedorigins/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/allowedorigins/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsEndpoint.py index 993bea17b..427e47e17 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemAllowedoriginsCountEndpoint import ( - SystemAllowedoriginsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAllowedoriginsIdEndpoint import ( - SystemAllowedoriginsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemAllowedoriginsCountEndpoint import SystemAllowedoriginsCountEndpoint +from pyconnectwise.endpoints.manage.SystemAllowedoriginsIdEndpoint import SystemAllowedoriginsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AllowedOrigin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAllowedoriginsEndpoint( @@ -24,36 +18,29 @@ class SystemAllowedoriginsEndpoint( IPostable[AllowedOrigin, ConnectWiseManageRequestParams], IPaginateable[AllowedOrigin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "allowedorigins", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "allowedorigins", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AllowedOrigin]) IPostable.__init__(self, AllowedOrigin) IPaginateable.__init__(self, AllowedOrigin) - self.count = self._register_child_endpoint( - SystemAllowedoriginsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemAllowedoriginsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemAllowedoriginsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemAllowedoriginsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemAllowedoriginsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemAllowedoriginsIdEndpoint: The initialized SystemAllowedoriginsIdEndpoint object. """ child = SystemAllowedoriginsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AllowedOrigin]: """ Performs a GET request against the /system/allowedorigins endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AllowedOrigin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AllowedOrigin, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AllowedOrigin]: """ Performs a GET request against the /system/allowedorigins endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[AllowedOrigin]: The parsed response data. """ - return self._parse_many( - AllowedOrigin, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(AllowedOrigin, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AllowedOrigin: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AllowedOrigin: """ Performs a POST request against the /system/allowedorigins endpoint. @@ -111,7 +85,4 @@ def post( Returns: AllowedOrigin: The parsed response data. """ - return self._parse_one( - AllowedOrigin, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(AllowedOrigin, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsIdEndpoint.py index 131f8a122..0c9e79f86 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAllowedoriginsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AllowedOrigin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAllowedoriginsIdEndpoint( ConnectWiseEndpoint, IGettable[AllowedOrigin, ConnectWiseManageRequestParams], - IPuttable[AllowedOrigin, ConnectWiseManageRequestParams], IPatchable[AllowedOrigin, ConnectWiseManageRequestParams], + IPuttable[AllowedOrigin, ConnectWiseManageRequestParams], IPaginateable[AllowedOrigin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AllowedOrigin) - IPuttable.__init__(self, AllowedOrigin) IPatchable.__init__(self, AllowedOrigin) + IPuttable.__init__(self, AllowedOrigin) IPaginateable.__init__(self, AllowedOrigin) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AllowedOrigin]: """ Performs a GET request against the /system/allowedorigins/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AllowedOrigin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AllowedOrigin, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AllowedOrigin: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/allowedorigins/{id} endpoint. + Performs a DELETE request against the /system/allowedorigins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AllowedOrigin: The parsed response data. """ - return self._parse_one( - AllowedOrigin, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AllowedOrigin: """ - Performs a DELETE request against the /system/allowedorigins/{id} endpoint. + Performs a GET request against the /system/allowedorigins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AllowedOrigin: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AllowedOrigin, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AllowedOrigin: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AllowedOrigin: """ - Performs a PUT request against the /system/allowedorigins/{id} endpoint. + Performs a PATCH request against the /system/allowedorigins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: AllowedOrigin: The parsed response data. """ - return self._parse_one( - AllowedOrigin, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(AllowedOrigin, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AllowedOrigin: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AllowedOrigin: """ - Performs a PATCH request against the /system/allowedorigins/{id} endpoint. + Performs a PUT request against the /system/allowedorigins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: AllowedOrigin: The parsed response data. """ - return self._parse_one( - AllowedOrigin, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AllowedOrigin, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemApimembersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemApimembersCountEndpoint.py index 22e0e55ea..cceea4e89 100644 --- a/src/pyconnectwise/endpoints/manage/SystemApimembersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemApimembersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemApimembersCountEndpoint( @@ -16,18 +15,13 @@ class SystemApimembersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/apiMembers/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/apiMembers/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemApimembersDefaultEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemApimembersDefaultEndpoint.py index 13c6825a6..64cada4ff 100644 --- a/src/pyconnectwise/endpoints/manage/SystemApimembersDefaultEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemApimembersDefaultEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ApiMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemApimembersDefaultEndpoint( @@ -16,18 +15,13 @@ class SystemApimembersDefaultEndpoint( IGettable[ApiMember, ConnectWiseManageRequestParams], IPaginateable[ApiMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "default", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "default", parent_endpoint=parent_endpoint) IGettable.__init__(self, ApiMember) IPaginateable.__init__(self, ApiMember) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ApiMember]: """ Performs a GET request against the /system/apiMembers/default endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ApiMember, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ApiMember, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ApiMember: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ApiMember: """ Performs a GET request against the /system/apiMembers/default endpoint. @@ -67,6 +50,4 @@ def get( Returns: ApiMember: The parsed response data. """ - return self._parse_one( - ApiMember, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ApiMember, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemApimembersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemApimembersEndpoint.py index 7e9b8ecd2..80626abdd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemApimembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemApimembersEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemApimembersCountEndpoint import ( - SystemApimembersCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemApimembersDefaultEndpoint import ( - SystemApimembersDefaultEndpoint, -) -from pyconnectwise.endpoints.manage.SystemApimembersIdEndpoint import ( - SystemApimembersIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemApimembersCountEndpoint import SystemApimembersCountEndpoint +from pyconnectwise.endpoints.manage.SystemApimembersDefaultEndpoint import SystemApimembersDefaultEndpoint +from pyconnectwise.endpoints.manage.SystemApimembersIdEndpoint import SystemApimembersIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ApiMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemApimembersEndpoint( @@ -27,39 +19,30 @@ class SystemApimembersEndpoint( IPostable[ApiMember, ConnectWiseManageRequestParams], IPaginateable[ApiMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "apiMembers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "apiMembers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ApiMember]) IPostable.__init__(self, ApiMember) IPaginateable.__init__(self, ApiMember) - self.default = self._register_child_endpoint( - SystemApimembersDefaultEndpoint(client, parent_endpoint=self) - ) - self.count = self._register_child_endpoint( - SystemApimembersCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemApimembersCountEndpoint(client, parent_endpoint=self)) + self.default = self._register_child_endpoint(SystemApimembersDefaultEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemApimembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemApimembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemApimembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemApimembersIdEndpoint: The initialized SystemApimembersIdEndpoint object. """ child = SystemApimembersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ApiMember]: """ Performs a GET request against the /system/apiMembers endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ApiMember, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ApiMember, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ApiMember]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ApiMember]: """ Performs a GET request against the /system/apiMembers endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[ApiMember]: The parsed response data. """ - return self._parse_many( - ApiMember, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ApiMember, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ApiMember: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ApiMember: """ Performs a POST request against the /system/apiMembers endpoint. @@ -117,6 +83,4 @@ def post( Returns: ApiMember: The parsed response data. """ - return self._parse_one( - ApiMember, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ApiMember, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemApimembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemApimembersIdEndpoint.py index 800954234..8df5e702e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemApimembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemApimembersIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ApiMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemApimembersIdEndpoint( ConnectWiseEndpoint, IGettable[ApiMember, ConnectWiseManageRequestParams], - IPuttable[ApiMember, ConnectWiseManageRequestParams], IPatchable[ApiMember, ConnectWiseManageRequestParams], + IPuttable[ApiMember, ConnectWiseManageRequestParams], IPaginateable[ApiMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ApiMember) - IPuttable.__init__(self, ApiMember) IPatchable.__init__(self, ApiMember) + IPuttable.__init__(self, ApiMember) IPaginateable.__init__(self, ApiMember) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ApiMember]: """ Performs a GET request against the /system/apiMembers/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +42,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ApiMember, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ApiMember, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ApiMember: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ApiMember: """ Performs a GET request against the /system/apiMembers/{id} endpoint. @@ -74,17 +54,11 @@ def get( Returns: ApiMember: The parsed response data. """ - return self._parse_one( - ApiMember, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ApiMember, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ApiMember: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ApiMember: """ - Performs a PUT request against the /system/apiMembers/{id} endpoint. + Performs a PATCH request against the /system/apiMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +66,11 @@ def put( Returns: ApiMember: The parsed response data. """ - return self._parse_one( - ApiMember, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ApiMember, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ApiMember: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ApiMember: """ - Performs a PATCH request against the /system/apiMembers/{id} endpoint. + Performs a PUT request against the /system/apiMembers/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +78,4 @@ def patch( Returns: ApiMember: The parsed response data. """ - return self._parse_one( - ApiMember, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ApiMember, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAudittrailCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAudittrailCountEndpoint.py index 6da244c85..5bc17afa1 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAudittrailCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAudittrailCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAudittrailCountEndpoint( @@ -16,18 +15,13 @@ class SystemAudittrailCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/audittrail/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/audittrail/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAudittrailEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAudittrailEndpoint.py index d700b0db5..59b4d2691 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAudittrailEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAudittrailEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemAudittrailCountEndpoint import ( - SystemAudittrailCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemAudittrailCountEndpoint import SystemAudittrailCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AuditTrailEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAudittrailEndpoint( @@ -19,22 +16,15 @@ class SystemAudittrailEndpoint( IGettable[list[AuditTrailEntry], ConnectWiseManageRequestParams], IPaginateable[AuditTrailEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "audittrail", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "audittrail", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AuditTrailEntry]) IPaginateable.__init__(self, AuditTrailEntry) - self.count = self._register_child_endpoint( - SystemAudittrailCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemAudittrailCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AuditTrailEntry]: """ Performs a GET request against the /system/audittrail endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AuditTrailEntry, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AuditTrailEntry, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[AuditTrailEntry]: """ Performs a GET request against the /system/audittrail endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[AuditTrailEntry]: The parsed response data. """ - return self._parse_many( - AuditTrailEntry, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(AuditTrailEntry, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsCountEndpoint.py index af490b509..9ba41cfa9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAuthanvilsCountEndpoint( @@ -16,18 +15,13 @@ class SystemAuthanvilsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/authAnvils/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/authAnvils/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsEndpoint.py index 0eea7989f..552d43452 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsEndpoint.py @@ -1,23 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemAuthanvilsCountEndpoint import ( - SystemAuthanvilsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAuthanvilsIdEndpoint import ( - SystemAuthanvilsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAuthanvilsTestconnectionEndpoint import ( - SystemAuthanvilsTestconnectionEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemAuthanvilsCountEndpoint import SystemAuthanvilsCountEndpoint +from pyconnectwise.endpoints.manage.SystemAuthanvilsIdEndpoint import SystemAuthanvilsIdEndpoint +from pyconnectwise.endpoints.manage.SystemAuthanvilsTestconnectionEndpoint import SystemAuthanvilsTestconnectionEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import AuthAnvil from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAuthanvilsEndpoint( @@ -25,38 +18,31 @@ class SystemAuthanvilsEndpoint( IGettable[list[AuthAnvil], ConnectWiseManageRequestParams], IPaginateable[AuthAnvil, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "authAnvils", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "authAnvils", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AuthAnvil]) IPaginateable.__init__(self, AuthAnvil) - self.count = self._register_child_endpoint( - SystemAuthanvilsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemAuthanvilsCountEndpoint(client, parent_endpoint=self)) self.test_connection = self._register_child_endpoint( SystemAuthanvilsTestconnectionEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemAuthanvilsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemAuthanvilsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemAuthanvilsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemAuthanvilsIdEndpoint: The initialized SystemAuthanvilsIdEndpoint object. """ child = SystemAuthanvilsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AuthAnvil]: """ Performs a GET request against the /system/authAnvils endpoint and returns an initialized PaginatedResponse object. @@ -73,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - AuthAnvil, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), AuthAnvil, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[AuthAnvil]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[AuthAnvil]: """ Performs a GET request against the /system/authAnvils endpoint. @@ -96,6 +71,4 @@ def get( Returns: list[AuthAnvil]: The parsed response data. """ - return self._parse_many( - AuthAnvil, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(AuthAnvil, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsIdEndpoint.py index 26263604c..e52ecb97a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AuthAnvil from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAuthanvilsIdEndpoint( ConnectWiseEndpoint, IGettable[AuthAnvil, ConnectWiseManageRequestParams], - IPuttable[AuthAnvil, ConnectWiseManageRequestParams], IPatchable[AuthAnvil, ConnectWiseManageRequestParams], + IPuttable[AuthAnvil, ConnectWiseManageRequestParams], IPaginateable[AuthAnvil, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AuthAnvil) - IPuttable.__init__(self, AuthAnvil) IPatchable.__init__(self, AuthAnvil) + IPuttable.__init__(self, AuthAnvil) IPaginateable.__init__(self, AuthAnvil) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AuthAnvil]: """ Performs a GET request against the /system/authAnvils/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +42,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - AuthAnvil, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), AuthAnvil, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AuthAnvil: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AuthAnvil: """ Performs a GET request against the /system/authAnvils/{id} endpoint. @@ -74,17 +54,11 @@ def get( Returns: AuthAnvil: The parsed response data. """ - return self._parse_one( - AuthAnvil, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(AuthAnvil, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AuthAnvil: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AuthAnvil: """ - Performs a PUT request against the /system/authAnvils/{id} endpoint. + Performs a PATCH request against the /system/authAnvils/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +66,11 @@ def put( Returns: AuthAnvil: The parsed response data. """ - return self._parse_one( - AuthAnvil, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(AuthAnvil, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AuthAnvil: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AuthAnvil: """ - Performs a PATCH request against the /system/authAnvils/{id} endpoint. + Performs a PUT request against the /system/authAnvils/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +78,4 @@ def patch( Returns: AuthAnvil: The parsed response data. """ - return self._parse_one( - AuthAnvil, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(AuthAnvil, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsTestconnectionEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsTestconnectionEndpoint.py index 78857a488..82b216070 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAuthanvilsTestconnectionEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAuthanvilsTestconnectionEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SuccessResponse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAuthanvilsTestconnectionEndpoint( @@ -16,18 +15,13 @@ class SystemAuthanvilsTestconnectionEndpoint( IGettable[SuccessResponse, ConnectWiseManageRequestParams], IPaginateable[SuccessResponse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testConnection", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testConnection", parent_endpoint=parent_endpoint) IGettable.__init__(self, SuccessResponse) IPaginateable.__init__(self, SuccessResponse) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SuccessResponse]: """ Performs a GET request against the /system/authAnvils/testConnection endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SuccessResponse, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SuccessResponse, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a GET request against the /system/authAnvils/testConnection endpoint. @@ -67,7 +52,4 @@ def get( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAutosynctimeCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAutosynctimeCountEndpoint.py index b189bb884..29d45f447 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAutosynctimeCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAutosynctimeCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAutosynctimeCountEndpoint( @@ -16,18 +15,13 @@ class SystemAutosynctimeCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/autoSyncTime/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/autoSyncTime/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAutosynctimeEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAutosynctimeEndpoint.py index 272c9370e..b39396428 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAutosynctimeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAutosynctimeEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemAutosynctimeCountEndpoint import ( - SystemAutosynctimeCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAutosynctimeIdEndpoint import ( - SystemAutosynctimeIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemAutosynctimeCountEndpoint import SystemAutosynctimeCountEndpoint +from pyconnectwise.endpoints.manage.SystemAutosynctimeIdEndpoint import SystemAutosynctimeIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import AutoSyncTime from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAutosynctimeEndpoint( @@ -24,36 +18,29 @@ class SystemAutosynctimeEndpoint( IPostable[AutoSyncTime, ConnectWiseManageRequestParams], IPaginateable[AutoSyncTime, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "autoSyncTime", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "autoSyncTime", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[AutoSyncTime]) IPostable.__init__(self, AutoSyncTime) IPaginateable.__init__(self, AutoSyncTime) - self.count = self._register_child_endpoint( - SystemAutosynctimeCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemAutosynctimeCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemAutosynctimeIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemAutosynctimeIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemAutosynctimeIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemAutosynctimeIdEndpoint: The initialized SystemAutosynctimeIdEndpoint object. """ child = SystemAutosynctimeIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AutoSyncTime]: """ Performs a GET request against the /system/autoSyncTime endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AutoSyncTime, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AutoSyncTime, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[AutoSyncTime]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[AutoSyncTime]: """ Performs a GET request against the /system/autoSyncTime endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[AutoSyncTime]: The parsed response data. """ - return self._parse_many( - AutoSyncTime, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(AutoSyncTime, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AutoSyncTime: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AutoSyncTime: """ Performs a POST request against the /system/autoSyncTime endpoint. @@ -111,6 +83,4 @@ def post( Returns: AutoSyncTime: The parsed response data. """ - return self._parse_one( - AutoSyncTime, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(AutoSyncTime, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemAutosynctimeIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemAutosynctimeIdEndpoint.py index f7a60e85f..f768d3f58 100644 --- a/src/pyconnectwise/endpoints/manage/SystemAutosynctimeIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemAutosynctimeIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import AutoSyncTime from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemAutosynctimeIdEndpoint( ConnectWiseEndpoint, IGettable[AutoSyncTime, ConnectWiseManageRequestParams], - IPuttable[AutoSyncTime, ConnectWiseManageRequestParams], IPatchable[AutoSyncTime, ConnectWiseManageRequestParams], + IPuttable[AutoSyncTime, ConnectWiseManageRequestParams], IPaginateable[AutoSyncTime, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, AutoSyncTime) - IPuttable.__init__(self, AutoSyncTime) IPatchable.__init__(self, AutoSyncTime) + IPuttable.__init__(self, AutoSyncTime) IPaginateable.__init__(self, AutoSyncTime) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[AutoSyncTime]: """ Performs a GET request against the /system/autoSyncTime/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - AutoSyncTime, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), AutoSyncTime, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AutoSyncTime: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/autoSyncTime/{id} endpoint. + Performs a DELETE request against the /system/autoSyncTime/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - AutoSyncTime: The parsed response data. """ - return self._parse_one( - AutoSyncTime, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AutoSyncTime: """ - Performs a DELETE request against the /system/autoSyncTime/{id} endpoint. + Performs a GET request against the /system/autoSyncTime/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + AutoSyncTime: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(AutoSyncTime, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> AutoSyncTime: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> AutoSyncTime: """ - Performs a PUT request against the /system/autoSyncTime/{id} endpoint. + Performs a PATCH request against the /system/autoSyncTime/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: AutoSyncTime: The parsed response data. """ - return self._parse_one( - AutoSyncTime, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(AutoSyncTime, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> AutoSyncTime: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> AutoSyncTime: """ - Performs a PATCH request against the /system/autoSyncTime/{id} endpoint. + Performs a PUT request against the /system/autoSyncTime/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: AutoSyncTime: The parsed response data. """ - return self._parse_one( - AutoSyncTime, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(AutoSyncTime, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemBundlesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemBundlesCountEndpoint.py index 664f10ddc..3277a509b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemBundlesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemBundlesCountEndpoint.py @@ -1,28 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import BundleResultsCollection -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemBundlesCountEndpoint( - ConnectWiseEndpoint, - IPostable[BundleResultsCollection, ConnectWiseManageRequestParams], + ConnectWiseEndpoint, IPostable[BundleResultsCollection, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IPostable.__init__(self, BundleResultsCollection) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BundleResultsCollection: """ Performs a POST request against the /system/bundles/count endpoint. @@ -33,7 +28,4 @@ def post( Returns: BundleResultsCollection: The parsed response data. """ - return self._parse_one( - BundleResultsCollection, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BundleResultsCollection, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemBundlesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemBundlesEndpoint.py index d5205d300..25aac162b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemBundlesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemBundlesEndpoint.py @@ -1,35 +1,24 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemBundlesCountEndpoint import ( - SystemBundlesCountEndpoint, -) -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.endpoints.manage.SystemBundlesCountEndpoint import SystemBundlesCountEndpoint +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import BundleResultsCollection -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class SystemBundlesEndpoint( - ConnectWiseEndpoint, - IPostable[BundleResultsCollection, ConnectWiseManageRequestParams], -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "bundles", parent_endpoint=parent_endpoint - ) +class SystemBundlesEndpoint(ConnectWiseEndpoint, IPostable[BundleResultsCollection, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "bundles", parent_endpoint=parent_endpoint) IPostable.__init__(self, BundleResultsCollection) - self.count = self._register_child_endpoint( - SystemBundlesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemBundlesCountEndpoint(client, parent_endpoint=self)) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> BundleResultsCollection: """ Performs a POST request against the /system/bundles endpoint. @@ -40,7 +29,4 @@ def post( Returns: BundleResultsCollection: The parsed response data. """ - return self._parse_one( - BundleResultsCollection, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(BundleResultsCollection, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCallbacksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCallbacksCountEndpoint.py index a76b48e67..15d1a10b0 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCallbacksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCallbacksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCallbacksCountEndpoint( @@ -16,18 +15,13 @@ class SystemCallbacksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/callbacks/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/callbacks/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCallbacksEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCallbacksEndpoint.py index 608284f13..0d0b3e82b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCallbacksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCallbacksEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemCallbacksCountEndpoint import ( - SystemCallbacksCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemCallbacksIdEndpoint import ( - SystemCallbacksIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemCallbacksCountEndpoint import SystemCallbacksCountEndpoint +from pyconnectwise.endpoints.manage.SystemCallbacksIdEndpoint import SystemCallbacksIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CallbackEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCallbacksEndpoint( @@ -24,36 +18,29 @@ class SystemCallbacksEndpoint( IPostable[CallbackEntry, ConnectWiseManageRequestParams], IPaginateable[CallbackEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "callbacks", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "callbacks", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CallbackEntry]) IPostable.__init__(self, CallbackEntry) IPaginateable.__init__(self, CallbackEntry) - self.count = self._register_child_endpoint( - SystemCallbacksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemCallbacksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemCallbacksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemCallbacksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemCallbacksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemCallbacksIdEndpoint: The initialized SystemCallbacksIdEndpoint object. """ child = SystemCallbacksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CallbackEntry]: """ Performs a GET request against the /system/callbacks endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CallbackEntry, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CallbackEntry, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CallbackEntry]: """ Performs a GET request against the /system/callbacks endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[CallbackEntry]: The parsed response data. """ - return self._parse_many( - CallbackEntry, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CallbackEntry, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CallbackEntry: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CallbackEntry: """ Performs a POST request against the /system/callbacks endpoint. @@ -111,7 +85,4 @@ def post( Returns: CallbackEntry: The parsed response data. """ - return self._parse_one( - CallbackEntry, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CallbackEntry, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCallbacksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCallbacksIdEndpoint.py index 8e65e1a06..5caee0f65 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCallbacksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCallbacksIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CallbackEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCallbacksIdEndpoint( ConnectWiseEndpoint, IGettable[CallbackEntry, ConnectWiseManageRequestParams], - IPuttable[CallbackEntry, ConnectWiseManageRequestParams], IPatchable[CallbackEntry, ConnectWiseManageRequestParams], + IPuttable[CallbackEntry, ConnectWiseManageRequestParams], IPaginateable[CallbackEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CallbackEntry) - IPuttable.__init__(self, CallbackEntry) IPatchable.__init__(self, CallbackEntry) + IPuttable.__init__(self, CallbackEntry) IPaginateable.__init__(self, CallbackEntry) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CallbackEntry]: """ Performs a GET request against the /system/callbacks/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CallbackEntry, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CallbackEntry, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CallbackEntry: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/callbacks/{id} endpoint. + Performs a DELETE request against the /system/callbacks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CallbackEntry: The parsed response data. """ - return self._parse_one( - CallbackEntry, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CallbackEntry: """ - Performs a DELETE request against the /system/callbacks/{id} endpoint. + Performs a GET request against the /system/callbacks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CallbackEntry: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CallbackEntry, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CallbackEntry: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CallbackEntry: """ - Performs a PUT request against the /system/callbacks/{id} endpoint. + Performs a PATCH request against the /system/callbacks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: CallbackEntry: The parsed response data. """ - return self._parse_one( - CallbackEntry, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CallbackEntry, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CallbackEntry: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CallbackEntry: """ - Performs a PATCH request against the /system/callbacks/{id} endpoint. + Performs a PUT request against the /system/callbacks/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: CallbackEntry: The parsed response data. """ - return self._parse_one( - CallbackEntry, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CallbackEntry, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCertificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCertificationsCountEndpoint.py index 3c53f721e..e28dd1602 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCertificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCertificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCertificationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemCertificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/certifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/certifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCertificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCertificationsEndpoint.py index 7b960c458..2a95d30d2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCertificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCertificationsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemCertificationsCountEndpoint import ( - SystemCertificationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemCertificationsIdEndpoint import ( - SystemCertificationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemCertificationsCountEndpoint import SystemCertificationsCountEndpoint +from pyconnectwise.endpoints.manage.SystemCertificationsIdEndpoint import SystemCertificationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Certification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCertificationsEndpoint( @@ -24,36 +18,29 @@ class SystemCertificationsEndpoint( IPostable[Certification, ConnectWiseManageRequestParams], IPaginateable[Certification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "certifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "certifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Certification]) IPostable.__init__(self, Certification) IPaginateable.__init__(self, Certification) - self.count = self._register_child_endpoint( - SystemCertificationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemCertificationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemCertificationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemCertificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemCertificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemCertificationsIdEndpoint: The initialized SystemCertificationsIdEndpoint object. """ child = SystemCertificationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Certification]: """ Performs a GET request against the /system/certifications endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Certification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Certification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[Certification]: """ Performs a GET request against the /system/certifications endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[Certification]: The parsed response data. """ - return self._parse_many( - Certification, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Certification, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Certification: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Certification: """ Performs a POST request against the /system/certifications endpoint. @@ -111,7 +85,4 @@ def post( Returns: Certification: The parsed response data. """ - return self._parse_one( - Certification, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(Certification, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCertificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCertificationsIdEndpoint.py index 6d272533d..6070fd997 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCertificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCertificationsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemCertificationsIdUsagesEndpoint import ( - SystemCertificationsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemCertificationsIdUsagesEndpoint import SystemCertificationsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Certification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCertificationsIdEndpoint( ConnectWiseEndpoint, IGettable[Certification, ConnectWiseManageRequestParams], - IPuttable[Certification, ConnectWiseManageRequestParams], IPatchable[Certification, ConnectWiseManageRequestParams], + IPuttable[Certification, ConnectWiseManageRequestParams], IPaginateable[Certification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Certification) - IPuttable.__init__(self, Certification) IPatchable.__init__(self, Certification) + IPuttable.__init__(self, Certification) IPaginateable.__init__(self, Certification) - self.usages = self._register_child_endpoint( - SystemCertificationsIdUsagesEndpoint(client, parent_endpoint=self) - ) + self.usages = self._register_child_endpoint(SystemCertificationsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Certification]: """ Performs a GET request against the /system/certifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Certification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Certification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Certification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/certifications/{id} endpoint. + Performs a DELETE request against the /system/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Certification: The parsed response data. """ - return self._parse_one( - Certification, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Certification: """ - Performs a DELETE request against the /system/certifications/{id} endpoint. + Performs a GET request against the /system/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Certification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Certification, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Certification: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Certification: """ - Performs a PUT request against the /system/certifications/{id} endpoint. + Performs a PATCH request against the /system/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: Certification: The parsed response data. """ - return self._parse_one( - Certification, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Certification, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Certification: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Certification: """ - Performs a PATCH request against the /system/certifications/{id} endpoint. + Performs a PUT request against the /system/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +93,4 @@ def patch( Returns: Certification: The parsed response data. """ - return self._parse_one( - Certification, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(Certification, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesEndpoint.py index 009cdbcab..b9f63dd21 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemCertificationsIdUsagesListEndpoint import ( SystemCertificationsIdUsagesListEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCertificationsIdUsagesEndpoint( @@ -19,10 +18,8 @@ class SystemCertificationsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/certifications/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/certifications/{id}/usages endpoint. @@ -74,6 +57,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesListEndpoint.py index 605fd94c9..451b248b4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCertificationsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCertificationsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SystemCertificationsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/certifications/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/certifications/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensCountEndpoint.py index 3ae8bd57f..4a84e208a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemConnectwisehostedscreensCountEndpoint( @@ -16,18 +15,13 @@ class SystemConnectwisehostedscreensCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/connectWiseHostedScreens/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/connectWiseHostedScreens/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensEndpoint.py index ceb5c22cb..bfc514b76 100644 --- a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemConnectwisehostedscreensCountEndpoint import ( SystemConnectwisehostedscreensCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.SystemConnectwisehostedscreensIdEndpoint import ( SystemConnectwisehostedscreensIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConnectWiseHostedScreen from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemConnectwisehostedscreensEndpoint( @@ -22,10 +21,8 @@ class SystemConnectwisehostedscreensEndpoint( IGettable[list[ConnectWiseHostedScreen], ConnectWiseManageRequestParams], IPaginateable[ConnectWiseHostedScreen, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "connectWiseHostedScreens", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "connectWiseHostedScreens", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConnectWiseHostedScreen]) IPaginateable.__init__(self, ConnectWiseHostedScreen) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemConnectwisehostedscreensCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemConnectwisehostedscreensIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemConnectwisehostedscreensIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemConnectwisehostedscreensIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemConnectwisehostedscreensIdEndpoint: The initialized SystemConnectwisehostedscreensIdEndpoint object. """ - child = SystemConnectwisehostedscreensIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemConnectwisehostedscreensIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConnectWiseHostedScreen]: """ Performs a GET request against the /system/connectWiseHostedScreens endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConnectWiseHostedScreen, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConnectWiseHostedScreen, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConnectWiseHostedScreen]: """ Performs a GET request against the /system/connectWiseHostedScreens endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[ConnectWiseHostedScreen]: The parsed response data. """ - return self._parse_many( - ConnectWiseHostedScreen, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConnectWiseHostedScreen, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensIdEndpoint.py index 8326cf8a9..3a00d7e49 100644 --- a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedscreensIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ConnectWiseHostedScreen from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemConnectwisehostedscreensIdEndpoint( @@ -16,18 +15,13 @@ class SystemConnectwisehostedscreensIdEndpoint( IGettable[ConnectWiseHostedScreen, ConnectWiseManageRequestParams], IPaginateable[ConnectWiseHostedScreen, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConnectWiseHostedScreen) IPaginateable.__init__(self, ConnectWiseHostedScreen) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConnectWiseHostedScreen]: """ Performs a GET request against the /system/connectWiseHostedScreens/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConnectWiseHostedScreen, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConnectWiseHostedScreen, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConnectWiseHostedScreen: """ Performs a GET request against the /system/connectWiseHostedScreens/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: ConnectWiseHostedScreen: The parsed response data. """ - return self._parse_one( - ConnectWiseHostedScreen, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ConnectWiseHostedScreen, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsCountEndpoint.py index 6b4410863..ca496b932 100644 --- a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemConnectwisehostedsetupsCountEndpoint( @@ -16,18 +15,13 @@ class SystemConnectwisehostedsetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/connectwisehostedsetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/connectwisehostedsetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsEndpoint.py index 21142b05d..ae6205d82 100644 --- a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemConnectwisehostedsetupsCountEndpoint import ( SystemConnectwisehostedsetupsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemConnectwisehostedsetupsIdEndpoint import ( SystemConnectwisehostedsetupsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ConnectWiseHostedSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemConnectwisehostedsetupsEndpoint( @@ -24,10 +22,8 @@ class SystemConnectwisehostedsetupsEndpoint( IPostable[ConnectWiseHostedSetup, ConnectWiseManageRequestParams], IPaginateable[ConnectWiseHostedSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "connectwisehostedsetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "connectwisehostedsetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ConnectWiseHostedSetup]) IPostable.__init__(self, ConnectWiseHostedSetup) IPaginateable.__init__(self, ConnectWiseHostedSetup) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemConnectwisehostedsetupsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemConnectwisehostedsetupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemConnectwisehostedsetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemConnectwisehostedsetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemConnectwisehostedsetupsIdEndpoint: The initialized SystemConnectwisehostedsetupsIdEndpoint object. """ - child = SystemConnectwisehostedsetupsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemConnectwisehostedsetupsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConnectWiseHostedSetup]: """ Performs a GET request against the /system/connectwisehostedsetups endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConnectWiseHostedSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConnectWiseHostedSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ConnectWiseHostedSetup]: """ Performs a GET request against the /system/connectwisehostedsetups endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[ConnectWiseHostedSetup]: The parsed response data. """ - return self._parse_many( - ConnectWiseHostedSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ConnectWiseHostedSetup, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConnectWiseHostedSetup: """ Performs a POST request against the /system/connectwisehostedsetups endpoint. @@ -114,7 +93,4 @@ def post( Returns: ConnectWiseHostedSetup: The parsed response data. """ - return self._parse_one( - ConnectWiseHostedSetup, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ConnectWiseHostedSetup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsIdEndpoint.py index 312050132..04a4c63fc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemConnectwisehostedsetupsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ConnectWiseHostedSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemConnectwisehostedsetupsIdEndpoint( ConnectWiseEndpoint, IGettable[ConnectWiseHostedSetup, ConnectWiseManageRequestParams], - IPuttable[ConnectWiseHostedSetup, ConnectWiseManageRequestParams], IPatchable[ConnectWiseHostedSetup, ConnectWiseManageRequestParams], + IPuttable[ConnectWiseHostedSetup, ConnectWiseManageRequestParams], IPaginateable[ConnectWiseHostedSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ConnectWiseHostedSetup) - IPuttable.__init__(self, ConnectWiseHostedSetup) IPatchable.__init__(self, ConnectWiseHostedSetup) + IPuttable.__init__(self, ConnectWiseHostedSetup) IPaginateable.__init__(self, ConnectWiseHostedSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ConnectWiseHostedSetup]: """ Performs a GET request against the /system/connectwisehostedsetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ConnectWiseHostedSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ConnectWiseHostedSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ConnectWiseHostedSetup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/connectwisehostedsetups/{id} endpoint. + Performs a DELETE request against the /system/connectwisehostedsetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ConnectWiseHostedSetup: The parsed response data. """ - return self._parse_one( - ConnectWiseHostedSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ConnectWiseHostedSetup: """ - Performs a DELETE request against the /system/connectwisehostedsetups/{id} endpoint. + Performs a GET request against the /system/connectwisehostedsetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ConnectWiseHostedSetup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ConnectWiseHostedSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ConnectWiseHostedSetup: """ - Performs a PUT request against the /system/connectwisehostedsetups/{id} endpoint. + Performs a PATCH request against the /system/connectwisehostedsetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: ConnectWiseHostedSetup: The parsed response data. """ - return self._parse_one( - ConnectWiseHostedSetup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ConnectWiseHostedSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ConnectWiseHostedSetup: """ - Performs a PATCH request against the /system/connectwisehostedsetups/{id} endpoint. + Performs a PUT request against the /system/connectwisehostedsetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: ConnectWiseHostedSetup: The parsed response data. """ - return self._parse_one( - ConnectWiseHostedSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ConnectWiseHostedSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemContactsyncEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemContactsyncEndpoint.py index 05f82fbfb..8f71a63cf 100644 --- a/src/pyconnectwise/endpoints/manage/SystemContactsyncEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemContactsyncEndpoint.py @@ -6,9 +6,7 @@ class SystemContactsyncEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "contactsync", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "contactsync", parent_endpoint=parent_endpoint) self.monitoring = self._register_child_endpoint( SystemContactsyncMonitoringEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringCountEndpoint.py index 1ac75df11..990c80bf5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringCountEndpoint.py @@ -17,9 +17,7 @@ class SystemContactsyncMonitoringCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringEndpoint.py index 5bbeeca49..4c490268f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringEndpoint.py @@ -29,23 +29,17 @@ class SystemContactsyncMonitoringEndpoint( IPaginateable[M365ContactSyncMonitoring, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "monitoring", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "monitoring", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[M365ContactSyncMonitoring]) IPaginateable.__init__(self, M365ContactSyncMonitoring) self.notificationtype = self._register_child_endpoint( - SystemContactsyncMonitoringNotificationtypeEndpoint( - client, parent_endpoint=self - ) + SystemContactsyncMonitoringNotificationtypeEndpoint(client, parent_endpoint=self) ) self.count = self._register_child_endpoint( SystemContactsyncMonitoringCountEndpoint(client, parent_endpoint=self) ) - self.type = self._register_child_endpoint( - SystemContactsyncMonitoringTypeEndpoint(client, parent_endpoint=self) - ) + self.type = self._register_child_endpoint(SystemContactsyncMonitoringTypeEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> SystemContactsyncMonitoringIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringIdEndpoint.py index d82350204..b64c80445 100644 --- a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringIdEndpoint.py @@ -17,9 +17,7 @@ class SystemContactsyncMonitoringIdEndpoint( IPaginateable[M365ContactSyncMonitoring, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, M365ContactSyncMonitoring) IPaginateable.__init__(self, M365ContactSyncMonitoring) diff --git a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringNotificationtypeEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringNotificationtypeEndpoint.py index 25a23b0ab..c951c9e24 100644 --- a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringNotificationtypeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringNotificationtypeEndpoint.py @@ -3,6 +3,4 @@ class SystemContactsyncMonitoringNotificationtypeEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notificationtype", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "notificationtype", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeEndpoint.py index a9e6c7368..402e958a9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeEndpoint.py @@ -6,9 +6,7 @@ class SystemContactsyncMonitoringTypeEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "type", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "type", parent_endpoint=parent_endpoint) def id(self, id: int) -> SystemContactsyncMonitoringTypeIdEndpoint: # noqa: A002 """ @@ -19,8 +17,6 @@ def id(self, id: int) -> SystemContactsyncMonitoringTypeIdEndpoint: # noqa: A00 Returns: SystemContactsyncMonitoringTypeIdEndpoint: The initialized SystemContactsyncMonitoringTypeIdEndpoint object. """ - child = SystemContactsyncMonitoringTypeIdEndpoint( - self.client, parent_endpoint=self - ) + child = SystemContactsyncMonitoringTypeIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeIdEndpoint.py index ad21a1e6c..2f5e0592c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemContactsyncMonitoringTypeIdEndpoint.py @@ -17,9 +17,7 @@ class SystemContactsyncMonitoringTypeIdEndpoint( IPaginateable[M365ContactSyncMonitoring, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, M365ContactSyncMonitoring) IPaginateable.__init__(self, M365ContactSyncMonitoring) diff --git a/src/pyconnectwise/endpoints/manage/SystemCustomreportsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCustomreportsCountEndpoint.py index 427b69e5e..8e60dc75e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCustomreportsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCustomreportsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCustomreportsCountEndpoint( @@ -16,18 +15,13 @@ class SystemCustomreportsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/customReports/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/customReports/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCustomreportsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCustomreportsEndpoint.py index 267cf4aa3..7c6f0cd10 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCustomreportsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCustomreportsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemCustomreportsCountEndpoint import ( - SystemCustomreportsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemCustomreportsIdEndpoint import ( - SystemCustomreportsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemCustomreportsCountEndpoint import SystemCustomreportsCountEndpoint +from pyconnectwise.endpoints.manage.SystemCustomreportsIdEndpoint import SystemCustomreportsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CustomReport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCustomreportsEndpoint( @@ -24,36 +18,29 @@ class SystemCustomreportsEndpoint( IPostable[CustomReport, ConnectWiseManageRequestParams], IPaginateable[CustomReport, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "customReports", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "customReports", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CustomReport]) IPostable.__init__(self, CustomReport) IPaginateable.__init__(self, CustomReport) - self.count = self._register_child_endpoint( - SystemCustomreportsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemCustomreportsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemCustomreportsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemCustomreportsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemCustomreportsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemCustomreportsIdEndpoint: The initialized SystemCustomreportsIdEndpoint object. """ child = SystemCustomreportsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CustomReport]: """ Performs a GET request against the /system/customReports endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CustomReport, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CustomReport, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CustomReport]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CustomReport]: """ Performs a GET request against the /system/customReports endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[CustomReport]: The parsed response data. """ - return self._parse_many( - CustomReport, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CustomReport, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CustomReport: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CustomReport: """ Performs a POST request against the /system/customReports endpoint. @@ -111,6 +83,4 @@ def post( Returns: CustomReport: The parsed response data. """ - return self._parse_one( - CustomReport, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(CustomReport, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdEndpoint.py index de12adcba..8cc7936e2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemCustomreportsIdParametersEndpoint import ( SystemCustomreportsIdParametersEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CustomReport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCustomreportsIdEndpoint( ConnectWiseEndpoint, IGettable[CustomReport, ConnectWiseManageRequestParams], - IPuttable[CustomReport, ConnectWiseManageRequestParams], IPatchable[CustomReport, ConnectWiseManageRequestParams], + IPuttable[CustomReport, ConnectWiseManageRequestParams], IPaginateable[CustomReport, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CustomReport) - IPuttable.__init__(self, CustomReport) IPatchable.__init__(self, CustomReport) + IPuttable.__init__(self, CustomReport) IPaginateable.__init__(self, CustomReport) self.parameters = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CustomReport]: """ Performs a GET request against the /system/customReports/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CustomReport, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CustomReport, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CustomReport: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/customReports/{id} endpoint. + Performs a DELETE request against the /system/customReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CustomReport: The parsed response data. """ - return self._parse_one( - CustomReport, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CustomReport: """ - Performs a DELETE request against the /system/customReports/{id} endpoint. + Performs a GET request against the /system/customReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CustomReport: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CustomReport, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CustomReport: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CustomReport: """ - Performs a PUT request against the /system/customReports/{id} endpoint. + Performs a PATCH request against the /system/customReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +85,11 @@ def put( Returns: CustomReport: The parsed response data. """ - return self._parse_one( - CustomReport, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(CustomReport, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CustomReport: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CustomReport: """ - Performs a PATCH request against the /system/customReports/{id} endpoint. + Performs a PUT request against the /system/customReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,7 +97,4 @@ def patch( Returns: CustomReport: The parsed response data. """ - return self._parse_one( - CustomReport, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CustomReport, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersCountEndpoint.py index 91f0fac27..9e1c1e410 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCustomreportsIdParametersCountEndpoint( @@ -16,18 +15,13 @@ class SystemCustomreportsIdParametersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/customReports/{id}/parameters/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/customReports/{id}/parameters/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersEndpoint.py index 4b46132c3..6fbeee7aa 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemCustomreportsIdParametersCountEndpoint import ( SystemCustomreportsIdParametersCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemCustomreportsIdParametersIdEndpoint import ( SystemCustomreportsIdParametersIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import CustomReportParameter from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCustomreportsIdParametersEndpoint( @@ -24,10 +22,8 @@ class SystemCustomreportsIdParametersEndpoint( IPostable[CustomReportParameter, ConnectWiseManageRequestParams], IPaginateable[CustomReportParameter, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "parameters", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "parameters", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CustomReportParameter]) IPostable.__init__(self, CustomReportParameter) IPaginateable.__init__(self, CustomReportParameter) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemCustomreportsIdParametersCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemCustomreportsIdParametersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemCustomreportsIdParametersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemCustomreportsIdParametersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemCustomreportsIdParametersIdEndpoint: The initialized SystemCustomreportsIdParametersIdEndpoint object. """ - child = SystemCustomreportsIdParametersIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemCustomreportsIdParametersIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CustomReportParameter]: """ Performs a GET request against the /system/customReports/{id}/parameters endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CustomReportParameter, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CustomReportParameter, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CustomReportParameter]: """ Performs a GET request against the /system/customReports/{id}/parameters endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[CustomReportParameter]: The parsed response data. """ - return self._parse_many( - CustomReportParameter, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CustomReportParameter, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CustomReportParameter: """ Performs a POST request against the /system/customReports/{id}/parameters endpoint. @@ -114,7 +93,4 @@ def post( Returns: CustomReportParameter: The parsed response data. """ - return self._parse_one( - CustomReportParameter, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(CustomReportParameter, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersIdEndpoint.py index 0eb29c2cc..2777b3530 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCustomreportsIdParametersIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CustomReportParameter from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCustomreportsIdParametersIdEndpoint( ConnectWiseEndpoint, IGettable[CustomReportParameter, ConnectWiseManageRequestParams], - IPuttable[CustomReportParameter, ConnectWiseManageRequestParams], IPatchable[CustomReportParameter, ConnectWiseManageRequestParams], + IPuttable[CustomReportParameter, ConnectWiseManageRequestParams], IPaginateable[CustomReportParameter, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CustomReportParameter) - IPuttable.__init__(self, CustomReportParameter) IPatchable.__init__(self, CustomReportParameter) + IPuttable.__init__(self, CustomReportParameter) IPaginateable.__init__(self, CustomReportParameter) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CustomReportParameter]: """ Performs a GET request against the /system/customReports/{id}/parameters/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CustomReportParameter, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CustomReportParameter, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CustomReportParameter: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/customReports/{id}/parameters/{id} endpoint. + Performs a DELETE request against the /system/customReports/{id}/parameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - CustomReportParameter: The parsed response data. """ - return self._parse_one( - CustomReportParameter, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> CustomReportParameter: """ - Performs a DELETE request against the /system/customReports/{id}/parameters/{id} endpoint. + Performs a GET request against the /system/customReports/{id}/parameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + CustomReportParameter: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(CustomReportParameter, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> CustomReportParameter: """ - Performs a PUT request against the /system/customReports/{id}/parameters/{id} endpoint. + Performs a PATCH request against the /system/customReports/{id}/parameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: CustomReportParameter: The parsed response data. """ - return self._parse_one( - CustomReportParameter, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CustomReportParameter, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CustomReportParameter: """ - Performs a PATCH request against the /system/customReports/{id}/parameters/{id} endpoint. + Performs a PUT request against the /system/customReports/{id}/parameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: CustomReportParameter: The parsed response data. """ - return self._parse_one( - CustomReportParameter, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CustomReportParameter, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCwtimezonesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCwtimezonesCountEndpoint.py index cb031aa0c..4bc432072 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCwtimezonesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCwtimezonesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCwtimezonesCountEndpoint( @@ -16,18 +15,13 @@ class SystemCwtimezonesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/cwTimeZones/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/cwTimeZones/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCwtimezonesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCwtimezonesEndpoint.py index 6f2c76187..58ed4e072 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCwtimezonesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCwtimezonesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemCwtimezonesCountEndpoint import ( - SystemCwtimezonesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemCwtimezonesIdEndpoint import ( - SystemCwtimezonesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemCwtimezonesCountEndpoint import SystemCwtimezonesCountEndpoint +from pyconnectwise.endpoints.manage.SystemCwtimezonesIdEndpoint import SystemCwtimezonesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CwTimeZone from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCwtimezonesEndpoint( @@ -22,35 +17,28 @@ class SystemCwtimezonesEndpoint( IGettable[list[CwTimeZone], ConnectWiseManageRequestParams], IPaginateable[CwTimeZone, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "cwTimeZones", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "cwTimeZones", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CwTimeZone]) IPaginateable.__init__(self, CwTimeZone) - self.count = self._register_child_endpoint( - SystemCwtimezonesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemCwtimezonesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemCwtimezonesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemCwtimezonesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemCwtimezonesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemCwtimezonesIdEndpoint: The initialized SystemCwtimezonesIdEndpoint object. """ child = SystemCwtimezonesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CwTimeZone]: """ Performs a GET request against the /system/cwTimeZones endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - CwTimeZone, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), CwTimeZone, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CwTimeZone]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CwTimeZone]: """ Performs a GET request against the /system/cwTimeZones endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[CwTimeZone]: The parsed response data. """ - return self._parse_many( - CwTimeZone, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CwTimeZone, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemCwtimezonesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemCwtimezonesIdEndpoint.py index ffce8b412..8f2ba7096 100644 --- a/src/pyconnectwise/endpoints/manage/SystemCwtimezonesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemCwtimezonesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CwTimeZone from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemCwtimezonesIdEndpoint( @@ -16,18 +15,13 @@ class SystemCwtimezonesIdEndpoint( IGettable[CwTimeZone, ConnectWiseManageRequestParams], IPaginateable[CwTimeZone, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CwTimeZone) IPaginateable.__init__(self, CwTimeZone) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CwTimeZone]: """ Performs a GET request against the /system/cwTimeZones/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - CwTimeZone, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), CwTimeZone, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CwTimeZone: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CwTimeZone: """ Performs a GET request against the /system/cwTimeZones/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: CwTimeZone: The parsed response data. """ - return self._parse_one( - CwTimeZone, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CwTimeZone, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsCountEndpoint.py index ea026e3d2..b2b4c2755 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsCountEndpoint( @@ -16,18 +15,13 @@ class SystemDepartmentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/departments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/departments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsEndpoint.py index 3c0d41139..42a9602d3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemDepartmentsCountEndpoint import ( - SystemDepartmentsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDepartmentsIdEndpoint import ( - SystemDepartmentsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemDepartmentsCountEndpoint import SystemDepartmentsCountEndpoint +from pyconnectwise.endpoints.manage.SystemDepartmentsIdEndpoint import SystemDepartmentsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Department from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsEndpoint( @@ -24,36 +18,29 @@ class SystemDepartmentsEndpoint( IPostable[Department, ConnectWiseManageRequestParams], IPaginateable[Department, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "departments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "departments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Department]) IPostable.__init__(self, Department) IPaginateable.__init__(self, Department) - self.count = self._register_child_endpoint( - SystemDepartmentsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemDepartmentsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemDepartmentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemDepartmentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemDepartmentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemDepartmentsIdEndpoint: The initialized SystemDepartmentsIdEndpoint object. """ child = SystemDepartmentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Department]: """ Performs a GET request against the /system/departments endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Department, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Department, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Department]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Department]: """ Performs a GET request against the /system/departments endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Department]: The parsed response data. """ - return self._parse_many( - Department, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Department, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Department: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Department: """ Performs a POST request against the /system/departments endpoint. @@ -111,6 +81,4 @@ def post( Returns: Department: The parsed response data. """ - return self._parse_one( - Department, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Department, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdEndpoint.py index cf8c7047c..cb6bc7b0e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdEndpoint.py @@ -1,53 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemDepartmentsIdLocationsEndpoint import ( - SystemDepartmentsIdLocationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDepartmentsIdUsagesEndpoint import ( - SystemDepartmentsIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemDepartmentsIdLocationsEndpoint import SystemDepartmentsIdLocationsEndpoint +from pyconnectwise.endpoints.manage.SystemDepartmentsIdUsagesEndpoint import SystemDepartmentsIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Department from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsIdEndpoint( ConnectWiseEndpoint, IGettable[Department, ConnectWiseManageRequestParams], - IPuttable[Department, ConnectWiseManageRequestParams], IPatchable[Department, ConnectWiseManageRequestParams], + IPuttable[Department, ConnectWiseManageRequestParams], IPaginateable[Department, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Department) - IPuttable.__init__(self, Department) IPatchable.__init__(self, Department) + IPuttable.__init__(self, Department) IPaginateable.__init__(self, Department) - self.usages = self._register_child_endpoint( - SystemDepartmentsIdUsagesEndpoint(client, parent_endpoint=self) - ) self.locations = self._register_child_endpoint( SystemDepartmentsIdLocationsEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint(SystemDepartmentsIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Department]: """ Performs a GET request against the /system/departments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +49,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Department, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Department, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Department: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/departments/{id} endpoint. + Performs a DELETE request against the /system/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Department: The parsed response data. """ - return self._parse_one( - Department, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Department: """ - Performs a DELETE request against the /system/departments/{id} endpoint. + Performs a GET request against the /system/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Department: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Department, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Department: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Department: """ - Performs a PUT request against the /system/departments/{id} endpoint. + Performs a PATCH request against the /system/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +83,11 @@ def put( Returns: Department: The parsed response data. """ - return self._parse_one( - Department, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Department, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Department: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Department: """ - Performs a PATCH request against the /system/departments/{id} endpoint. + Performs a PUT request against the /system/departments/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +95,4 @@ def patch( Returns: Department: The parsed response data. """ - return self._parse_one( - Department, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Department, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsCountEndpoint.py index 885895586..80b291dd0 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsIdLocationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemDepartmentsIdLocationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/departments/{id}/locations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/departments/{id}/locations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsEndpoint.py index e9d0ae957..3a067838f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemDepartmentsIdLocationsCountEndpoint import ( SystemDepartmentsIdLocationsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemDepartmentsIdLocationsIdEndpoint import ( - SystemDepartmentsIdLocationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemDepartmentsIdLocationsIdEndpoint import SystemDepartmentsIdLocationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import DepartmentLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsIdLocationsEndpoint( @@ -24,10 +20,8 @@ class SystemDepartmentsIdLocationsEndpoint( IPostable[DepartmentLocation, ConnectWiseManageRequestParams], IPaginateable[DepartmentLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "locations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "locations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DepartmentLocation]) IPostable.__init__(self, DepartmentLocation) IPaginateable.__init__(self, DepartmentLocation) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemDepartmentsIdLocationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemDepartmentsIdLocationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemDepartmentsIdLocationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemDepartmentsIdLocationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemDepartmentsIdLocationsIdEndpoint: The initialized SystemDepartmentsIdLocationsIdEndpoint object. """ - child = SystemDepartmentsIdLocationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemDepartmentsIdLocationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DepartmentLocation]: """ Performs a GET request against the /system/departments/{id}/locations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DepartmentLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DepartmentLocation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[DepartmentLocation]: """ Performs a GET request against the /system/departments/{id}/locations endpoint. @@ -95,15 +77,10 @@ def get( Returns: list[DepartmentLocation]: The parsed response data. """ - return self._parse_many( - DepartmentLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(DepartmentLocation, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> DepartmentLocation: """ Performs a POST request against the /system/departments/{id}/locations endpoint. @@ -114,7 +91,4 @@ def post( Returns: DepartmentLocation: The parsed response data. """ - return self._parse_one( - DepartmentLocation, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(DepartmentLocation, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsIdEndpoint.py index f9cb431e6..d025ca9f9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdLocationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import DepartmentLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsIdLocationsIdEndpoint( ConnectWiseEndpoint, IGettable[DepartmentLocation, ConnectWiseManageRequestParams], - IPuttable[DepartmentLocation, ConnectWiseManageRequestParams], IPatchable[DepartmentLocation, ConnectWiseManageRequestParams], + IPuttable[DepartmentLocation, ConnectWiseManageRequestParams], IPaginateable[DepartmentLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, DepartmentLocation) - IPuttable.__init__(self, DepartmentLocation) IPatchable.__init__(self, DepartmentLocation) + IPuttable.__init__(self, DepartmentLocation) IPaginateable.__init__(self, DepartmentLocation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DepartmentLocation]: """ Performs a GET request against the /system/departments/{id}/locations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DepartmentLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DepartmentLocation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DepartmentLocation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/departments/{id}/locations/{id} endpoint. + Performs a DELETE request against the /system/departments/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - DepartmentLocation: The parsed response data. """ - return self._parse_one( - DepartmentLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DepartmentLocation: """ - Performs a DELETE request against the /system/departments/{id}/locations/{id} endpoint. + Performs a GET request against the /system/departments/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + DepartmentLocation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(DepartmentLocation, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DepartmentLocation: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> DepartmentLocation: """ - Performs a PUT request against the /system/departments/{id}/locations/{id} endpoint. + Performs a PATCH request against the /system/departments/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: DepartmentLocation: The parsed response data. """ - return self._parse_one( - DepartmentLocation, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(DepartmentLocation, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> DepartmentLocation: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DepartmentLocation: """ - Performs a PATCH request against the /system/departments/{id}/locations/{id} endpoint. + Performs a PUT request against the /system/departments/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: DepartmentLocation: The parsed response data. """ - return self._parse_one( - DepartmentLocation, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(DepartmentLocation, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesEndpoint.py index 00b6c276f..c8a7892e6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemDepartmentsIdUsagesListEndpoint import ( - SystemDepartmentsIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemDepartmentsIdUsagesListEndpoint import SystemDepartmentsIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsIdUsagesEndpoint( @@ -19,22 +16,15 @@ class SystemDepartmentsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - SystemDepartmentsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(SystemDepartmentsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/departments/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/departments/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesListEndpoint.py index 5158db9e9..c61c8f524 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDepartmentsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDepartmentsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SystemDepartmentsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/departments/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/departments/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsEndpoint.py index bd1dc1f7f..c8a16b8b0 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsEndpoint.py @@ -9,13 +9,9 @@ class SystemDirectionalsyncsEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "directionalSyncs", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "directionalSyncs", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - SystemDirectionalsyncsInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemDirectionalsyncsInfoEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> SystemDirectionalsyncsIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdEndpoint.py index 427d61d42..a4ade140d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdEndpoint.py @@ -6,10 +6,6 @@ class SystemDirectionalsyncsIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - SystemDirectionalsyncsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemDirectionalsyncsIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdInfoEndpoint.py index 7e2e6e05e..2f19f90ab 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsIdInfoEndpoint.py @@ -17,9 +17,7 @@ class SystemDirectionalsyncsIdInfoEndpoint( IPaginateable[DirectionalSyncInfo, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, DirectionalSyncInfo) IPaginateable.__init__(self, DirectionalSyncInfo) diff --git a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoCountEndpoint.py index 4a19f5eaf..a860f3fd5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoCountEndpoint.py @@ -17,9 +17,7 @@ class SystemDirectionalsyncsInfoCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoEndpoint.py index 70b33bdc4..65876c0ef 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDirectionalsyncsInfoEndpoint.py @@ -20,9 +20,7 @@ class SystemDirectionalsyncsInfoEndpoint( IPaginateable[DirectionalSyncInfo, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DirectionalSyncInfo]) IPaginateable.__init__(self, DirectionalSyncInfo) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumentsCountEndpoint.py index 74889f8fb..2d307ee33 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDocumentsCountEndpoint( @@ -16,18 +15,13 @@ class SystemDocumentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/documents/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/documents/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumentsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumentsEndpoint.py index d99141822..34530b88e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumentsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemDocumentsCountEndpoint import ( - SystemDocumentsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDocumentsIdEndpoint import ( - SystemDocumentsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDocumentsUploadsampleEndpoint import ( - SystemDocumentsUploadsampleEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemDocumentsCountEndpoint import SystemDocumentsCountEndpoint +from pyconnectwise.endpoints.manage.SystemDocumentsIdEndpoint import SystemDocumentsIdEndpoint +from pyconnectwise.endpoints.manage.SystemDocumentsUploadsampleEndpoint import SystemDocumentsUploadsampleEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import DocumentInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDocumentsEndpoint( @@ -27,39 +19,32 @@ class SystemDocumentsEndpoint( IPostable[DocumentInfo, ConnectWiseManageRequestParams], IPaginateable[DocumentInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "documents", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "documents", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DocumentInfo]) IPostable.__init__(self, DocumentInfo) IPaginateable.__init__(self, DocumentInfo) - self.count = self._register_child_endpoint( - SystemDocumentsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemDocumentsCountEndpoint(client, parent_endpoint=self)) self.uploadsample = self._register_child_endpoint( SystemDocumentsUploadsampleEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemDocumentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemDocumentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemDocumentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemDocumentsIdEndpoint: The initialized SystemDocumentsIdEndpoint object. """ child = SystemDocumentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DocumentInfo]: """ Performs a GET request against the /system/documents endpoint and returns an initialized PaginatedResponse object. @@ -77,19 +62,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DocumentInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DocumentInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[DocumentInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[DocumentInfo]: """ Performs a GET request against the /system/documents endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[DocumentInfo]: The parsed response data. """ - return self._parse_many( - DocumentInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(DocumentInfo, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DocumentInfo: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DocumentInfo: """ Performs a POST request against the /system/documents endpoint. @@ -117,6 +87,4 @@ def post( Returns: DocumentInfo: The parsed response data. """ - return self._parse_one( - DocumentInfo, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(DocumentInfo, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumentsIdDownloadEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumentsIdDownloadEndpoint.py index 07116efe1..76a20774b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumentsIdDownloadEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumentsIdDownloadEndpoint.py @@ -1,8 +1,11 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemDocumentsIdDownloadEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "download", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "download", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumentsIdEndpoint.py index 7e77d4226..933bb0f8d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumentsIdEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemDocumentsIdDownloadEndpoint import ( - SystemDocumentsIdDownloadEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDocumentsIdThumbnailEndpoint import ( - SystemDocumentsIdThumbnailEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemDocumentsIdDownloadEndpoint import SystemDocumentsIdDownloadEndpoint +from pyconnectwise.endpoints.manage.SystemDocumentsIdThumbnailEndpoint import SystemDocumentsIdThumbnailEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import DocumentInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDocumentsIdEndpoint( @@ -24,26 +18,17 @@ class SystemDocumentsIdEndpoint( IPostable[DocumentInfo, ConnectWiseManageRequestParams], IPaginateable[DocumentInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, DocumentInfo) IPostable.__init__(self, DocumentInfo) IPaginateable.__init__(self, DocumentInfo) - self.download = self._register_child_endpoint( - SystemDocumentsIdDownloadEndpoint(client, parent_endpoint=self) - ) - self.thumbnail = self._register_child_endpoint( - SystemDocumentsIdThumbnailEndpoint(client, parent_endpoint=self) - ) + self.download = self._register_child_endpoint(SystemDocumentsIdDownloadEndpoint(client, parent_endpoint=self)) + self.thumbnail = self._register_child_endpoint(SystemDocumentsIdThumbnailEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DocumentInfo]: """ Performs a GET request against the /system/documents/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,51 +46,32 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DocumentInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DocumentInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DocumentInfo: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/documents/{id} endpoint. + Performs a DELETE request against the /system/documents/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - DocumentInfo: The parsed response data. """ - return self._parse_one( - DocumentInfo, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DocumentInfo: """ - Performs a DELETE request against the /system/documents/{id} endpoint. + Performs a GET request against the /system/documents/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + DocumentInfo: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(DocumentInfo, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DocumentInfo: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DocumentInfo: """ Performs a POST request against the /system/documents/{id} endpoint. @@ -115,6 +81,4 @@ def post( Returns: DocumentInfo: The parsed response data. """ - return self._parse_one( - DocumentInfo, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(DocumentInfo, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumentsIdThumbnailEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumentsIdThumbnailEndpoint.py index c7e7bea33..2f029fbdd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumentsIdThumbnailEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumentsIdThumbnailEndpoint.py @@ -1,8 +1,11 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemDocumentsIdThumbnailEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "thumbnail", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "thumbnail", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumentsUploadsampleEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumentsUploadsampleEndpoint.py index 8e08852e2..72d7bfe62 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumentsUploadsampleEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumentsUploadsampleEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemDocumentsUploadsampleEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "uploadsample", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "uploadsample", parent_endpoint=parent_endpoint) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a GET request against the /system/documents/uploadsample endpoint. diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesEndpoint.py index 9ac1cb380..c9ef045cc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesEndpoint.py @@ -9,13 +9,9 @@ class SystemDocumenttypesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "documentTypes", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "documentTypes", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - SystemDocumenttypesInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemDocumenttypesInfoEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> SystemDocumenttypesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdEndpoint.py index fa211eafa..a09b92a3f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdEndpoint.py @@ -6,10 +6,6 @@ class SystemDocumenttypesIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - SystemDocumenttypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemDocumenttypesIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdInfoEndpoint.py index f7c6e027c..53640e36b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesIdInfoEndpoint.py @@ -17,9 +17,7 @@ class SystemDocumenttypesIdInfoEndpoint( IPaginateable[DocumentType, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, DocumentType) IPaginateable.__init__(self, DocumentType) @@ -67,6 +65,4 @@ def get( Returns: DocumentType: The parsed response data. """ - return self._parse_one( - DocumentType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(DocumentType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoCountEndpoint.py index 01eb2b729..ff3fdd1a4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoCountEndpoint.py @@ -17,9 +17,7 @@ class SystemDocumenttypesInfoCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoEndpoint.py index f6d325996..8128c9ea1 100644 --- a/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemDocumenttypesInfoEndpoint.py @@ -20,15 +20,11 @@ class SystemDocumenttypesInfoEndpoint( IPaginateable[DocumentType, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DocumentType]) IPaginateable.__init__(self, DocumentType) - self.count = self._register_child_endpoint( - SystemDocumenttypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemDocumenttypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( self, @@ -74,6 +70,4 @@ def get( Returns: list[DocumentType]: The parsed response data. """ - return self._parse_many( - DocumentType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(DocumentType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsCountEndpoint.py index 904ea192d..7be7be14b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsCountEndpoint( @@ -16,18 +15,13 @@ class SystemEmailconnectorsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/emailConnectors/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/emailConnectors/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsEndpoint.py index eb5dea13e..65dfb290a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemEmailconnectorsCountEndpoint import ( - SystemEmailconnectorsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdEndpoint import ( - SystemEmailconnectorsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEmailconnectorsInfoEndpoint import ( - SystemEmailconnectorsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemEmailconnectorsCountEndpoint import SystemEmailconnectorsCountEndpoint +from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdEndpoint import SystemEmailconnectorsIdEndpoint +from pyconnectwise.endpoints.manage.SystemEmailconnectorsInfoEndpoint import SystemEmailconnectorsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import EmailConnector from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsEndpoint( @@ -27,39 +19,30 @@ class SystemEmailconnectorsEndpoint( IPostable[EmailConnector, ConnectWiseManageRequestParams], IPaginateable[EmailConnector, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailConnectors", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailConnectors", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EmailConnector]) IPostable.__init__(self, EmailConnector) IPaginateable.__init__(self, EmailConnector) - self.count = self._register_child_endpoint( - SystemEmailconnectorsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemEmailconnectorsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemEmailconnectorsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemEmailconnectorsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemEmailconnectorsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemEmailconnectorsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemEmailconnectorsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemEmailconnectorsIdEndpoint: The initialized SystemEmailconnectorsIdEndpoint object. """ child = SystemEmailconnectorsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnector]: """ Performs a GET request against the /system/emailConnectors endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnector, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnector, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[EmailConnector]: """ Performs a GET request against the /system/emailConnectors endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[EmailConnector]: The parsed response data. """ - return self._parse_many( - EmailConnector, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(EmailConnector, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailConnector: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailConnector: """ Performs a POST request against the /system/emailConnectors endpoint. @@ -118,7 +87,4 @@ def post( Returns: EmailConnector: The parsed response data. """ - return self._parse_one( - EmailConnector, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(EmailConnector, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdEndpoint.py index 9ec7b000b..32bba54a9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdEndpoint.py @@ -1,53 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdInfoEndpoint import ( - SystemEmailconnectorsIdInfoEndpoint, -) +from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdInfoEndpoint import SystemEmailconnectorsIdInfoEndpoint from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdParsingstylesEndpoint import ( SystemEmailconnectorsIdParsingstylesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import EmailConnector from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdEndpoint( ConnectWiseEndpoint, IGettable[EmailConnector, ConnectWiseManageRequestParams], - IPuttable[EmailConnector, ConnectWiseManageRequestParams], IPatchable[EmailConnector, ConnectWiseManageRequestParams], + IPuttable[EmailConnector, ConnectWiseManageRequestParams], IPaginateable[EmailConnector, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, EmailConnector) - IPuttable.__init__(self, EmailConnector) IPatchable.__init__(self, EmailConnector) + IPuttable.__init__(self, EmailConnector) IPaginateable.__init__(self, EmailConnector) - self.info = self._register_child_endpoint( - SystemEmailconnectorsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemEmailconnectorsIdInfoEndpoint(client, parent_endpoint=self)) self.parsing_styles = self._register_child_endpoint( SystemEmailconnectorsIdParsingstylesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnector]: """ Performs a GET request against the /system/emailConnectors/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,54 +52,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnector, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnector, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailConnector: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/emailConnectors/{id} endpoint. + Performs a DELETE request against the /system/emailConnectors/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - EmailConnector: The parsed response data. """ - return self._parse_one( - EmailConnector, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailConnector: """ - Performs a DELETE request against the /system/emailConnectors/{id} endpoint. + Performs a GET request against the /system/emailConnectors/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + EmailConnector: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(EmailConnector, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailConnector: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> EmailConnector: """ - Performs a PUT request against the /system/emailConnectors/{id} endpoint. + Performs a PATCH request against the /system/emailConnectors/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -120,18 +87,11 @@ def put( Returns: EmailConnector: The parsed response data. """ - return self._parse_one( - EmailConnector, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(EmailConnector, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailConnector: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailConnector: """ - Performs a PATCH request against the /system/emailConnectors/{id} endpoint. + Performs a PUT request against the /system/emailConnectors/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -139,7 +99,4 @@ def patch( Returns: EmailConnector: The parsed response data. """ - return self._parse_one( - EmailConnector, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(EmailConnector, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdInfoEndpoint.py index 42d537386..115ef63f8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import EmailConnectorInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemEmailconnectorsIdInfoEndpoint( IGettable[EmailConnectorInfo, ConnectWiseManageRequestParams], IPaginateable[EmailConnectorInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, EmailConnectorInfo) IPaginateable.__init__(self, EmailConnectorInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnectorInfo]: """ Performs a GET request against the /system/emailConnectors/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnectorInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnectorInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailConnectorInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailConnectorInfo: """ Performs a GET request against the /system/emailConnectors/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: EmailConnectorInfo: The parsed response data. """ - return self._parse_one( - EmailConnectorInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(EmailConnectorInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesCountEndpoint.py index 1f2775b3a..f94459b8a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdParsingstylesCountEndpoint( @@ -16,18 +15,13 @@ class SystemEmailconnectorsIdParsingstylesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesEndpoint.py index acaf9a9a6..2ea464ce5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdParsingstylesCountEndpoint import ( SystemEmailconnectorsIdParsingstylesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdParsingstylesIdEndpoint import ( SystemEmailconnectorsIdParsingstylesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import EmailConnectorParsingStyle from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdParsingstylesEndpoint( @@ -24,42 +22,31 @@ class SystemEmailconnectorsIdParsingstylesEndpoint( IPostable[EmailConnectorParsingStyle, ConnectWiseManageRequestParams], IPaginateable[EmailConnectorParsingStyle, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "parsingStyles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "parsingStyles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EmailConnectorParsingStyle]) IPostable.__init__(self, EmailConnectorParsingStyle) IPaginateable.__init__(self, EmailConnectorParsingStyle) self.count = self._register_child_endpoint( - SystemEmailconnectorsIdParsingstylesCountEndpoint( - client, parent_endpoint=self - ) + SystemEmailconnectorsIdParsingstylesCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> SystemEmailconnectorsIdParsingstylesIdEndpoint: + def id(self, _id: int) -> SystemEmailconnectorsIdParsingstylesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemEmailconnectorsIdParsingstylesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemEmailconnectorsIdParsingstylesIdEndpoint: The initialized SystemEmailconnectorsIdParsingstylesIdEndpoint object. """ - child = SystemEmailconnectorsIdParsingstylesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemEmailconnectorsIdParsingstylesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnectorParsingStyle]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnectorParsingStyle, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnectorParsingStyle, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[EmailConnectorParsingStyle]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles endpoint. @@ -100,14 +80,11 @@ def get( list[EmailConnectorParsingStyle]: The parsed response data. """ return self._parse_many( - EmailConnectorParsingStyle, - super()._make_request("GET", data=data, params=params).json(), + EmailConnectorParsingStyle, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> EmailConnectorParsingStyle: """ Performs a POST request against the /system/emailConnectors/{id}/parsingStyles endpoint. @@ -119,6 +96,5 @@ def post( EmailConnectorParsingStyle: The parsed response data. """ return self._parse_one( - EmailConnectorParsingStyle, - super()._make_request("POST", data=data, params=params).json(), + EmailConnectorParsingStyle, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdEndpoint.py index f7d03f16f..3e2dc2d3e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint import ( SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import EmailConnectorParsingStyle from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdParsingstylesIdEndpoint( ConnectWiseEndpoint, IGettable[EmailConnectorParsingStyle, ConnectWiseManageRequestParams], - IPuttable[EmailConnectorParsingStyle, ConnectWiseManageRequestParams], IPatchable[EmailConnectorParsingStyle, ConnectWiseManageRequestParams], + IPuttable[EmailConnectorParsingStyle, ConnectWiseManageRequestParams], IPaginateable[EmailConnectorParsingStyle, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, EmailConnectorParsingStyle) - IPuttable.__init__(self, EmailConnectorParsingStyle) IPatchable.__init__(self, EmailConnectorParsingStyle) + IPuttable.__init__(self, EmailConnectorParsingStyle) IPaginateable.__init__(self, EmailConnectorParsingStyle) self.parsing_rules = self._register_child_endpoint( - SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint( - client, parent_endpoint=self - ) + SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnectorParsingStyle]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnectorParsingStyle, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnectorParsingStyle, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailConnectorParsingStyle: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. + Performs a DELETE request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - EmailConnectorParsingStyle: The parsed response data. """ - return self._parse_one( - EmailConnectorParsingStyle, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> EmailConnectorParsingStyle: """ - Performs a DELETE request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. + Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + EmailConnectorParsingStyle: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + EmailConnectorParsingStyle, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> EmailConnectorParsingStyle: """ - Performs a PUT request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. + Performs a PATCH request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -117,17 +92,14 @@ def put( EmailConnectorParsingStyle: The parsed response data. """ return self._parse_one( - EmailConnectorParsingStyle, - super()._make_request("PUT", data=data, params=params).json(), + EmailConnectorParsingStyle, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> EmailConnectorParsingStyle: """ - Performs a PATCH request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. + Performs a PUT request against the /system/emailConnectors/{id}/parsingStyles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -136,6 +108,5 @@ def patch( EmailConnectorParsingStyle: The parsed response data. """ return self._parse_one( - EmailConnectorParsingStyle, - super()._make_request("PATCH", data=data, params=params).json(), + EmailConnectorParsingStyle, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint.py index d38734e63..64b7774ed 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint( @@ -16,18 +15,13 @@ class SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint.py index 0f955ea0d..03ec5a771 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint import ( SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint import ( SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import EmailConnectorParsingRule from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint( @@ -24,42 +22,31 @@ class SystemEmailconnectorsIdParsingstylesIdParsingrulesEndpoint( IPostable[EmailConnectorParsingRule, ConnectWiseManageRequestParams], IPaginateable[EmailConnectorParsingRule, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "parsingRules", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "parsingRules", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EmailConnectorParsingRule]) IPostable.__init__(self, EmailConnectorParsingRule) IPaginateable.__init__(self, EmailConnectorParsingRule) self.count = self._register_child_endpoint( - SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint( - client, parent_endpoint=self - ) + SystemEmailconnectorsIdParsingstylesIdParsingrulesCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint: + def id(self, _id: int) -> SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint: The initialized SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint object. """ - child = SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnectorParsingRule]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnectorParsingRule, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnectorParsingRule, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[EmailConnectorParsingRule]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules endpoint. @@ -100,14 +80,11 @@ def get( list[EmailConnectorParsingRule]: The parsed response data. """ return self._parse_many( - EmailConnectorParsingRule, - super()._make_request("GET", data=data, params=params).json(), + EmailConnectorParsingRule, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> EmailConnectorParsingRule: """ Performs a POST request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules endpoint. @@ -119,6 +96,5 @@ def post( EmailConnectorParsingRule: The parsed response data. """ return self._parse_one( - EmailConnectorParsingRule, - super()._make_request("POST", data=data, params=params).json(), + EmailConnectorParsingRule, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint.py index 9138932cf..62bc16d13 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import EmailConnectorParsingRule from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsIdParsingstylesIdParsingrulesIdEndpoint( ConnectWiseEndpoint, IGettable[EmailConnectorParsingRule, ConnectWiseManageRequestParams], - IPuttable[EmailConnectorParsingRule, ConnectWiseManageRequestParams], IPatchable[EmailConnectorParsingRule, ConnectWiseManageRequestParams], + IPuttable[EmailConnectorParsingRule, ConnectWiseManageRequestParams], IPaginateable[EmailConnectorParsingRule, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, EmailConnectorParsingRule) - IPuttable.__init__(self, EmailConnectorParsingRule) IPatchable.__init__(self, EmailConnectorParsingRule) + IPuttable.__init__(self, EmailConnectorParsingRule) IPaginateable.__init__(self, EmailConnectorParsingRule) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnectorParsingRule]: """ Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnectorParsingRule, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnectorParsingRule, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailConnectorParsingRule: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. + Performs a DELETE request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - EmailConnectorParsingRule: The parsed response data. """ - return self._parse_one( - EmailConnectorParsingRule, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> EmailConnectorParsingRule: """ - Performs a DELETE request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. + Performs a GET request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + EmailConnectorParsingRule: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(EmailConnectorParsingRule, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> EmailConnectorParsingRule: """ - Performs a PUT request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. + Performs a PATCH request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +83,14 @@ def put( EmailConnectorParsingRule: The parsed response data. """ return self._parse_one( - EmailConnectorParsingRule, - super()._make_request("PUT", data=data, params=params).json(), + EmailConnectorParsingRule, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> EmailConnectorParsingRule: """ - Performs a PATCH request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. + Performs a PUT request against the /system/emailConnectors/{id}/parsingStyles/{id}/parsingRules/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +98,4 @@ def patch( Returns: EmailConnectorParsingRule: The parsed response data. """ - return self._parse_one( - EmailConnectorParsingRule, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(EmailConnectorParsingRule, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoCountEndpoint.py index 0daf6d9a7..9f2c81590 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemEmailconnectorsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/emailConnectors/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/emailConnectors/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoEndpoint.py index 2bfef2738..3481770e2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailconnectorsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemEmailconnectorsInfoCountEndpoint import ( - SystemEmailconnectorsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemEmailconnectorsInfoCountEndpoint import SystemEmailconnectorsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import EmailConnectorInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailconnectorsInfoEndpoint( @@ -19,22 +16,15 @@ class SystemEmailconnectorsInfoEndpoint( IGettable[list[EmailConnectorInfo], ConnectWiseManageRequestParams], IPaginateable[EmailConnectorInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EmailConnectorInfo]) IPaginateable.__init__(self, EmailConnectorInfo) - self.count = self._register_child_endpoint( - SystemEmailconnectorsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemEmailconnectorsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailConnectorInfo]: """ Performs a GET request against the /system/emailConnectors/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailConnectorInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailConnectorInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[EmailConnectorInfo]: """ Performs a GET request against the /system/emailConnectors/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[EmailConnectorInfo]: The parsed response data. """ - return self._parse_many( - EmailConnectorInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(EmailConnectorInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsCountEndpoint.py index 69fc185df..d080c68b1 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailexclusionsCountEndpoint( @@ -16,18 +15,13 @@ class SystemEmailexclusionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/emailExclusions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/emailExclusions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsEndpoint.py index ecd72a717..a7f9f5043 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemEmailexclusionsCountEndpoint import ( - SystemEmailexclusionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEmailexclusionsIdEndpoint import ( - SystemEmailexclusionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemEmailexclusionsCountEndpoint import SystemEmailexclusionsCountEndpoint +from pyconnectwise.endpoints.manage.SystemEmailexclusionsIdEndpoint import SystemEmailexclusionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import EmailExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailexclusionsEndpoint( @@ -24,36 +18,29 @@ class SystemEmailexclusionsEndpoint( IPostable[EmailExclusion, ConnectWiseManageRequestParams], IPaginateable[EmailExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailExclusions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailExclusions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EmailExclusion]) IPostable.__init__(self, EmailExclusion) IPaginateable.__init__(self, EmailExclusion) - self.count = self._register_child_endpoint( - SystemEmailexclusionsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemEmailexclusionsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemEmailexclusionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemEmailexclusionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemEmailexclusionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemEmailexclusionsIdEndpoint: The initialized SystemEmailexclusionsIdEndpoint object. """ child = SystemEmailexclusionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailExclusion]: """ Performs a GET request against the /system/emailExclusions endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailExclusion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[EmailExclusion]: """ Performs a GET request against the /system/emailExclusions endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[EmailExclusion]: The parsed response data. """ - return self._parse_many( - EmailExclusion, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(EmailExclusion, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailExclusion: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailExclusion: """ Performs a POST request against the /system/emailExclusions endpoint. @@ -112,7 +85,4 @@ def post( Returns: EmailExclusion: The parsed response data. """ - return self._parse_one( - EmailExclusion, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(EmailExclusion, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsIdEndpoint.py index bacadabad..e8c0e704b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailexclusionsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import EmailExclusion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailexclusionsIdEndpoint( ConnectWiseEndpoint, IGettable[EmailExclusion, ConnectWiseManageRequestParams], - IPuttable[EmailExclusion, ConnectWiseManageRequestParams], IPatchable[EmailExclusion, ConnectWiseManageRequestParams], + IPuttable[EmailExclusion, ConnectWiseManageRequestParams], IPaginateable[EmailExclusion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, EmailExclusion) - IPuttable.__init__(self, EmailExclusion) IPatchable.__init__(self, EmailExclusion) + IPuttable.__init__(self, EmailExclusion) IPaginateable.__init__(self, EmailExclusion) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailExclusion]: """ Performs a GET request against the /system/emailExclusions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EmailExclusion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EmailExclusion, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailExclusion: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/emailExclusions/{id} endpoint. + Performs a DELETE request against the /system/emailExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - EmailExclusion: The parsed response data. """ - return self._parse_one( - EmailExclusion, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailExclusion: """ - Performs a DELETE request against the /system/emailExclusions/{id} endpoint. + Performs a GET request against the /system/emailExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + EmailExclusion: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(EmailExclusion, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailExclusion: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> EmailExclusion: """ - Performs a PUT request against the /system/emailExclusions/{id} endpoint. + Performs a PATCH request against the /system/emailExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: EmailExclusion: The parsed response data. """ - return self._parse_one( - EmailExclusion, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(EmailExclusion, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailExclusion: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailExclusion: """ - Performs a PATCH request against the /system/emailExclusions/{id} endpoint. + Performs a PUT request against the /system/emailExclusions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: EmailExclusion: The parsed response data. """ - return self._parse_one( - EmailExclusion, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(EmailExclusion, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailtokensCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailtokensCountEndpoint.py index d127bfa1c..35f7d9e20 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailtokensCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailtokensCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailtokensCountEndpoint( @@ -16,18 +15,13 @@ class SystemEmailtokensCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/emailTokens/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/emailTokens/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailtokensEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailtokensEndpoint.py index 3d949e040..96c1ef2b3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailtokensEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailtokensEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemEmailtokensCountEndpoint import ( - SystemEmailtokensCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEmailtokensIdEndpoint import ( - SystemEmailtokensIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemEmailtokensCountEndpoint import SystemEmailtokensCountEndpoint +from pyconnectwise.endpoints.manage.SystemEmailtokensIdEndpoint import SystemEmailtokensIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import EmailToken from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailtokensEndpoint( @@ -22,35 +17,28 @@ class SystemEmailtokensEndpoint( IGettable[list[EmailToken], ConnectWiseManageRequestParams], IPaginateable[EmailToken, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailTokens", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailTokens", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EmailToken]) IPaginateable.__init__(self, EmailToken) - self.count = self._register_child_endpoint( - SystemEmailtokensCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemEmailtokensCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemEmailtokensIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemEmailtokensIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemEmailtokensIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemEmailtokensIdEndpoint: The initialized SystemEmailtokensIdEndpoint object. """ child = SystemEmailtokensIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailToken]: """ Performs a GET request against the /system/emailTokens endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - EmailToken, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), EmailToken, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[EmailToken]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[EmailToken]: """ Performs a GET request against the /system/emailTokens endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[EmailToken]: The parsed response data. """ - return self._parse_many( - EmailToken, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(EmailToken, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEmailtokensIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEmailtokensIdEndpoint.py index 767e20b3f..325277b2d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEmailtokensIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEmailtokensIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import EmailToken from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEmailtokensIdEndpoint( @@ -16,18 +15,13 @@ class SystemEmailtokensIdEndpoint( IGettable[EmailToken, ConnectWiseManageRequestParams], IPaginateable[EmailToken, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, EmailToken) IPaginateable.__init__(self, EmailToken) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EmailToken]: """ Performs a GET request against the /system/emailTokens/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - EmailToken, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), EmailToken, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EmailToken: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EmailToken: """ Performs a GET request against the /system/emailTokens/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: EmailToken: The parsed response data. """ - return self._parse_one( - EmailToken, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(EmailToken, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEndpoint.py index d80103918..22b2250d5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEndpoint.py @@ -1,425 +1,194 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemAllowedfiletypesEndpoint import ( - SystemAllowedfiletypesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAllowedoriginsEndpoint import ( - SystemAllowedoriginsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemApimembersEndpoint import ( - SystemApimembersEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAudittrailEndpoint import ( - SystemAudittrailEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAuthanvilsEndpoint import ( - SystemAuthanvilsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemAutosynctimeEndpoint import ( - SystemAutosynctimeEndpoint, -) +from pyconnectwise.endpoints.manage.SystemAllowedfiletypesEndpoint import SystemAllowedfiletypesEndpoint +from pyconnectwise.endpoints.manage.SystemAllowedoriginsEndpoint import SystemAllowedoriginsEndpoint +from pyconnectwise.endpoints.manage.SystemApimembersEndpoint import SystemApimembersEndpoint +from pyconnectwise.endpoints.manage.SystemAudittrailEndpoint import SystemAudittrailEndpoint +from pyconnectwise.endpoints.manage.SystemAuthanvilsEndpoint import SystemAuthanvilsEndpoint +from pyconnectwise.endpoints.manage.SystemAutosynctimeEndpoint import SystemAutosynctimeEndpoint from pyconnectwise.endpoints.manage.SystemBundlesEndpoint import SystemBundlesEndpoint -from pyconnectwise.endpoints.manage.SystemCallbacksEndpoint import ( - SystemCallbacksEndpoint, -) -from pyconnectwise.endpoints.manage.SystemCertificationsEndpoint import ( - SystemCertificationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemConnectwisehostedscreensEndpoint import ( - SystemConnectwisehostedscreensEndpoint, -) -from pyconnectwise.endpoints.manage.SystemConnectwisehostedsetupsEndpoint import ( - SystemConnectwisehostedsetupsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemContactsyncEndpoint import ( - SystemContactsyncEndpoint, -) -from pyconnectwise.endpoints.manage.SystemCustomreportsEndpoint import ( - SystemCustomreportsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemCwtimezonesEndpoint import ( - SystemCwtimezonesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDepartmentsEndpoint import ( - SystemDepartmentsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDirectionalsyncsEndpoint import ( - SystemDirectionalsyncsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDocumentsEndpoint import ( - SystemDocumentsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemDocumenttypesEndpoint import ( - SystemDocumenttypesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEmailconnectorsEndpoint import ( - SystemEmailconnectorsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEmailexclusionsEndpoint import ( - SystemEmailexclusionsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEmailtokensEndpoint import ( - SystemEmailtokensEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEpayconfigurationsEndpoint import ( - SystemEpayconfigurationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemExperimentsEndpoint import ( - SystemExperimentsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemFileuploadsettingsEndpoint import ( - SystemFileuploadsettingsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemGoogleemailsetupEndpoint import ( - SystemGoogleemailsetupEndpoint, -) +from pyconnectwise.endpoints.manage.SystemCallbacksEndpoint import SystemCallbacksEndpoint +from pyconnectwise.endpoints.manage.SystemCertificationsEndpoint import SystemCertificationsEndpoint +from pyconnectwise.endpoints.manage.SystemConnectwisehostedscreensEndpoint import SystemConnectwisehostedscreensEndpoint +from pyconnectwise.endpoints.manage.SystemConnectwisehostedsetupsEndpoint import SystemConnectwisehostedsetupsEndpoint +from pyconnectwise.endpoints.manage.SystemCustomreportsEndpoint import SystemCustomreportsEndpoint +from pyconnectwise.endpoints.manage.SystemCwtimezonesEndpoint import SystemCwtimezonesEndpoint +from pyconnectwise.endpoints.manage.SystemDepartmentsEndpoint import SystemDepartmentsEndpoint +from pyconnectwise.endpoints.manage.SystemDocumentsEndpoint import SystemDocumentsEndpoint +from pyconnectwise.endpoints.manage.SystemEmailconnectorsEndpoint import SystemEmailconnectorsEndpoint +from pyconnectwise.endpoints.manage.SystemEmailexclusionsEndpoint import SystemEmailexclusionsEndpoint +from pyconnectwise.endpoints.manage.SystemEmailtokensEndpoint import SystemEmailtokensEndpoint +from pyconnectwise.endpoints.manage.SystemEpayconfigurationsEndpoint import SystemEpayconfigurationsEndpoint +from pyconnectwise.endpoints.manage.SystemExperimentsEndpoint import SystemExperimentsEndpoint +from pyconnectwise.endpoints.manage.SystemFileuploadsettingsEndpoint import SystemFileuploadsettingsEndpoint +from pyconnectwise.endpoints.manage.SystemGoogleemailsetupEndpoint import SystemGoogleemailsetupEndpoint from pyconnectwise.endpoints.manage.SystemImapsEndpoint import SystemImapsEndpoint -from pyconnectwise.endpoints.manage.SystemImportmassmaintenanceEndpoint import ( - SystemImportmassmaintenanceEndpoint, -) +from pyconnectwise.endpoints.manage.SystemImportmassmaintenanceEndpoint import SystemImportmassmaintenanceEndpoint from pyconnectwise.endpoints.manage.SystemInfoEndpoint import SystemInfoEndpoint -from pyconnectwise.endpoints.manage.SystemInoutboardsEndpoint import ( - SystemInoutboardsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInouttypesEndpoint import ( - SystemInouttypesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemIntegratorloginsEndpoint import ( - SystemIntegratorloginsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemIntegratortagsEndpoint import ( - SystemIntegratortagsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemKpicategoriesEndpoint import ( - SystemKpicategoriesEndpoint, -) +from pyconnectwise.endpoints.manage.SystemInoutboardsEndpoint import SystemInoutboardsEndpoint +from pyconnectwise.endpoints.manage.SystemInouttypesEndpoint import SystemInouttypesEndpoint +from pyconnectwise.endpoints.manage.SystemIntegratorloginsEndpoint import SystemIntegratorloginsEndpoint +from pyconnectwise.endpoints.manage.SystemIntegratortagsEndpoint import SystemIntegratortagsEndpoint +from pyconnectwise.endpoints.manage.SystemKpicategoriesEndpoint import SystemKpicategoriesEndpoint from pyconnectwise.endpoints.manage.SystemKpisEndpoint import SystemKpisEndpoint -from pyconnectwise.endpoints.manage.SystemLdapconfigurationsEndpoint import ( - SystemLdapconfigurationsEndpoint, -) +from pyconnectwise.endpoints.manage.SystemLdapconfigurationsEndpoint import SystemLdapconfigurationsEndpoint from pyconnectwise.endpoints.manage.SystemLinksEndpoint import SystemLinksEndpoint -from pyconnectwise.endpoints.manage.SystemLocationsEndpoint import ( - SystemLocationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemM365contactsyncEndpoint import ( - SystemM365contactsyncEndpoint, -) +from pyconnectwise.endpoints.manage.SystemLocationsEndpoint import SystemLocationsEndpoint from pyconnectwise.endpoints.manage.SystemManagementnetworksecuritiesEndpoint import ( SystemManagementnetworksecuritiesEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMarketplaceimportEndpoint import ( - SystemMarketplaceimportEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMarketplaceimportEndpoint import SystemMarketplaceimportEndpoint from pyconnectwise.endpoints.manage.SystemMembersEndpoint import SystemMembersEndpoint -from pyconnectwise.endpoints.manage.SystemMembertemplatesEndpoint import ( - SystemMembertemplatesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMenuentriesEndpoint import ( - SystemMenuentriesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMyaccountEndpoint import ( - SystemMyaccountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMycompanyEndpoint import ( - SystemMycompanyEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMymembersEndpoint import ( - SystemMymembersEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMysecurityEndpoint import ( - SystemMysecurityEndpoint, -) -from pyconnectwise.endpoints.manage.SystemNotificationrecipientsEndpoint import ( - SystemNotificationrecipientsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemOffice365Endpoint import ( - SystemOffice365Endpoint, -) -from pyconnectwise.endpoints.manage.SystemOnpremisesearchsettingEndpoint import ( - SystemOnpremisesearchsettingEndpoint, -) -from pyconnectwise.endpoints.manage.SystemOsgradeweightsEndpoint import ( - SystemOsgradeweightsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemParsingtypesEndpoint import ( - SystemParsingtypesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemParsingvariablesEndpoint import ( - SystemParsingvariablesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemPortalreportsEndpoint import ( - SystemPortalreportsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemQuotelinksetupEndpoint import ( - SystemQuotelinksetupEndpoint, -) -from pyconnectwise.endpoints.manage.SystemReportcardsEndpoint import ( - SystemReportcardsEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMenuentriesEndpoint import SystemMenuentriesEndpoint +from pyconnectwise.endpoints.manage.SystemMyaccountEndpoint import SystemMyaccountEndpoint +from pyconnectwise.endpoints.manage.SystemMycompanyEndpoint import SystemMycompanyEndpoint +from pyconnectwise.endpoints.manage.SystemMymembersEndpoint import SystemMymembersEndpoint +from pyconnectwise.endpoints.manage.SystemMysecurityEndpoint import SystemMysecurityEndpoint +from pyconnectwise.endpoints.manage.SystemNotificationrecipientsEndpoint import SystemNotificationrecipientsEndpoint +from pyconnectwise.endpoints.manage.SystemOffice365Endpoint import SystemOffice365Endpoint +from pyconnectwise.endpoints.manage.SystemOsgradeweightsEndpoint import SystemOsgradeweightsEndpoint +from pyconnectwise.endpoints.manage.SystemParsingtypesEndpoint import SystemParsingtypesEndpoint +from pyconnectwise.endpoints.manage.SystemParsingvariablesEndpoint import SystemParsingvariablesEndpoint +from pyconnectwise.endpoints.manage.SystemPortalreportsEndpoint import SystemPortalreportsEndpoint +from pyconnectwise.endpoints.manage.SystemQuotelinksetupEndpoint import SystemQuotelinksetupEndpoint +from pyconnectwise.endpoints.manage.SystemReportcardsEndpoint import SystemReportcardsEndpoint from pyconnectwise.endpoints.manage.SystemReportsEndpoint import SystemReportsEndpoint -from pyconnectwise.endpoints.manage.SystemSecurityrolesEndpoint import ( - SystemSecurityrolesEndpoint, -) +from pyconnectwise.endpoints.manage.SystemSecurityrolesEndpoint import SystemSecurityrolesEndpoint from pyconnectwise.endpoints.manage.SystemSettingsEndpoint import SystemSettingsEndpoint -from pyconnectwise.endpoints.manage.SystemSetupscreensEndpoint import ( - SystemSetupscreensEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSkillcategoriesEndpoint import ( - SystemSkillcategoriesEndpoint, -) +from pyconnectwise.endpoints.manage.SystemSetupscreensEndpoint import SystemSetupscreensEndpoint +from pyconnectwise.endpoints.manage.SystemSkillcategoriesEndpoint import SystemSkillcategoriesEndpoint from pyconnectwise.endpoints.manage.SystemSkillsEndpoint import SystemSkillsEndpoint -from pyconnectwise.endpoints.manage.SystemSsoconfigurationsEndpoint import ( - SystemSsoconfigurationsEndpoint, -) +from pyconnectwise.endpoints.manage.SystemSsoconfigurationsEndpoint import SystemSsoconfigurationsEndpoint from pyconnectwise.endpoints.manage.SystemSsousersEndpoint import SystemSsousersEndpoint -from pyconnectwise.endpoints.manage.SystemStandardnotesEndpoint import ( - SystemStandardnotesEndpoint, -) +from pyconnectwise.endpoints.manage.SystemStandardnotesEndpoint import SystemStandardnotesEndpoint from pyconnectwise.endpoints.manage.SystemSurveysEndpoint import SystemSurveysEndpoint -from pyconnectwise.endpoints.manage.SystemTimezonesetupsEndpoint import ( - SystemTimezonesetupsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemTodaypagecategoriesEndpoint import ( - SystemTodaypagecategoriesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsEndpoint import ( - SystemUserdefinedfieldsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowactionsEndpoint import ( - SystemWorkflowactionsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsEndpoint import ( - SystemWorkflowsEndpoint, -) +from pyconnectwise.endpoints.manage.SystemTimezonesetupsEndpoint import SystemTimezonesetupsEndpoint +from pyconnectwise.endpoints.manage.SystemTodaypagecategoriesEndpoint import SystemTodaypagecategoriesEndpoint +from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsEndpoint import SystemUserdefinedfieldsEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowactionsEndpoint import SystemWorkflowactionsEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsEndpoint import SystemWorkflowsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "system", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "system", parent_endpoint=parent_endpoint) - self.osgradeweights = self._register_child_endpoint( - SystemOsgradeweightsEndpoint(client, parent_endpoint=self) - ) - self.report_cards = self._register_child_endpoint( - SystemReportcardsEndpoint(client, parent_endpoint=self) - ) - self.management_network_securities = self._register_child_endpoint( - SystemManagementnetworksecuritiesEndpoint(client, parent_endpoint=self) - ) - self.menu_entries = self._register_child_endpoint( - SystemMenuentriesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemInfoEndpoint(client, parent_endpoint=self) - ) - self.security_roles = self._register_child_endpoint( - SystemSecurityrolesEndpoint(client, parent_endpoint=self) - ) - self.custom_reports = self._register_child_endpoint( - SystemCustomreportsEndpoint(client, parent_endpoint=self) - ) - self.contactsync = self._register_child_endpoint( - SystemContactsyncEndpoint(client, parent_endpoint=self) - ) - self.callbacks = self._register_child_endpoint( - SystemCallbacksEndpoint(client, parent_endpoint=self) + self.allowed_file_types = self._register_child_endpoint( + SystemAllowedfiletypesEndpoint(client, parent_endpoint=self) ) - self.locations = self._register_child_endpoint( - SystemLocationsEndpoint(client, parent_endpoint=self) + self.allowedfiletypes = self._register_child_endpoint( + SystemAllowedfiletypesEndpoint(client, parent_endpoint=self) ) - self.skill_categories = self._register_child_endpoint( - SystemSkillcategoriesEndpoint(client, parent_endpoint=self) + self.allowedorigins = self._register_child_endpoint(SystemAllowedoriginsEndpoint(client, parent_endpoint=self)) + self.api_members = self._register_child_endpoint(SystemApimembersEndpoint(client, parent_endpoint=self)) + self.audittrail = self._register_child_endpoint(SystemAudittrailEndpoint(client, parent_endpoint=self)) + self.auth_anvils = self._register_child_endpoint(SystemAuthanvilsEndpoint(client, parent_endpoint=self)) + self.auto_sync_time = self._register_child_endpoint(SystemAutosynctimeEndpoint(client, parent_endpoint=self)) + self.bundles = self._register_child_endpoint(SystemBundlesEndpoint(client, parent_endpoint=self)) + self.callbacks = self._register_child_endpoint(SystemCallbacksEndpoint(client, parent_endpoint=self)) + self.certifications = self._register_child_endpoint(SystemCertificationsEndpoint(client, parent_endpoint=self)) + self.connect_wise_hosted_screens = self._register_child_endpoint( + SystemConnectwisehostedscreensEndpoint(client, parent_endpoint=self) ) self.connectwisehostedsetups = self._register_child_endpoint( SystemConnectwisehostedsetupsEndpoint(client, parent_endpoint=self) ) - self.my_members = self._register_child_endpoint( - SystemMymembersEndpoint(client, parent_endpoint=self) - ) - self.settings = self._register_child_endpoint( - SystemSettingsEndpoint(client, parent_endpoint=self) - ) - self.setup_screens = self._register_child_endpoint( - SystemSetupscreensEndpoint(client, parent_endpoint=self) - ) - self.reports = self._register_child_endpoint( - SystemReportsEndpoint(client, parent_endpoint=self) - ) - self.members = self._register_child_endpoint( - SystemMembersEndpoint(client, parent_endpoint=self) - ) - self.sso_users = self._register_child_endpoint( - SystemSsousersEndpoint(client, parent_endpoint=self) - ) - self.auto_sync_time = self._register_child_endpoint( - SystemAutosynctimeEndpoint(client, parent_endpoint=self) - ) - self.documents = self._register_child_endpoint( - SystemDocumentsEndpoint(client, parent_endpoint=self) - ) - self.directional_syncs = self._register_child_endpoint( - SystemDirectionalsyncsEndpoint(client, parent_endpoint=self) - ) - self.standard_notes = self._register_child_endpoint( - SystemStandardnotesEndpoint(client, parent_endpoint=self) - ) - self.m365contactsync = self._register_child_endpoint( - SystemM365contactsyncEndpoint(client, parent_endpoint=self) - ) - self.membertemplates = self._register_child_endpoint( - SystemMembertemplatesEndpoint(client, parent_endpoint=self) - ) - self.links = self._register_child_endpoint( - SystemLinksEndpoint(client, parent_endpoint=self) - ) - self.workflow_actions = self._register_child_endpoint( - SystemWorkflowactionsEndpoint(client, parent_endpoint=self) - ) - self.email_connectors = self._register_child_endpoint( - SystemEmailconnectorsEndpoint(client, parent_endpoint=self) - ) - self.my_company = self._register_child_endpoint( - SystemMycompanyEndpoint(client, parent_endpoint=self) - ) + self.custom_reports = self._register_child_endpoint(SystemCustomreportsEndpoint(client, parent_endpoint=self)) + self.cw_time_zones = self._register_child_endpoint(SystemCwtimezonesEndpoint(client, parent_endpoint=self)) + self.departments = self._register_child_endpoint(SystemDepartmentsEndpoint(client, parent_endpoint=self)) + self.documents = self._register_child_endpoint(SystemDocumentsEndpoint(client, parent_endpoint=self)) self.e_pay_configurations = self._register_child_endpoint( SystemEpayconfigurationsEndpoint(client, parent_endpoint=self) ) - self.document_types = self._register_child_endpoint( - SystemDocumenttypesEndpoint(client, parent_endpoint=self) - ) - self.fileuploadsettings = self._register_child_endpoint( - SystemFileuploadsettingsEndpoint(client, parent_endpoint=self) - ) - self.office365 = self._register_child_endpoint( - SystemOffice365Endpoint(client, parent_endpoint=self) - ) - self.bundles = self._register_child_endpoint( - SystemBundlesEndpoint(client, parent_endpoint=self) - ) - self.departments = self._register_child_endpoint( - SystemDepartmentsEndpoint(client, parent_endpoint=self) - ) - self.experiments = self._register_child_endpoint( - SystemExperimentsEndpoint(client, parent_endpoint=self) - ) - self.integrator_tags = self._register_child_endpoint( - SystemIntegratortagsEndpoint(client, parent_endpoint=self) - ) - self.surveys = self._register_child_endpoint( - SystemSurveysEndpoint(client, parent_endpoint=self) - ) - self.quote_link_setup = self._register_child_endpoint( - SystemQuotelinksetupEndpoint(client, parent_endpoint=self) - ) - self.time_zone_setups = self._register_child_endpoint( - SystemTimezonesetupsEndpoint(client, parent_endpoint=self) - ) - self.audittrail = self._register_child_endpoint( - SystemAudittrailEndpoint(client, parent_endpoint=self) - ) - self.skills = self._register_child_endpoint( - SystemSkillsEndpoint(client, parent_endpoint=self) - ) - self.in_out_boards = self._register_child_endpoint( - SystemInoutboardsEndpoint(client, parent_endpoint=self) - ) - self.today_page_categories = self._register_child_endpoint( - SystemTodaypagecategoriesEndpoint(client, parent_endpoint=self) - ) - self.portal_reports = self._register_child_endpoint( - SystemPortalreportsEndpoint(client, parent_endpoint=self) - ) - self.sso_configurations = self._register_child_endpoint( - SystemSsoconfigurationsEndpoint(client, parent_endpoint=self) - ) - self.import_mass_maintenance = self._register_child_endpoint( - SystemImportmassmaintenanceEndpoint(client, parent_endpoint=self) - ) - self.menuentries = self._register_child_endpoint( - SystemMenuentriesEndpoint(client, parent_endpoint=self) - ) - self.connect_wise_hosted_screens = self._register_child_endpoint( - SystemConnectwisehostedscreensEndpoint(client, parent_endpoint=self) + self.email_connectors = self._register_child_endpoint( + SystemEmailconnectorsEndpoint(client, parent_endpoint=self) ) self.email_exclusions = self._register_child_endpoint( SystemEmailexclusionsEndpoint(client, parent_endpoint=self) ) - self.user_defined_fields = self._register_child_endpoint( - SystemUserdefinedfieldsEndpoint(client, parent_endpoint=self) - ) - self.cw_time_zones = self._register_child_endpoint( - SystemCwtimezonesEndpoint(client, parent_endpoint=self) - ) - self.allowedfiletypes = self._register_child_endpoint( - SystemAllowedfiletypesEndpoint(client, parent_endpoint=self) - ) - self.ldap_configurations = self._register_child_endpoint( - SystemLdapconfigurationsEndpoint(client, parent_endpoint=self) - ) - self.workflows = self._register_child_endpoint( - SystemWorkflowsEndpoint(client, parent_endpoint=self) - ) - self.auth_anvils = self._register_child_endpoint( - SystemAuthanvilsEndpoint(client, parent_endpoint=self) - ) - self.my_account = self._register_child_endpoint( - SystemMyaccountEndpoint(client, parent_endpoint=self) - ) - self.email_tokens = self._register_child_endpoint( - SystemEmailtokensEndpoint(client, parent_endpoint=self) - ) - self.api_members = self._register_child_endpoint( - SystemApimembersEndpoint(client, parent_endpoint=self) - ) - self.notification_recipients = self._register_child_endpoint( - SystemNotificationrecipientsEndpoint(client, parent_endpoint=self) + self.email_tokens = self._register_child_endpoint(SystemEmailtokensEndpoint(client, parent_endpoint=self)) + self.experiments = self._register_child_endpoint(SystemExperimentsEndpoint(client, parent_endpoint=self)) + self.fileuploadsettings = self._register_child_endpoint( + SystemFileuploadsettingsEndpoint(client, parent_endpoint=self) ) self.googleemailsetup = self._register_child_endpoint( SystemGoogleemailsetupEndpoint(client, parent_endpoint=self) ) - self.in_out_types = self._register_child_endpoint( - SystemInouttypesEndpoint(client, parent_endpoint=self) - ) - self.mycompany = self._register_child_endpoint( - SystemMycompanyEndpoint(client, parent_endpoint=self) + self.imaps = self._register_child_endpoint(SystemImapsEndpoint(client, parent_endpoint=self)) + self.import_mass_maintenance = self._register_child_endpoint( + SystemImportmassmaintenanceEndpoint(client, parent_endpoint=self) ) + self.in_out_boards = self._register_child_endpoint(SystemInoutboardsEndpoint(client, parent_endpoint=self)) + self.in_out_types = self._register_child_endpoint(SystemInouttypesEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemInfoEndpoint(client, parent_endpoint=self)) + self.integrator_tags = self._register_child_endpoint(SystemIntegratortagsEndpoint(client, parent_endpoint=self)) self.integratorlogins = self._register_child_endpoint( SystemIntegratorloginsEndpoint(client, parent_endpoint=self) ) - self.allowed_file_types = self._register_child_endpoint( - SystemAllowedfiletypesEndpoint(client, parent_endpoint=self) + self.kpi_categories = self._register_child_endpoint(SystemKpicategoriesEndpoint(client, parent_endpoint=self)) + self.kpis = self._register_child_endpoint(SystemKpisEndpoint(client, parent_endpoint=self)) + self.ldap_configurations = self._register_child_endpoint( + SystemLdapconfigurationsEndpoint(client, parent_endpoint=self) ) - self.parsing_types = self._register_child_endpoint( - SystemParsingtypesEndpoint(client, parent_endpoint=self) + self.links = self._register_child_endpoint(SystemLinksEndpoint(client, parent_endpoint=self)) + self.locations = self._register_child_endpoint(SystemLocationsEndpoint(client, parent_endpoint=self)) + self.management_network_securities = self._register_child_endpoint( + SystemManagementnetworksecuritiesEndpoint(client, parent_endpoint=self) ) self.marketplaceimport = self._register_child_endpoint( SystemMarketplaceimportEndpoint(client, parent_endpoint=self) ) - self.on_premise_search_setting = self._register_child_endpoint( - SystemOnpremisesearchsettingEndpoint(client, parent_endpoint=self) + self.members = self._register_child_endpoint(SystemMembersEndpoint(client, parent_endpoint=self)) + self.menu_entries = self._register_child_endpoint(SystemMenuentriesEndpoint(client, parent_endpoint=self)) + self.menuentries = self._register_child_endpoint(SystemMenuentriesEndpoint(client, parent_endpoint=self)) + self.my_account = self._register_child_endpoint(SystemMyaccountEndpoint(client, parent_endpoint=self)) + self.my_company = self._register_child_endpoint(SystemMycompanyEndpoint(client, parent_endpoint=self)) + self.my_members = self._register_child_endpoint(SystemMymembersEndpoint(client, parent_endpoint=self)) + self.my_security = self._register_child_endpoint(SystemMysecurityEndpoint(client, parent_endpoint=self)) + self.mycompany = self._register_child_endpoint(SystemMycompanyEndpoint(client, parent_endpoint=self)) + self.notification_recipients = self._register_child_endpoint( + SystemNotificationrecipientsEndpoint(client, parent_endpoint=self) ) - self.kpi_categories = self._register_child_endpoint( - SystemKpicategoriesEndpoint(client, parent_endpoint=self) + self.office365 = self._register_child_endpoint(SystemOffice365Endpoint(client, parent_endpoint=self)) + self.osgradeweights = self._register_child_endpoint(SystemOsgradeweightsEndpoint(client, parent_endpoint=self)) + self.parsing_types = self._register_child_endpoint(SystemParsingtypesEndpoint(client, parent_endpoint=self)) + self.parsing_variables = self._register_child_endpoint( + SystemParsingvariablesEndpoint(client, parent_endpoint=self) ) - self.certifications = self._register_child_endpoint( - SystemCertificationsEndpoint(client, parent_endpoint=self) + self.portal_reports = self._register_child_endpoint(SystemPortalreportsEndpoint(client, parent_endpoint=self)) + self.quote_link_setup = self._register_child_endpoint( + SystemQuotelinksetupEndpoint(client, parent_endpoint=self) ) - self.kpis = self._register_child_endpoint( - SystemKpisEndpoint(client, parent_endpoint=self) + self.report_cards = self._register_child_endpoint(SystemReportcardsEndpoint(client, parent_endpoint=self)) + self.reports = self._register_child_endpoint(SystemReportsEndpoint(client, parent_endpoint=self)) + self.security_roles = self._register_child_endpoint(SystemSecurityrolesEndpoint(client, parent_endpoint=self)) + self.securityroles = self._register_child_endpoint(SystemSecurityrolesEndpoint(client, parent_endpoint=self)) + self.settings = self._register_child_endpoint(SystemSettingsEndpoint(client, parent_endpoint=self)) + self.setup_screens = self._register_child_endpoint(SystemSetupscreensEndpoint(client, parent_endpoint=self)) + self.skill_categories = self._register_child_endpoint( + SystemSkillcategoriesEndpoint(client, parent_endpoint=self) ) - self.my_security = self._register_child_endpoint( - SystemMysecurityEndpoint(client, parent_endpoint=self) + self.skills = self._register_child_endpoint(SystemSkillsEndpoint(client, parent_endpoint=self)) + self.sso_configurations = self._register_child_endpoint( + SystemSsoconfigurationsEndpoint(client, parent_endpoint=self) ) - self.securityroles = self._register_child_endpoint( - SystemSecurityrolesEndpoint(client, parent_endpoint=self) + self.sso_users = self._register_child_endpoint(SystemSsousersEndpoint(client, parent_endpoint=self)) + self.standard_notes = self._register_child_endpoint(SystemStandardnotesEndpoint(client, parent_endpoint=self)) + self.surveys = self._register_child_endpoint(SystemSurveysEndpoint(client, parent_endpoint=self)) + self.time_zone_setups = self._register_child_endpoint( + SystemTimezonesetupsEndpoint(client, parent_endpoint=self) ) - self.imaps = self._register_child_endpoint( - SystemImapsEndpoint(client, parent_endpoint=self) + self.today_page_categories = self._register_child_endpoint( + SystemTodaypagecategoriesEndpoint(client, parent_endpoint=self) ) - self.parsing_variables = self._register_child_endpoint( - SystemParsingvariablesEndpoint(client, parent_endpoint=self) + self.user_defined_fields = self._register_child_endpoint( + SystemUserdefinedfieldsEndpoint(client, parent_endpoint=self) ) - self.allowedorigins = self._register_child_endpoint( - SystemAllowedoriginsEndpoint(client, parent_endpoint=self) + self.workflow_actions = self._register_child_endpoint( + SystemWorkflowactionsEndpoint(client, parent_endpoint=self) ) + self.workflows = self._register_child_endpoint(SystemWorkflowsEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsCountEndpoint.py index ea6622768..9f8ee618b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEpayconfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemEpayconfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/ePayConfigurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/ePayConfigurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsEndpoint.py index bace606e4..d17d73de9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemEpayconfigurationsCountEndpoint import ( - SystemEpayconfigurationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemEpayconfigurationsIdEndpoint import ( - SystemEpayconfigurationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemEpayconfigurationsCountEndpoint import SystemEpayconfigurationsCountEndpoint +from pyconnectwise.endpoints.manage.SystemEpayconfigurationsIdEndpoint import SystemEpayconfigurationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import EPayConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEpayconfigurationsEndpoint( @@ -24,36 +18,29 @@ class SystemEpayconfigurationsEndpoint( IPostable[EPayConfiguration, ConnectWiseManageRequestParams], IPaginateable[EPayConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ePayConfigurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ePayConfigurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[EPayConfiguration]) IPostable.__init__(self, EPayConfiguration) IPaginateable.__init__(self, EPayConfiguration) - self.count = self._register_child_endpoint( - SystemEpayconfigurationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemEpayconfigurationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemEpayconfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemEpayconfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemEpayconfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemEpayconfigurationsIdEndpoint: The initialized SystemEpayconfigurationsIdEndpoint object. """ child = SystemEpayconfigurationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EPayConfiguration]: """ Performs a GET request against the /system/ePayConfigurations endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EPayConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EPayConfiguration, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[EPayConfiguration]: """ Performs a GET request against the /system/ePayConfigurations endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[EPayConfiguration]: The parsed response data. """ - return self._parse_many( - EPayConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(EPayConfiguration, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EPayConfiguration: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EPayConfiguration: """ Performs a POST request against the /system/ePayConfigurations endpoint. @@ -112,7 +85,4 @@ def post( Returns: EPayConfiguration: The parsed response data. """ - return self._parse_one( - EPayConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(EPayConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsIdEndpoint.py index d840be7db..b769b8ebd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemEpayconfigurationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import EPayConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemEpayconfigurationsIdEndpoint( ConnectWiseEndpoint, IGettable[EPayConfiguration, ConnectWiseManageRequestParams], - IPuttable[EPayConfiguration, ConnectWiseManageRequestParams], IPatchable[EPayConfiguration, ConnectWiseManageRequestParams], + IPuttable[EPayConfiguration, ConnectWiseManageRequestParams], IPaginateable[EPayConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, EPayConfiguration) - IPuttable.__init__(self, EPayConfiguration) IPatchable.__init__(self, EPayConfiguration) + IPuttable.__init__(self, EPayConfiguration) IPaginateable.__init__(self, EPayConfiguration) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[EPayConfiguration]: """ Performs a GET request against the /system/ePayConfigurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - EPayConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), EPayConfiguration, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EPayConfiguration: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/ePayConfigurations/{id} endpoint. + Performs a DELETE request against the /system/ePayConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - EPayConfiguration: The parsed response data. """ - return self._parse_one( - EPayConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EPayConfiguration: """ - Performs a DELETE request against the /system/ePayConfigurations/{id} endpoint. + Performs a GET request against the /system/ePayConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + EPayConfiguration: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(EPayConfiguration, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> EPayConfiguration: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> EPayConfiguration: """ - Performs a PUT request against the /system/ePayConfigurations/{id} endpoint. + Performs a PATCH request against the /system/ePayConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: EPayConfiguration: The parsed response data. """ - return self._parse_one( - EPayConfiguration, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(EPayConfiguration, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> EPayConfiguration: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> EPayConfiguration: """ - Performs a PATCH request against the /system/ePayConfigurations/{id} endpoint. + Performs a PUT request against the /system/ePayConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: EPayConfiguration: The parsed response data. """ - return self._parse_one( - EPayConfiguration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(EPayConfiguration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemExperimentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemExperimentsCountEndpoint.py index b0ba287be..01d39734a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemExperimentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemExperimentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemExperimentsCountEndpoint( @@ -16,18 +15,13 @@ class SystemExperimentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/experiments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/experiments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemExperimentsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemExperimentsEndpoint.py index 3b49b533a..d3f46a8a6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemExperimentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemExperimentsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemExperimentsCountEndpoint import ( - SystemExperimentsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemExperimentsIdEndpoint import ( - SystemExperimentsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemExperimentsCountEndpoint import SystemExperimentsCountEndpoint +from pyconnectwise.endpoints.manage.SystemExperimentsIdEndpoint import SystemExperimentsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Experiment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemExperimentsEndpoint( @@ -22,35 +17,28 @@ class SystemExperimentsEndpoint( IGettable[list[Experiment], ConnectWiseManageRequestParams], IPaginateable[Experiment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "experiments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "experiments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Experiment]) IPaginateable.__init__(self, Experiment) - self.count = self._register_child_endpoint( - SystemExperimentsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemExperimentsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemExperimentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemExperimentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemExperimentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemExperimentsIdEndpoint: The initialized SystemExperimentsIdEndpoint object. """ child = SystemExperimentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Experiment]: """ Performs a GET request against the /system/experiments endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Experiment, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Experiment, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Experiment]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Experiment]: """ Performs a GET request against the /system/experiments endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[Experiment]: The parsed response data. """ - return self._parse_many( - Experiment, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Experiment, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemExperimentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemExperimentsIdEndpoint.py index dade60f05..8b5efd37d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemExperimentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemExperimentsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Experiment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemExperimentsIdEndpoint( @@ -16,18 +15,13 @@ class SystemExperimentsIdEndpoint( IGettable[Experiment, ConnectWiseManageRequestParams], IPaginateable[Experiment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Experiment) IPaginateable.__init__(self, Experiment) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Experiment]: """ Performs a GET request against the /system/experiments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Experiment, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Experiment, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Experiment: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Experiment: """ Performs a GET request against the /system/experiments/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: Experiment: The parsed response data. """ - return self._parse_one( - Experiment, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Experiment, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsCountEndpoint.py index 3df373569..1ac7d8bd4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemFileuploadsettingsCountEndpoint( @@ -16,18 +15,13 @@ class SystemFileuploadsettingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/fileuploadsettings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/fileuploadsettings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsEndpoint.py index 8c36497e6..c54084e77 100644 --- a/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemFileuploadsettingsCountEndpoint import ( - SystemFileuploadsettingsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemFileuploadsettingsIdEndpoint import ( - SystemFileuploadsettingsIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemFileuploadsettingsCountEndpoint import SystemFileuploadsettingsCountEndpoint +from pyconnectwise.endpoints.manage.SystemFileuploadsettingsIdEndpoint import SystemFileuploadsettingsIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemFileuploadsettingsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "fileuploadsettings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "fileuploadsettings", parent_endpoint=parent_endpoint) - self.count = self._register_child_endpoint( - SystemFileuploadsettingsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemFileuploadsettingsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemFileuploadsettingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemFileuploadsettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemFileuploadsettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemFileuploadsettingsIdEndpoint: The initialized SystemFileuploadsettingsIdEndpoint object. """ child = SystemFileuploadsettingsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsIdEndpoint.py index f0218183b..08ef1406d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemFileuploadsettingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import FileUploadSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemFileuploadsettingsIdEndpoint( ConnectWiseEndpoint, IGettable[FileUploadSetting, ConnectWiseManageRequestParams], - IPuttable[FileUploadSetting, ConnectWiseManageRequestParams], IPatchable[FileUploadSetting, ConnectWiseManageRequestParams], + IPuttable[FileUploadSetting, ConnectWiseManageRequestParams], IPaginateable[FileUploadSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, FileUploadSetting) - IPuttable.__init__(self, FileUploadSetting) IPatchable.__init__(self, FileUploadSetting) + IPuttable.__init__(self, FileUploadSetting) IPaginateable.__init__(self, FileUploadSetting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[FileUploadSetting]: """ Performs a GET request against the /system/fileuploadsettings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - FileUploadSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), FileUploadSetting, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FileUploadSetting: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FileUploadSetting: """ Performs a GET request against the /system/fileuploadsettings/{id} endpoint. @@ -74,18 +56,11 @@ def get( Returns: FileUploadSetting: The parsed response data. """ - return self._parse_one( - FileUploadSetting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(FileUploadSetting, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> FileUploadSetting: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> FileUploadSetting: """ - Performs a PUT request against the /system/fileuploadsettings/{id} endpoint. + Performs a PATCH request against the /system/fileuploadsettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -93,18 +68,11 @@ def put( Returns: FileUploadSetting: The parsed response data. """ - return self._parse_one( - FileUploadSetting, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(FileUploadSetting, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> FileUploadSetting: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> FileUploadSetting: """ - Performs a PATCH request against the /system/fileuploadsettings/{id} endpoint. + Performs a PUT request against the /system/fileuploadsettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -112,7 +80,4 @@ def patch( Returns: FileUploadSetting: The parsed response data. """ - return self._parse_one( - FileUploadSetting, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(FileUploadSetting, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupCountEndpoint.py index 298a234b9..bb08c4738 100644 --- a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemGoogleemailsetupCountEndpoint( @@ -16,18 +15,13 @@ class SystemGoogleemailsetupCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/googleemailsetup/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/googleemailsetup/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupEndpoint.py index 74991eb24..2a7f2434b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupEndpoint.py @@ -1,31 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemGoogleemailsetupCountEndpoint import ( - SystemGoogleemailsetupCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemGoogleemailsetupIdEndpoint import ( - SystemGoogleemailsetupIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemGoogleemailsetupCountEndpoint import SystemGoogleemailsetupCountEndpoint +from pyconnectwise.endpoints.manage.SystemGoogleemailsetupIdEndpoint import SystemGoogleemailsetupIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemGoogleemailsetupEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "googleemailsetup", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "googleemailsetup", parent_endpoint=parent_endpoint) - self.count = self._register_child_endpoint( - SystemGoogleemailsetupCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemGoogleemailsetupCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemGoogleemailsetupIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemGoogleemailsetupIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemGoogleemailsetupIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemGoogleemailsetupIdEndpoint: The initialized SystemGoogleemailsetupIdEndpoint object. """ child = SystemGoogleemailsetupIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdEndpoint.py index cec0abbbc..628a6d6ab 100644 --- a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemGoogleemailsetupIdTestconnectionEndpoint import ( SystemGoogleemailsetupIdTestconnectionEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import GoogleEmailSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemGoogleemailsetupIdEndpoint( ConnectWiseEndpoint, IGettable[GoogleEmailSetup, ConnectWiseManageRequestParams], - IPuttable[GoogleEmailSetup, ConnectWiseManageRequestParams], IPatchable[GoogleEmailSetup, ConnectWiseManageRequestParams], + IPuttable[GoogleEmailSetup, ConnectWiseManageRequestParams], IPaginateable[GoogleEmailSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, GoogleEmailSetup) - IPuttable.__init__(self, GoogleEmailSetup) IPatchable.__init__(self, GoogleEmailSetup) + IPuttable.__init__(self, GoogleEmailSetup) IPaginateable.__init__(self, GoogleEmailSetup) self.test_connection = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[GoogleEmailSetup]: """ Performs a GET request against the /system/googleemailsetup/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - GoogleEmailSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), GoogleEmailSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GoogleEmailSetup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/googleemailsetup/{id} endpoint. + Performs a DELETE request against the /system/googleemailsetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - GoogleEmailSetup: The parsed response data. """ - return self._parse_one( - GoogleEmailSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GoogleEmailSetup: """ - Performs a DELETE request against the /system/googleemailsetup/{id} endpoint. + Performs a GET request against the /system/googleemailsetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + GoogleEmailSetup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(GoogleEmailSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> GoogleEmailSetup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> GoogleEmailSetup: """ - Performs a PUT request against the /system/googleemailsetup/{id} endpoint. + Performs a PATCH request against the /system/googleemailsetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +85,11 @@ def put( Returns: GoogleEmailSetup: The parsed response data. """ - return self._parse_one( - GoogleEmailSetup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(GoogleEmailSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> GoogleEmailSetup: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> GoogleEmailSetup: """ - Performs a PATCH request against the /system/googleemailsetup/{id} endpoint. + Performs a PUT request against the /system/googleemailsetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +97,4 @@ def patch( Returns: GoogleEmailSetup: The parsed response data. """ - return self._parse_one( - GoogleEmailSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(GoogleEmailSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdTestconnectionEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdTestconnectionEndpoint.py index a7f706e24..41c0735a0 100644 --- a/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdTestconnectionEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemGoogleemailsetupIdTestconnectionEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemGoogleemailsetupIdTestconnectionEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testConnection", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testConnection", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/googleemailsetup/{id}/testConnection endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemImapsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImapsCountEndpoint.py index 09f03c2fc..00bca7476 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImapsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImapsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImapsCountEndpoint( @@ -16,18 +15,13 @@ class SystemImapsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/imaps/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/imaps/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemImapsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImapsEndpoint.py index e83d365e5..2404cb8dd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImapsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImapsEndpoint.py @@ -1,22 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemImapsCountEndpoint import ( - SystemImapsCountEndpoint, -) +from pyconnectwise.endpoints.manage.SystemImapsCountEndpoint import SystemImapsCountEndpoint from pyconnectwise.endpoints.manage.SystemImapsIdEndpoint import SystemImapsIdEndpoint -from pyconnectwise.endpoints.manage.SystemImapsInfoEndpoint import ( - SystemImapsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemImapsInfoEndpoint import SystemImapsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Imap from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImapsEndpoint( @@ -25,39 +19,30 @@ class SystemImapsEndpoint( IPostable[Imap, ConnectWiseManageRequestParams], IPaginateable[Imap, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "imaps", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "imaps", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Imap]) IPostable.__init__(self, Imap) IPaginateable.__init__(self, Imap) - self.count = self._register_child_endpoint( - SystemImapsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemImapsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemImapsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemImapsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemImapsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemImapsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemImapsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemImapsIdEndpoint: The initialized SystemImapsIdEndpoint object. """ child = SystemImapsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Imap]: """ Performs a GET request against the /system/imaps endpoint and returns an initialized PaginatedResponse object. @@ -74,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Imap, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Imap, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Imap]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Imap]: """ Performs a GET request against the /system/imaps endpoint. @@ -97,15 +71,9 @@ def get( Returns: list[Imap]: The parsed response data. """ - return self._parse_many( - Imap, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Imap, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Imap: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Imap: """ Performs a POST request against the /system/imaps endpoint. @@ -115,6 +83,4 @@ def post( Returns: Imap: The parsed response data. """ - return self._parse_one( - Imap, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Imap, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemImapsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImapsIdEndpoint.py index c77b5cf62..6ced24adc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImapsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImapsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemImapsIdInfoEndpoint import ( - SystemImapsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemImapsIdInfoEndpoint import SystemImapsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Imap from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImapsIdEndpoint( ConnectWiseEndpoint, IGettable[Imap, ConnectWiseManageRequestParams], - IPuttable[Imap, ConnectWiseManageRequestParams], IPatchable[Imap, ConnectWiseManageRequestParams], + IPuttable[Imap, ConnectWiseManageRequestParams], IPaginateable[Imap, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Imap) - IPuttable.__init__(self, Imap) IPatchable.__init__(self, Imap) + IPuttable.__init__(self, Imap) IPaginateable.__init__(self, Imap) - self.info = self._register_child_endpoint( - SystemImapsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemImapsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Imap]: """ Performs a GET request against the /system/imaps/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Imap, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Imap, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Imap: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/imaps/{id} endpoint. + Performs a DELETE request against the /system/imaps/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Imap: The parsed response data. """ - return self._parse_one( - Imap, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Imap: """ - Performs a DELETE request against the /system/imaps/{id} endpoint. + Performs a GET request against the /system/imaps/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Imap: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Imap, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Imap: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Imap: """ - Performs a PUT request against the /system/imaps/{id} endpoint. + Performs a PATCH request against the /system/imaps/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: Imap: The parsed response data. """ - return self._parse_one( - Imap, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Imap, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Imap: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Imap: """ - Performs a PATCH request against the /system/imaps/{id} endpoint. + Performs a PUT request against the /system/imaps/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: Imap: The parsed response data. """ - return self._parse_one( - Imap, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Imap, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemImapsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImapsIdInfoEndpoint.py index b90aa86e4..b2f28c054 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImapsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImapsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ImapInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImapsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemImapsIdInfoEndpoint( IGettable[ImapInfo, ConnectWiseManageRequestParams], IPaginateable[ImapInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ImapInfo) IPaginateable.__init__(self, ImapInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ImapInfo]: """ Performs a GET request against the /system/imaps/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ImapInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ImapInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ImapInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ImapInfo: """ Performs a GET request against the /system/imaps/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: ImapInfo: The parsed response data. """ - return self._parse_one( - ImapInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ImapInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemImapsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImapsInfoCountEndpoint.py index bb337bb77..a356d28f8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImapsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImapsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImapsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemImapsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/imaps/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/imaps/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemImapsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImapsInfoEndpoint.py index 371129e93..7e1b8d90c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImapsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImapsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemImapsInfoCountEndpoint import ( - SystemImapsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemImapsInfoCountEndpoint import SystemImapsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ImapInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImapsInfoEndpoint( @@ -19,22 +16,15 @@ class SystemImapsInfoEndpoint( IGettable[list[ImapInfo], ConnectWiseManageRequestParams], IPaginateable[ImapInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ImapInfo]) IPaginateable.__init__(self, ImapInfo) - self.count = self._register_child_endpoint( - SystemImapsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemImapsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ImapInfo]: """ Performs a GET request against the /system/imaps/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ImapInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ImapInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ImapInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ImapInfo]: """ Performs a GET request against the /system/imaps/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[ImapInfo]: The parsed response data. """ - return self._parse_many( - ImapInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ImapInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceEndpoint.py index 9840144f1..f176af999 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemImportmassmaintenanceIdEndpoint import ( - SystemImportmassmaintenanceIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemImportmassmaintenanceIdEndpoint import SystemImportmassmaintenanceIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImportmassmaintenanceEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "importMassMaintenance", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "importMassMaintenance", parent_endpoint=parent_endpoint) - def id(self, id: int) -> SystemImportmassmaintenanceIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemImportmassmaintenanceIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemImportmassmaintenanceIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemImportmassmaintenanceIdEndpoint: The initialized SystemImportmassmaintenanceIdEndpoint object. """ child = SystemImportmassmaintenanceIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceIdEndpoint.py index f4ce5894c..23f088926 100644 --- a/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemImportmassmaintenanceIdEndpoint.py @@ -1,28 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import ImportMassMaintenance -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemImportmassmaintenanceIdEndpoint( - ConnectWiseEndpoint, - IPostable[ImportMassMaintenance, ConnectWiseManageRequestParams], + ConnectWiseEndpoint, IPostable[ImportMassMaintenance, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPostable.__init__(self, ImportMassMaintenance) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ImportMassMaintenance: """ Performs a POST request against the /system/importMassMaintenance/{id} endpoint. @@ -33,7 +28,4 @@ def post( Returns: ImportMassMaintenance: The parsed response data. """ - return self._parse_one( - ImportMassMaintenance, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ImportMassMaintenance, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsCountEndpoint.py index 6b2332c1e..90fc2663d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoDepartmentlocationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoDepartmentlocationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/departmentlocations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/departmentlocations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsEndpoint.py index 3c6c632d0..b7a2a867d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemInfoDepartmentlocationsCountEndpoint import ( SystemInfoDepartmentlocationsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.SystemInfoDepartmentlocationsIdEndpoint import ( SystemInfoDepartmentlocationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import DepartmentLocationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoDepartmentlocationsEndpoint( @@ -22,10 +21,8 @@ class SystemInfoDepartmentlocationsEndpoint( IGettable[list[DepartmentLocationInfo], ConnectWiseManageRequestParams], IPaginateable[DepartmentLocationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "departmentlocations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "departmentlocations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DepartmentLocationInfo]) IPaginateable.__init__(self, DepartmentLocationInfo) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemInfoDepartmentlocationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemInfoDepartmentlocationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoDepartmentlocationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoDepartmentlocationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoDepartmentlocationsIdEndpoint: The initialized SystemInfoDepartmentlocationsIdEndpoint object. """ - child = SystemInfoDepartmentlocationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemInfoDepartmentlocationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DepartmentLocationInfo]: """ Performs a GET request against the /system/info/departmentlocations endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DepartmentLocationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DepartmentLocationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[DepartmentLocationInfo]: """ Performs a GET request against the /system/info/departmentlocations endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[DepartmentLocationInfo]: The parsed response data. """ - return self._parse_many( - DepartmentLocationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(DepartmentLocationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsIdEndpoint.py index 38b38a30a..c23c58c26 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentlocationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import DepartmentLocationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoDepartmentlocationsIdEndpoint( @@ -16,18 +15,13 @@ class SystemInfoDepartmentlocationsIdEndpoint( IGettable[DepartmentLocationInfo, ConnectWiseManageRequestParams], IPaginateable[DepartmentLocationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, DepartmentLocationInfo) IPaginateable.__init__(self, DepartmentLocationInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DepartmentLocationInfo]: """ Performs a GET request against the /system/info/departmentlocations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DepartmentLocationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DepartmentLocationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> DepartmentLocationInfo: """ Performs a GET request against the /system/info/departmentlocations/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: DepartmentLocationInfo: The parsed response data. """ - return self._parse_one( - DepartmentLocationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(DepartmentLocationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsCountEndpoint.py index 878728517..a883d2404 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoDepartmentsCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoDepartmentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/departments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/departments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsEndpoint.py index 028454b0b..65857a83d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoDepartmentsCountEndpoint import ( - SystemInfoDepartmentsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoDepartmentsIdEndpoint import ( - SystemInfoDepartmentsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoDepartmentsCountEndpoint import SystemInfoDepartmentsCountEndpoint +from pyconnectwise.endpoints.manage.SystemInfoDepartmentsIdEndpoint import SystemInfoDepartmentsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import DepartmentInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoDepartmentsEndpoint( @@ -22,35 +17,28 @@ class SystemInfoDepartmentsEndpoint( IGettable[list[DepartmentInfo], ConnectWiseManageRequestParams], IPaginateable[DepartmentInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "departments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "departments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DepartmentInfo]) IPaginateable.__init__(self, DepartmentInfo) - self.count = self._register_child_endpoint( - SystemInfoDepartmentsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInfoDepartmentsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInfoDepartmentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoDepartmentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoDepartmentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoDepartmentsIdEndpoint: The initialized SystemInfoDepartmentsIdEndpoint object. """ child = SystemInfoDepartmentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DepartmentInfo]: """ Performs a GET request against the /system/info/departments endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DepartmentInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DepartmentInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[DepartmentInfo]: """ Performs a GET request against the /system/info/departments endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[DepartmentInfo]: The parsed response data. """ - return self._parse_many( - DepartmentInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(DepartmentInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsIdEndpoint.py index da31a9776..c8ff9402a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoDepartmentsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import DepartmentInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoDepartmentsIdEndpoint( @@ -16,18 +15,13 @@ class SystemInfoDepartmentsIdEndpoint( IGettable[DepartmentInfo, ConnectWiseManageRequestParams], IPaginateable[DepartmentInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, DepartmentInfo) IPaginateable.__init__(self, DepartmentInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DepartmentInfo]: """ Performs a GET request against the /system/info/departments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DepartmentInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DepartmentInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DepartmentInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DepartmentInfo: """ Performs a GET request against the /system/info/departments/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: DepartmentInfo: The parsed response data. """ - return self._parse_one( - DepartmentInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(DepartmentInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoEndpoint.py index f13cf77bb..281af702c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoEndpoint.py @@ -1,38 +1,21 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoDepartmentlocationsEndpoint import ( - SystemInfoDepartmentlocationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoDepartmentsEndpoint import ( - SystemInfoDepartmentsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoLinksEndpoint import ( - SystemInfoLinksEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoLocalesEndpoint import ( - SystemInfoLocalesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoLocationsEndpoint import ( - SystemInfoLocationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoMembersEndpoint import ( - SystemInfoMembersEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoPersonasEndpoint import ( - SystemInfoPersonasEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoStandardnotesEndpoint import ( - SystemInfoStandardnotesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoDepartmentlocationsEndpoint import SystemInfoDepartmentlocationsEndpoint +from pyconnectwise.endpoints.manage.SystemInfoDepartmentsEndpoint import SystemInfoDepartmentsEndpoint +from pyconnectwise.endpoints.manage.SystemInfoLinksEndpoint import SystemInfoLinksEndpoint +from pyconnectwise.endpoints.manage.SystemInfoLocalesEndpoint import SystemInfoLocalesEndpoint +from pyconnectwise.endpoints.manage.SystemInfoLocationsEndpoint import SystemInfoLocationsEndpoint +from pyconnectwise.endpoints.manage.SystemInfoMembersEndpoint import SystemInfoMembersEndpoint +from pyconnectwise.endpoints.manage.SystemInfoPersonasEndpoint import SystemInfoPersonasEndpoint +from pyconnectwise.endpoints.manage.SystemInfoStandardnotesEndpoint import SystemInfoStandardnotesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Info from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoEndpoint( @@ -40,43 +23,26 @@ class SystemInfoEndpoint( IGettable[Info, ConnectWiseManageRequestParams], IPaginateable[Info, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, Info) IPaginateable.__init__(self, Info) - self.members = self._register_child_endpoint( - SystemInfoMembersEndpoint(client, parent_endpoint=self) - ) - self.standard_notes = self._register_child_endpoint( - SystemInfoStandardnotesEndpoint(client, parent_endpoint=self) - ) - self.links = self._register_child_endpoint( - SystemInfoLinksEndpoint(client, parent_endpoint=self) - ) - self.personas = self._register_child_endpoint( - SystemInfoPersonasEndpoint(client, parent_endpoint=self) - ) - self.locales = self._register_child_endpoint( - SystemInfoLocalesEndpoint(client, parent_endpoint=self) - ) self.departmentlocations = self._register_child_endpoint( SystemInfoDepartmentlocationsEndpoint(client, parent_endpoint=self) ) - self.locations = self._register_child_endpoint( - SystemInfoLocationsEndpoint(client, parent_endpoint=self) - ) - self.departments = self._register_child_endpoint( - SystemInfoDepartmentsEndpoint(client, parent_endpoint=self) + self.departments = self._register_child_endpoint(SystemInfoDepartmentsEndpoint(client, parent_endpoint=self)) + self.links = self._register_child_endpoint(SystemInfoLinksEndpoint(client, parent_endpoint=self)) + self.locales = self._register_child_endpoint(SystemInfoLocalesEndpoint(client, parent_endpoint=self)) + self.locations = self._register_child_endpoint(SystemInfoLocationsEndpoint(client, parent_endpoint=self)) + self.members = self._register_child_endpoint(SystemInfoMembersEndpoint(client, parent_endpoint=self)) + self.personas = self._register_child_endpoint(SystemInfoPersonasEndpoint(client, parent_endpoint=self)) + self.standard_notes = self._register_child_endpoint( + SystemInfoStandardnotesEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Info]: """ Performs a GET request against the /system/info endpoint and returns an initialized PaginatedResponse object. @@ -93,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Info, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Info, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Info: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Info: """ Performs a GET request against the /system/info endpoint. @@ -116,6 +71,4 @@ def get( Returns: Info: The parsed response data. """ - return self._parse_one( - Info, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Info, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLinksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLinksCountEndpoint.py index 5c95509cd..46d28da20 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLinksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLinksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLinksCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoLinksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/links/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/links/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLinksEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLinksEndpoint.py index 539859a8b..e0e161fd0 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLinksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLinksEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoLinksCountEndpoint import ( - SystemInfoLinksCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoLinksIdEndpoint import ( - SystemInfoLinksIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoLinksCountEndpoint import SystemInfoLinksCountEndpoint +from pyconnectwise.endpoints.manage.SystemInfoLinksIdEndpoint import SystemInfoLinksIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LinkInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLinksEndpoint( @@ -22,35 +17,28 @@ class SystemInfoLinksEndpoint( IGettable[list[LinkInfo], ConnectWiseManageRequestParams], IPaginateable[LinkInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "links", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "links", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LinkInfo]) IPaginateable.__init__(self, LinkInfo) - self.count = self._register_child_endpoint( - SystemInfoLinksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInfoLinksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInfoLinksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoLinksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoLinksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoLinksIdEndpoint: The initialized SystemInfoLinksIdEndpoint object. """ child = SystemInfoLinksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LinkInfo]: """ Performs a GET request against the /system/info/links endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - LinkInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), LinkInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[LinkInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[LinkInfo]: """ Performs a GET request against the /system/info/links endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[LinkInfo]: The parsed response data. """ - return self._parse_many( - LinkInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LinkInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdEndpoint.py index 646b10a06..68e422d25 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoLinksIdResolveurlEndpoint import ( - SystemInfoLinksIdResolveurlEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoLinksIdResolveurlEndpoint import SystemInfoLinksIdResolveurlEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LinkInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLinksIdEndpoint( @@ -19,10 +16,8 @@ class SystemInfoLinksIdEndpoint( IGettable[LinkInfo, ConnectWiseManageRequestParams], IPaginateable[LinkInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LinkInfo) IPaginateable.__init__(self, LinkInfo) @@ -31,10 +26,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LinkInfo]: """ Performs a GET request against the /system/info/links/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +43,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - LinkInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), LinkInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LinkInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LinkInfo: """ Performs a GET request against the /system/info/links/{id} endpoint. @@ -74,6 +55,4 @@ def get( Returns: LinkInfo: The parsed response data. """ - return self._parse_one( - LinkInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(LinkInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdResolveurlEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdResolveurlEndpoint.py index c5e724d1e..1d5c6ffd7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdResolveurlEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLinksIdResolveurlEndpoint.py @@ -1,27 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import LinkResolveUrlInfo -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLinksIdResolveurlEndpoint( ConnectWiseEndpoint, IPostable[LinkResolveUrlInfo, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "resolveurl", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "resolveurl", parent_endpoint=parent_endpoint) IPostable.__init__(self, LinkResolveUrlInfo) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> LinkResolveUrlInfo: """ Performs a POST request against the /system/info/links/{id}/resolveurl endpoint. @@ -32,7 +28,4 @@ def post( Returns: LinkResolveUrlInfo: The parsed response data. """ - return self._parse_one( - LinkResolveUrlInfo, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(LinkResolveUrlInfo, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLocalesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLocalesCountEndpoint.py index a0fefd35f..06256a25b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLocalesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLocalesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLocalesCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoLocalesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/locales/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/locales/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLocalesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLocalesEndpoint.py index 5f2cf243e..84e015811 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLocalesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLocalesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoLocalesCountEndpoint import ( - SystemInfoLocalesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoLocalesIdEndpoint import ( - SystemInfoLocalesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoLocalesCountEndpoint import SystemInfoLocalesCountEndpoint +from pyconnectwise.endpoints.manage.SystemInfoLocalesIdEndpoint import SystemInfoLocalesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocaleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLocalesEndpoint( @@ -22,35 +17,28 @@ class SystemInfoLocalesEndpoint( IGettable[list[LocaleInfo], ConnectWiseManageRequestParams], IPaginateable[LocaleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "locales", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "locales", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LocaleInfo]) IPaginateable.__init__(self, LocaleInfo) - self.count = self._register_child_endpoint( - SystemInfoLocalesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInfoLocalesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInfoLocalesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoLocalesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoLocalesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoLocalesIdEndpoint: The initialized SystemInfoLocalesIdEndpoint object. """ child = SystemInfoLocalesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocaleInfo]: """ Performs a GET request against the /system/info/locales endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - LocaleInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), LocaleInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[LocaleInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[LocaleInfo]: """ Performs a GET request against the /system/info/locales endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[LocaleInfo]: The parsed response data. """ - return self._parse_many( - LocaleInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LocaleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLocalesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLocalesIdEndpoint.py index edbd198c8..ee31497f8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLocalesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLocalesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocaleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLocalesIdEndpoint( @@ -16,18 +15,13 @@ class SystemInfoLocalesIdEndpoint( IGettable[LocaleInfo, ConnectWiseManageRequestParams], IPaginateable[LocaleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LocaleInfo) IPaginateable.__init__(self, LocaleInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocaleInfo]: """ Performs a GET request against the /system/info/locales/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - LocaleInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), LocaleInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LocaleInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LocaleInfo: """ Performs a GET request against the /system/info/locales/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: LocaleInfo: The parsed response data. """ - return self._parse_one( - LocaleInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(LocaleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLocationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLocationsCountEndpoint.py index 9c133b1ba..a56a14452 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLocationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLocationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLocationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoLocationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/locations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/locations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLocationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLocationsEndpoint.py index 638b6a490..773dc298a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLocationsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoLocationsCountEndpoint import ( - SystemInfoLocationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoLocationsIdEndpoint import ( - SystemInfoLocationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoLocationsCountEndpoint import SystemInfoLocationsCountEndpoint +from pyconnectwise.endpoints.manage.SystemInfoLocationsIdEndpoint import SystemInfoLocationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLocationsEndpoint( @@ -22,35 +17,28 @@ class SystemInfoLocationsEndpoint( IGettable[list[LocationInfo], ConnectWiseManageRequestParams], IPaginateable[LocationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "locations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "locations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LocationInfo]) IPaginateable.__init__(self, LocationInfo) - self.count = self._register_child_endpoint( - SystemInfoLocationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInfoLocationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInfoLocationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoLocationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoLocationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoLocationsIdEndpoint: The initialized SystemInfoLocationsIdEndpoint object. """ child = SystemInfoLocationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocationInfo]: """ Performs a GET request against the /system/info/locations endpoint and returns an initialized PaginatedResponse object. @@ -68,19 +56,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LocationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LocationInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[LocationInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[LocationInfo]: """ Performs a GET request against the /system/info/locations endpoint. @@ -90,6 +69,4 @@ def get( Returns: list[LocationInfo]: The parsed response data. """ - return self._parse_many( - LocationInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(LocationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoLocationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoLocationsIdEndpoint.py index e06db63dc..56f884c43 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoLocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoLocationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoLocationsIdEndpoint( @@ -16,18 +15,13 @@ class SystemInfoLocationsIdEndpoint( IGettable[LocationInfo, ConnectWiseManageRequestParams], IPaginateable[LocationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LocationInfo) IPaginateable.__init__(self, LocationInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocationInfo]: """ Performs a GET request against the /system/info/locations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LocationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LocationInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LocationInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LocationInfo: """ Performs a GET request against the /system/info/locations/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: LocationInfo: The parsed response data. """ - return self._parse_one( - LocationInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(LocationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoMembersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoMembersCountEndpoint.py index 26cd24615..0d5d30acb 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoMembersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoMembersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoMembersCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoMembersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/members/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/members/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoMembersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoMembersEndpoint.py index fe9e6f71d..0b7004644 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoMembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoMembersEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoMembersCountEndpoint import ( - SystemInfoMembersCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoMembersIdEndpoint import ( - SystemInfoMembersIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoMembersCountEndpoint import SystemInfoMembersCountEndpoint +from pyconnectwise.endpoints.manage.SystemInfoMembersIdEndpoint import SystemInfoMembersIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MemberInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoMembersEndpoint( @@ -22,35 +17,28 @@ class SystemInfoMembersEndpoint( IGettable[list[MemberInfo], ConnectWiseManageRequestParams], IPaginateable[MemberInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "members", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "members", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberInfo]) IPaginateable.__init__(self, MemberInfo) - self.count = self._register_child_endpoint( - SystemInfoMembersCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInfoMembersCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInfoMembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoMembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoMembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoMembersIdEndpoint: The initialized SystemInfoMembersIdEndpoint object. """ child = SystemInfoMembersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberInfo]: """ Performs a GET request against the /system/info/members endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MemberInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MemberInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[MemberInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[MemberInfo]: """ Performs a GET request against the /system/info/members endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[MemberInfo]: The parsed response data. """ - return self._parse_many( - MemberInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(MemberInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoMembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoMembersIdEndpoint.py index a7c5f605b..f18e6395b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoMembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoMembersIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MemberInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoMembersIdEndpoint( @@ -16,18 +15,13 @@ class SystemInfoMembersIdEndpoint( IGettable[MemberInfo, ConnectWiseManageRequestParams], IPaginateable[MemberInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberInfo) IPaginateable.__init__(self, MemberInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberInfo]: """ Performs a GET request against the /system/info/members/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MemberInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MemberInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberInfo: """ Performs a GET request against the /system/info/members/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: MemberInfo: The parsed response data. """ - return self._parse_one( - MemberInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(MemberInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoPersonasCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoPersonasCountEndpoint.py index 3274bf1aa..2c2260549 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoPersonasCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoPersonasCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoPersonasCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoPersonasCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/personas/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/personas/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoPersonasEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoPersonasEndpoint.py index eb602320d..f66a49a0f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoPersonasEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoPersonasEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoPersonasCountEndpoint import ( - SystemInfoPersonasCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoPersonasIdEndpoint import ( - SystemInfoPersonasIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoPersonasCountEndpoint import SystemInfoPersonasCountEndpoint +from pyconnectwise.endpoints.manage.SystemInfoPersonasIdEndpoint import SystemInfoPersonasIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PersonasInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoPersonasEndpoint( @@ -22,35 +17,28 @@ class SystemInfoPersonasEndpoint( IGettable[list[PersonasInfo], ConnectWiseManageRequestParams], IPaginateable[PersonasInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "personas", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "personas", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PersonasInfo]) IPaginateable.__init__(self, PersonasInfo) - self.count = self._register_child_endpoint( - SystemInfoPersonasCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInfoPersonasCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInfoPersonasIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoPersonasIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoPersonasIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoPersonasIdEndpoint: The initialized SystemInfoPersonasIdEndpoint object. """ child = SystemInfoPersonasIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PersonasInfo]: """ Performs a GET request against the /system/info/personas endpoint and returns an initialized PaginatedResponse object. @@ -68,19 +56,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PersonasInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PersonasInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[PersonasInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[PersonasInfo]: """ Performs a GET request against the /system/info/personas endpoint. @@ -90,6 +69,4 @@ def get( Returns: list[PersonasInfo]: The parsed response data. """ - return self._parse_many( - PersonasInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PersonasInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoPersonasIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoPersonasIdEndpoint.py index f7cd3061c..614d0e84f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoPersonasIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoPersonasIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import PersonasInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoPersonasIdEndpoint( @@ -16,18 +15,13 @@ class SystemInfoPersonasIdEndpoint( IGettable[PersonasInfo, ConnectWiseManageRequestParams], IPaginateable[PersonasInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PersonasInfo) IPaginateable.__init__(self, PersonasInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PersonasInfo]: """ Performs a GET request against the /system/info/personas/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PersonasInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PersonasInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PersonasInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PersonasInfo: """ Performs a GET request against the /system/info/personas/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: PersonasInfo: The parsed response data. """ - return self._parse_one( - PersonasInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(PersonasInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesCountEndpoint.py index 3d1b312e6..045bc89ea 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoStandardnotesCountEndpoint( @@ -16,18 +15,13 @@ class SystemInfoStandardnotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/info/standardNotes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/info/standardNotes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesEndpoint.py index aeb02fb9c..2494f0f74 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInfoStandardnotesCountEndpoint import ( - SystemInfoStandardnotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInfoStandardnotesIdEndpoint import ( - SystemInfoStandardnotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInfoStandardnotesCountEndpoint import SystemInfoStandardnotesCountEndpoint +from pyconnectwise.endpoints.manage.SystemInfoStandardnotesIdEndpoint import SystemInfoStandardnotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import StandardNoteInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoStandardnotesEndpoint( @@ -22,35 +17,28 @@ class SystemInfoStandardnotesEndpoint( IGettable[list[StandardNoteInfo], ConnectWiseManageRequestParams], IPaginateable[StandardNoteInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "standardNotes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "standardNotes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[StandardNoteInfo]) IPaginateable.__init__(self, StandardNoteInfo) - self.count = self._register_child_endpoint( - SystemInfoStandardnotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInfoStandardnotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInfoStandardnotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInfoStandardnotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInfoStandardnotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInfoStandardnotesIdEndpoint: The initialized SystemInfoStandardnotesIdEndpoint object. """ child = SystemInfoStandardnotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StandardNoteInfo]: """ Performs a GET request against the /system/info/standardNotes endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - StandardNoteInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), StandardNoteInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[StandardNoteInfo]: """ Performs a GET request against the /system/info/standardNotes endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[StandardNoteInfo]: The parsed response data. """ - return self._parse_many( - StandardNoteInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(StandardNoteInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesIdEndpoint.py index f77b88f10..87e903dd8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInfoStandardnotesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import StandardNoteInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInfoStandardnotesIdEndpoint( @@ -16,18 +15,13 @@ class SystemInfoStandardnotesIdEndpoint( IGettable[StandardNoteInfo, ConnectWiseManageRequestParams], IPaginateable[StandardNoteInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, StandardNoteInfo) IPaginateable.__init__(self, StandardNoteInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StandardNoteInfo]: """ Performs a GET request against the /system/info/standardNotes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - StandardNoteInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), StandardNoteInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> StandardNoteInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> StandardNoteInfo: """ Performs a GET request against the /system/info/standardNotes/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: StandardNoteInfo: The parsed response data. """ - return self._parse_one( - StandardNoteInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(StandardNoteInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInoutboardsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInoutboardsCountEndpoint.py index 376ea8c2e..3af102e28 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInoutboardsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInoutboardsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInoutboardsCountEndpoint( @@ -16,18 +15,13 @@ class SystemInoutboardsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/inOutBoards/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/inOutBoards/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInoutboardsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInoutboardsEndpoint.py index fef6e2758..7e2ac52bf 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInoutboardsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInoutboardsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInoutboardsCountEndpoint import ( - SystemInoutboardsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInoutboardsIdEndpoint import ( - SystemInoutboardsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemInoutboardsCountEndpoint import SystemInoutboardsCountEndpoint +from pyconnectwise.endpoints.manage.SystemInoutboardsIdEndpoint import SystemInoutboardsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import InOutBoard from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInoutboardsEndpoint( @@ -24,36 +18,29 @@ class SystemInoutboardsEndpoint( IPostable[InOutBoard, ConnectWiseManageRequestParams], IPaginateable[InOutBoard, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "inOutBoards", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "inOutBoards", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InOutBoard]) IPostable.__init__(self, InOutBoard) IPaginateable.__init__(self, InOutBoard) - self.count = self._register_child_endpoint( - SystemInoutboardsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInoutboardsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInoutboardsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInoutboardsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInoutboardsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInoutboardsIdEndpoint: The initialized SystemInoutboardsIdEndpoint object. """ child = SystemInoutboardsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InOutBoard]: """ Performs a GET request against the /system/inOutBoards endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - InOutBoard, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), InOutBoard, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[InOutBoard]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[InOutBoard]: """ Performs a GET request against the /system/inOutBoards endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[InOutBoard]: The parsed response data. """ - return self._parse_many( - InOutBoard, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(InOutBoard, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutBoard: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InOutBoard: """ Performs a POST request against the /system/inOutBoards endpoint. @@ -111,6 +81,4 @@ def post( Returns: InOutBoard: The parsed response data. """ - return self._parse_one( - InOutBoard, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(InOutBoard, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInoutboardsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInoutboardsIdEndpoint.py index 900d335f4..75a1875a3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInoutboardsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInoutboardsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import InOutBoard from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInoutboardsIdEndpoint( ConnectWiseEndpoint, IGettable[InOutBoard, ConnectWiseManageRequestParams], - IPuttable[InOutBoard, ConnectWiseManageRequestParams], IPatchable[InOutBoard, ConnectWiseManageRequestParams], + IPuttable[InOutBoard, ConnectWiseManageRequestParams], IPaginateable[InOutBoard, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, InOutBoard) - IPuttable.__init__(self, InOutBoard) IPatchable.__init__(self, InOutBoard) + IPuttable.__init__(self, InOutBoard) IPaginateable.__init__(self, InOutBoard) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InOutBoard]: """ Performs a GET request against the /system/inOutBoards/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - InOutBoard, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), InOutBoard, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutBoard: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/inOutBoards/{id} endpoint. + Performs a DELETE request against the /system/inOutBoards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - InOutBoard: The parsed response data. """ - return self._parse_one( - InOutBoard, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InOutBoard: """ - Performs a DELETE request against the /system/inOutBoards/{id} endpoint. + Performs a GET request against the /system/inOutBoards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + InOutBoard: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(InOutBoard, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutBoard: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> InOutBoard: """ - Performs a PUT request against the /system/inOutBoards/{id} endpoint. + Performs a PATCH request against the /system/inOutBoards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: InOutBoard: The parsed response data. """ - return self._parse_one( - InOutBoard, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(InOutBoard, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutBoard: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InOutBoard: """ - Performs a PATCH request against the /system/inOutBoards/{id} endpoint. + Performs a PUT request against the /system/inOutBoards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: InOutBoard: The parsed response data. """ - return self._parse_one( - InOutBoard, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(InOutBoard, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInouttypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInouttypesCountEndpoint.py index 1fe5f5acb..1cb518d8c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInouttypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInouttypesCountEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInouttypesCountInfoEndpoint import ( - SystemInouttypesCountInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemInouttypesCountInfoEndpoint import SystemInouttypesCountInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInouttypesCountEndpoint( @@ -19,22 +16,15 @@ class SystemInouttypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) - self.info = self._register_child_endpoint( - SystemInouttypesCountInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemInouttypesCountInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/inOutTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/inOutTypes/count endpoint. @@ -74,6 +53,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInouttypesCountInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInouttypesCountInfoEndpoint.py index 4ff99a724..f08fd824b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInouttypesCountInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInouttypesCountInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInouttypesCountInfoEndpoint( @@ -16,18 +15,13 @@ class SystemInouttypesCountInfoEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/inOutTypes/count/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/inOutTypes/count/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInouttypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInouttypesEndpoint.py index c6df2fc79..58cffa663 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInouttypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInouttypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInouttypesCountEndpoint import ( - SystemInouttypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInouttypesIdEndpoint import ( - SystemInouttypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemInouttypesInfoEndpoint import ( - SystemInouttypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemInouttypesCountEndpoint import SystemInouttypesCountEndpoint +from pyconnectwise.endpoints.manage.SystemInouttypesIdEndpoint import SystemInouttypesIdEndpoint +from pyconnectwise.endpoints.manage.SystemInouttypesInfoEndpoint import SystemInouttypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import InOutType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInouttypesEndpoint( @@ -27,39 +19,30 @@ class SystemInouttypesEndpoint( IPostable[InOutType, ConnectWiseManageRequestParams], IPaginateable[InOutType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "inOutTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "inOutTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InOutType]) IPostable.__init__(self, InOutType) IPaginateable.__init__(self, InOutType) - self.count = self._register_child_endpoint( - SystemInouttypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemInouttypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemInouttypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemInouttypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemInouttypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemInouttypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemInouttypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemInouttypesIdEndpoint: The initialized SystemInouttypesIdEndpoint object. """ child = SystemInouttypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InOutType]: """ Performs a GET request against the /system/inOutTypes endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - InOutType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), InOutType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[InOutType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[InOutType]: """ Performs a GET request against the /system/inOutTypes endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[InOutType]: The parsed response data. """ - return self._parse_many( - InOutType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(InOutType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InOutType: """ Performs a POST request against the /system/inOutTypes endpoint. @@ -117,6 +83,4 @@ def post( Returns: InOutType: The parsed response data. """ - return self._parse_one( - InOutType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(InOutType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInouttypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInouttypesIdEndpoint.py index 1059e99b3..5a1b8da10 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInouttypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInouttypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemInouttypesIdInfoEndpoint import ( - SystemInouttypesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemInouttypesIdInfoEndpoint import SystemInouttypesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import InOutType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInouttypesIdEndpoint( ConnectWiseEndpoint, IGettable[InOutType, ConnectWiseManageRequestParams], - IPuttable[InOutType, ConnectWiseManageRequestParams], IPatchable[InOutType, ConnectWiseManageRequestParams], + IPuttable[InOutType, ConnectWiseManageRequestParams], IPaginateable[InOutType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, InOutType) - IPuttable.__init__(self, InOutType) IPatchable.__init__(self, InOutType) + IPuttable.__init__(self, InOutType) IPaginateable.__init__(self, InOutType) - self.info = self._register_child_endpoint( - SystemInouttypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemInouttypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InOutType]: """ Performs a GET request against the /system/inOutTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - InOutType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), InOutType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/inOutTypes/{id} endpoint. + Performs a DELETE request against the /system/inOutTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - InOutType: The parsed response data. """ - return self._parse_one( - InOutType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InOutType: """ - Performs a DELETE request against the /system/inOutTypes/{id} endpoint. + Performs a GET request against the /system/inOutTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + InOutType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(InOutType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> InOutType: """ - Performs a PUT request against the /system/inOutTypes/{id} endpoint. + Performs a PATCH request against the /system/inOutTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: InOutType: The parsed response data. """ - return self._parse_one( - InOutType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(InOutType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InOutType: """ - Performs a PATCH request against the /system/inOutTypes/{id} endpoint. + Performs a PUT request against the /system/inOutTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: InOutType: The parsed response data. """ - return self._parse_one( - InOutType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(InOutType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInouttypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInouttypesIdInfoEndpoint.py index e4ab24242..78919b474 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInouttypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInouttypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InOutTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInouttypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemInouttypesIdInfoEndpoint( IGettable[InOutTypeInfo, ConnectWiseManageRequestParams], IPaginateable[InOutTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, InOutTypeInfo) IPaginateable.__init__(self, InOutTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InOutTypeInfo]: """ Performs a GET request against the /system/inOutTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InOutTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InOutTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> InOutTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> InOutTypeInfo: """ Performs a GET request against the /system/inOutTypes/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: InOutTypeInfo: The parsed response data. """ - return self._parse_one( - InOutTypeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(InOutTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemInouttypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemInouttypesInfoEndpoint.py index b2d3e0e0e..f20740181 100644 --- a/src/pyconnectwise/endpoints/manage/SystemInouttypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemInouttypesInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import InOutTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemInouttypesInfoEndpoint( @@ -16,18 +15,13 @@ class SystemInouttypesInfoEndpoint( IGettable[list[InOutTypeInfo], ConnectWiseManageRequestParams], IPaginateable[InOutTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[InOutTypeInfo]) IPaginateable.__init__(self, InOutTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[InOutTypeInfo]: """ Performs a GET request against the /system/inOutTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - InOutTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), InOutTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[InOutTypeInfo]: """ Performs a GET request against the /system/inOutTypes/info endpoint. @@ -67,6 +54,4 @@ def get( Returns: list[InOutTypeInfo]: The parsed response data. """ - return self._parse_many( - InOutTypeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(InOutTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsCountEndpoint.py index 3af124857..2ac96f2da 100644 --- a/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemIntegratorloginsCountEndpoint( @@ -16,18 +15,13 @@ class SystemIntegratorloginsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/integratorlogins/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/integratorlogins/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsEndpoint.py index 170a02ade..00213d7bd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemIntegratorloginsCountEndpoint import ( - SystemIntegratorloginsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemIntegratorloginsIdEndpoint import ( - SystemIntegratorloginsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemIntegratorloginsCountEndpoint import SystemIntegratorloginsCountEndpoint +from pyconnectwise.endpoints.manage.SystemIntegratorloginsIdEndpoint import SystemIntegratorloginsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import IntegratorLogin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemIntegratorloginsEndpoint( @@ -24,36 +18,29 @@ class SystemIntegratorloginsEndpoint( IPostable[IntegratorLogin, ConnectWiseManageRequestParams], IPaginateable[IntegratorLogin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "integratorlogins", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "integratorlogins", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[IntegratorLogin]) IPostable.__init__(self, IntegratorLogin) IPaginateable.__init__(self, IntegratorLogin) - self.count = self._register_child_endpoint( - SystemIntegratorloginsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemIntegratorloginsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemIntegratorloginsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemIntegratorloginsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemIntegratorloginsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemIntegratorloginsIdEndpoint: The initialized SystemIntegratorloginsIdEndpoint object. """ child = SystemIntegratorloginsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[IntegratorLogin]: """ Performs a GET request against the /system/integratorlogins endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - IntegratorLogin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), IntegratorLogin, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[IntegratorLogin]: """ Performs a GET request against the /system/integratorlogins endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[IntegratorLogin]: The parsed response data. """ - return self._parse_many( - IntegratorLogin, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(IntegratorLogin, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorLogin: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> IntegratorLogin: """ Performs a POST request against the /system/integratorlogins endpoint. @@ -112,7 +85,4 @@ def post( Returns: IntegratorLogin: The parsed response data. """ - return self._parse_one( - IntegratorLogin, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(IntegratorLogin, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsIdEndpoint.py index b984d726e..64f7e5eef 100644 --- a/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemIntegratorloginsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import IntegratorLogin from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemIntegratorloginsIdEndpoint( ConnectWiseEndpoint, IGettable[IntegratorLogin, ConnectWiseManageRequestParams], - IPuttable[IntegratorLogin, ConnectWiseManageRequestParams], IPatchable[IntegratorLogin, ConnectWiseManageRequestParams], + IPuttable[IntegratorLogin, ConnectWiseManageRequestParams], IPaginateable[IntegratorLogin, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, IntegratorLogin) - IPuttable.__init__(self, IntegratorLogin) IPatchable.__init__(self, IntegratorLogin) + IPuttable.__init__(self, IntegratorLogin) IPaginateable.__init__(self, IntegratorLogin) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[IntegratorLogin]: """ Performs a GET request against the /system/integratorlogins/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - IntegratorLogin, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), IntegratorLogin, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorLogin: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/integratorlogins/{id} endpoint. + Performs a DELETE request against the /system/integratorlogins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - IntegratorLogin: The parsed response data. """ - return self._parse_one( - IntegratorLogin, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> IntegratorLogin: """ - Performs a DELETE request against the /system/integratorlogins/{id} endpoint. + Performs a GET request against the /system/integratorlogins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + IntegratorLogin: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(IntegratorLogin, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorLogin: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> IntegratorLogin: """ - Performs a PUT request against the /system/integratorlogins/{id} endpoint. + Performs a PATCH request against the /system/integratorlogins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: IntegratorLogin: The parsed response data. """ - return self._parse_one( - IntegratorLogin, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(IntegratorLogin, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorLogin: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> IntegratorLogin: """ - Performs a PATCH request against the /system/integratorlogins/{id} endpoint. + Performs a PUT request against the /system/integratorlogins/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: IntegratorLogin: The parsed response data. """ - return self._parse_one( - IntegratorLogin, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(IntegratorLogin, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemIntegratortagsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemIntegratortagsCountEndpoint.py index ad4e3e074..72b0e0904 100644 --- a/src/pyconnectwise/endpoints/manage/SystemIntegratortagsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemIntegratortagsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemIntegratortagsCountEndpoint( @@ -16,18 +15,13 @@ class SystemIntegratortagsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/integratorTags/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/integratorTags/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemIntegratortagsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemIntegratortagsEndpoint.py index f98ac0089..5f98c5417 100644 --- a/src/pyconnectwise/endpoints/manage/SystemIntegratortagsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemIntegratortagsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemIntegratortagsCountEndpoint import ( - SystemIntegratortagsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemIntegratortagsIdEndpoint import ( - SystemIntegratortagsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemIntegratortagsCountEndpoint import SystemIntegratortagsCountEndpoint +from pyconnectwise.endpoints.manage.SystemIntegratortagsIdEndpoint import SystemIntegratortagsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import IntegratorTag from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemIntegratortagsEndpoint( @@ -24,36 +18,29 @@ class SystemIntegratortagsEndpoint( IPostable[IntegratorTag, ConnectWiseManageRequestParams], IPaginateable[IntegratorTag, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "integratorTags", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "integratorTags", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[IntegratorTag]) IPostable.__init__(self, IntegratorTag) IPaginateable.__init__(self, IntegratorTag) - self.count = self._register_child_endpoint( - SystemIntegratortagsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemIntegratortagsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemIntegratortagsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemIntegratortagsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemIntegratortagsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemIntegratortagsIdEndpoint: The initialized SystemIntegratortagsIdEndpoint object. """ child = SystemIntegratortagsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[IntegratorTag]: """ Performs a GET request against the /system/integratorTags endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - IntegratorTag, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), IntegratorTag, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[IntegratorTag]: """ Performs a GET request against the /system/integratorTags endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[IntegratorTag]: The parsed response data. """ - return self._parse_many( - IntegratorTag, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(IntegratorTag, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorTag: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> IntegratorTag: """ Performs a POST request against the /system/integratorTags endpoint. @@ -111,7 +85,4 @@ def post( Returns: IntegratorTag: The parsed response data. """ - return self._parse_one( - IntegratorTag, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(IntegratorTag, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemIntegratortagsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemIntegratortagsIdEndpoint.py index 9197ed7be..e2603fc05 100644 --- a/src/pyconnectwise/endpoints/manage/SystemIntegratortagsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemIntegratortagsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import IntegratorTag from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemIntegratortagsIdEndpoint( ConnectWiseEndpoint, IGettable[IntegratorTag, ConnectWiseManageRequestParams], - IPuttable[IntegratorTag, ConnectWiseManageRequestParams], IPatchable[IntegratorTag, ConnectWiseManageRequestParams], + IPuttable[IntegratorTag, ConnectWiseManageRequestParams], IPaginateable[IntegratorTag, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, IntegratorTag) - IPuttable.__init__(self, IntegratorTag) IPatchable.__init__(self, IntegratorTag) + IPuttable.__init__(self, IntegratorTag) IPaginateable.__init__(self, IntegratorTag) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[IntegratorTag]: """ Performs a GET request against the /system/integratorTags/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - IntegratorTag, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), IntegratorTag, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorTag: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/integratorTags/{id} endpoint. + Performs a DELETE request against the /system/integratorTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - IntegratorTag: The parsed response data. """ - return self._parse_one( - IntegratorTag, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> IntegratorTag: """ - Performs a DELETE request against the /system/integratorTags/{id} endpoint. + Performs a GET request against the /system/integratorTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + IntegratorTag: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(IntegratorTag, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorTag: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> IntegratorTag: """ - Performs a PUT request against the /system/integratorTags/{id} endpoint. + Performs a PATCH request against the /system/integratorTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: IntegratorTag: The parsed response data. """ - return self._parse_one( - IntegratorTag, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(IntegratorTag, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> IntegratorTag: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> IntegratorTag: """ - Performs a PATCH request against the /system/integratorTags/{id} endpoint. + Performs a PUT request against the /system/integratorTags/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: IntegratorTag: The parsed response data. """ - return self._parse_one( - IntegratorTag, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(IntegratorTag, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemKpicategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemKpicategoriesCountEndpoint.py index 1862197ec..441d44e49 100644 --- a/src/pyconnectwise/endpoints/manage/SystemKpicategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemKpicategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemKpicategoriesCountEndpoint( @@ -16,18 +15,13 @@ class SystemKpicategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/kpiCategories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/kpiCategories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemKpicategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemKpicategoriesEndpoint.py index 41c102625..529098049 100644 --- a/src/pyconnectwise/endpoints/manage/SystemKpicategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemKpicategoriesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemKpicategoriesCountEndpoint import ( - SystemKpicategoriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemKpicategoriesIdEndpoint import ( - SystemKpicategoriesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemKpicategoriesCountEndpoint import SystemKpicategoriesCountEndpoint +from pyconnectwise.endpoints.manage.SystemKpicategoriesIdEndpoint import SystemKpicategoriesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import KPICategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemKpicategoriesEndpoint( @@ -22,35 +17,28 @@ class SystemKpicategoriesEndpoint( IGettable[list[KPICategory], ConnectWiseManageRequestParams], IPaginateable[KPICategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "kpiCategories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "kpiCategories", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[KPICategory]) IPaginateable.__init__(self, KPICategory) - self.count = self._register_child_endpoint( - SystemKpicategoriesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemKpicategoriesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemKpicategoriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemKpicategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemKpicategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemKpicategoriesIdEndpoint: The initialized SystemKpicategoriesIdEndpoint object. """ child = SystemKpicategoriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KPICategory]: """ Performs a GET request against the /system/kpiCategories endpoint and returns an initialized PaginatedResponse object. @@ -68,19 +56,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KPICategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KPICategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[KPICategory]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[KPICategory]: """ Performs a GET request against the /system/kpiCategories endpoint. @@ -90,6 +69,4 @@ def get( Returns: list[KPICategory]: The parsed response data. """ - return self._parse_many( - KPICategory, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(KPICategory, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemKpicategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemKpicategoriesIdEndpoint.py index 3eb590106..44e21a1d8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemKpicategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemKpicategoriesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import KPICategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemKpicategoriesIdEndpoint( @@ -16,18 +15,13 @@ class SystemKpicategoriesIdEndpoint( IGettable[KPICategory, ConnectWiseManageRequestParams], IPaginateable[KPICategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, KPICategory) IPaginateable.__init__(self, KPICategory) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KPICategory]: """ Performs a GET request against the /system/kpiCategories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - KPICategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), KPICategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> KPICategory: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> KPICategory: """ Performs a GET request against the /system/kpiCategories/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: KPICategory: The parsed response data. """ - return self._parse_one( - KPICategory, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(KPICategory, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemKpisCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemKpisCountEndpoint.py index 295c52791..863f9e449 100644 --- a/src/pyconnectwise/endpoints/manage/SystemKpisCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemKpisCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemKpisCountEndpoint( @@ -16,18 +15,13 @@ class SystemKpisCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/kpis/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/kpis/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemKpisEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemKpisEndpoint.py index c7b292da4..b593d54bf 100644 --- a/src/pyconnectwise/endpoints/manage/SystemKpisEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemKpisEndpoint.py @@ -1,18 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemKpisCountEndpoint import ( - SystemKpisCountEndpoint, -) +from pyconnectwise.endpoints.manage.SystemKpisCountEndpoint import SystemKpisCountEndpoint from pyconnectwise.endpoints.manage.SystemKpisIdEndpoint import SystemKpisIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import KPI from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemKpisEndpoint( @@ -20,35 +17,28 @@ class SystemKpisEndpoint( IGettable[list[KPI], ConnectWiseManageRequestParams], IPaginateable[KPI, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "kpis", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "kpis", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[KPI]) IPaginateable.__init__(self, KPI) - self.count = self._register_child_endpoint( - SystemKpisCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemKpisCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemKpisIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemKpisIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemKpisIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemKpisIdEndpoint: The initialized SystemKpisIdEndpoint object. """ child = SystemKpisIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KPI]: """ Performs a GET request against the /system/kpis endpoint and returns an initialized PaginatedResponse object. @@ -65,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - KPI, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), KPI, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[KPI]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[KPI]: """ Performs a GET request against the /system/kpis endpoint. @@ -88,6 +67,4 @@ def get( Returns: list[KPI]: The parsed response data. """ - return self._parse_many( - KPI, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(KPI, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemKpisIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemKpisIdEndpoint.py index 675417d48..634dd6f4c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemKpisIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemKpisIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import KPI from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemKpisIdEndpoint( @@ -16,18 +15,13 @@ class SystemKpisIdEndpoint( IGettable[KPI, ConnectWiseManageRequestParams], IPaginateable[KPI, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, KPI) IPaginateable.__init__(self, KPI) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[KPI]: """ Performs a GET request against the /system/kpis/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - KPI, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), KPI, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> KPI: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> KPI: """ Performs a GET request against the /system/kpis/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: KPI: The parsed response data. """ - return self._parse_one( - KPI, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(KPI, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsCountEndpoint.py index 2bc930e52..d8fff88cf 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLdapconfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemLdapconfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/ldapConfigurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/ldapConfigurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsEndpoint.py index 3dc88a04b..61757d14d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsEndpoint.py @@ -1,27 +1,19 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemLdapconfigurationsCountEndpoint import ( - SystemLdapconfigurationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemLdapconfigurationsIdEndpoint import ( - SystemLdapconfigurationsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemLdapconfigurationsInfoEndpoint import ( - SystemLdapconfigurationsInfoEndpoint, -) +from pyconnectwise.endpoints.manage.SystemLdapconfigurationsCountEndpoint import SystemLdapconfigurationsCountEndpoint +from pyconnectwise.endpoints.manage.SystemLdapconfigurationsIdEndpoint import SystemLdapconfigurationsIdEndpoint +from pyconnectwise.endpoints.manage.SystemLdapconfigurationsInfoEndpoint import SystemLdapconfigurationsInfoEndpoint from pyconnectwise.endpoints.manage.SystemLdapconfigurationsTestlinkEndpoint import ( SystemLdapconfigurationsTestlinkEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import LdapConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLdapconfigurationsEndpoint( @@ -30,42 +22,33 @@ class SystemLdapconfigurationsEndpoint( IPostable[LdapConfiguration, ConnectWiseManageRequestParams], IPaginateable[LdapConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ldapConfigurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ldapConfigurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LdapConfiguration]) IPostable.__init__(self, LdapConfiguration) IPaginateable.__init__(self, LdapConfiguration) - self.count = self._register_child_endpoint( - SystemLdapconfigurationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemLdapconfigurationsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemLdapconfigurationsInfoEndpoint(client, parent_endpoint=self)) self.test_link = self._register_child_endpoint( SystemLdapconfigurationsTestlinkEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - SystemLdapconfigurationsInfoEndpoint(client, parent_endpoint=self) - ) - def id(self, id: int) -> SystemLdapconfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemLdapconfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemLdapconfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemLdapconfigurationsIdEndpoint: The initialized SystemLdapconfigurationsIdEndpoint object. """ child = SystemLdapconfigurationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LdapConfiguration]: """ Performs a GET request against the /system/ldapConfigurations endpoint and returns an initialized PaginatedResponse object. @@ -83,18 +66,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LdapConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LdapConfiguration, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[LdapConfiguration]: """ Performs a GET request against the /system/ldapConfigurations endpoint. @@ -105,16 +81,9 @@ def get( Returns: list[LdapConfiguration]: The parsed response data. """ - return self._parse_many( - LdapConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(LdapConfiguration, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LdapConfiguration: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LdapConfiguration: """ Performs a POST request against the /system/ldapConfigurations endpoint. @@ -124,7 +93,4 @@ def post( Returns: LdapConfiguration: The parsed response data. """ - return self._parse_one( - LdapConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(LdapConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdEndpoint.py index 7afda46a7..c9e356239 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemLdapconfigurationsIdInfoEndpoint import ( - SystemLdapconfigurationsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemLdapconfigurationsIdInfoEndpoint import SystemLdapconfigurationsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import LdapConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLdapconfigurationsIdEndpoint( ConnectWiseEndpoint, IGettable[LdapConfiguration, ConnectWiseManageRequestParams], - IPuttable[LdapConfiguration, ConnectWiseManageRequestParams], IPatchable[LdapConfiguration, ConnectWiseManageRequestParams], + IPuttable[LdapConfiguration, ConnectWiseManageRequestParams], IPaginateable[LdapConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LdapConfiguration) - IPuttable.__init__(self, LdapConfiguration) IPatchable.__init__(self, LdapConfiguration) + IPuttable.__init__(self, LdapConfiguration) IPaginateable.__init__(self, LdapConfiguration) - self.info = self._register_child_endpoint( - SystemLdapconfigurationsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemLdapconfigurationsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LdapConfiguration]: """ Performs a GET request against the /system/ldapConfigurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LdapConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LdapConfiguration, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LdapConfiguration: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/ldapConfigurations/{id} endpoint. + Performs a DELETE request against the /system/ldapConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - LdapConfiguration: The parsed response data. """ - return self._parse_one( - LdapConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LdapConfiguration: """ - Performs a DELETE request against the /system/ldapConfigurations/{id} endpoint. + Performs a GET request against the /system/ldapConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + LdapConfiguration: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(LdapConfiguration, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LdapConfiguration: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> LdapConfiguration: """ - Performs a PUT request against the /system/ldapConfigurations/{id} endpoint. + Performs a PATCH request against the /system/ldapConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +81,11 @@ def put( Returns: LdapConfiguration: The parsed response data. """ - return self._parse_one( - LdapConfiguration, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(LdapConfiguration, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> LdapConfiguration: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LdapConfiguration: """ - Performs a PATCH request against the /system/ldapConfigurations/{id} endpoint. + Performs a PUT request against the /system/ldapConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +93,4 @@ def patch( Returns: LdapConfiguration: The parsed response data. """ - return self._parse_one( - LdapConfiguration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(LdapConfiguration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdInfoEndpoint.py index 05a0580a7..b9c5217b2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LdapConfigurationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLdapconfigurationsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemLdapconfigurationsIdInfoEndpoint( IGettable[LdapConfigurationInfo, ConnectWiseManageRequestParams], IPaginateable[LdapConfigurationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, LdapConfigurationInfo) IPaginateable.__init__(self, LdapConfigurationInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LdapConfigurationInfo]: """ Performs a GET request against the /system/ldapConfigurations/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LdapConfigurationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LdapConfigurationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> LdapConfigurationInfo: """ Performs a GET request against the /system/ldapConfigurations/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: LdapConfigurationInfo: The parsed response data. """ - return self._parse_one( - LdapConfigurationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(LdapConfigurationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoCountEndpoint.py index b45bdd68d..0a0d0352d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLdapconfigurationsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemLdapconfigurationsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/ldapConfigurations/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/ldapConfigurations/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoEndpoint.py index 26f649b57..513f6a769 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemLdapconfigurationsInfoCountEndpoint import ( SystemLdapconfigurationsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LdapConfigurationInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLdapconfigurationsInfoEndpoint( @@ -19,10 +18,8 @@ class SystemLdapconfigurationsInfoEndpoint( IGettable[list[LdapConfigurationInfo], ConnectWiseManageRequestParams], IPaginateable[LdapConfigurationInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LdapConfigurationInfo]) IPaginateable.__init__(self, LdapConfigurationInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LdapConfigurationInfo]: """ Performs a GET request against the /system/ldapConfigurations/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LdapConfigurationInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LdapConfigurationInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[LdapConfigurationInfo]: """ Performs a GET request against the /system/ldapConfigurations/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[LdapConfigurationInfo]: The parsed response data. """ - return self._parse_many( - LdapConfigurationInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(LdapConfigurationInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsTestlinkEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsTestlinkEndpoint.py index 00a99a77e..d0c11d40f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsTestlinkEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLdapconfigurationsTestlinkEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLdapconfigurationsTestlinkEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testLink", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testLink", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/ldapConfigurations/testLink endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLinksCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLinksCountEndpoint.py index f0b4625c2..16dd9581f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLinksCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLinksCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLinksCountEndpoint( @@ -16,18 +15,13 @@ class SystemLinksCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/links/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/links/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLinksEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLinksEndpoint.py index f5d3ee440..bc590a03a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLinksEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLinksEndpoint.py @@ -1,19 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemLinksCountEndpoint import ( - SystemLinksCountEndpoint, -) +from pyconnectwise.endpoints.manage.SystemLinksCountEndpoint import SystemLinksCountEndpoint from pyconnectwise.endpoints.manage.SystemLinksIdEndpoint import SystemLinksIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Link from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLinksEndpoint( @@ -22,36 +18,29 @@ class SystemLinksEndpoint( IPostable[Link, ConnectWiseManageRequestParams], IPaginateable[Link, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "links", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "links", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Link]) IPostable.__init__(self, Link) IPaginateable.__init__(self, Link) - self.count = self._register_child_endpoint( - SystemLinksCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemLinksCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemLinksIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemLinksIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemLinksIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemLinksIdEndpoint: The initialized SystemLinksIdEndpoint object. """ child = SystemLinksIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Link]: """ Performs a GET request against the /system/links endpoint and returns an initialized PaginatedResponse object. @@ -68,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Link, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Link, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Link]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Link]: """ Performs a GET request against the /system/links endpoint. @@ -91,15 +69,9 @@ def get( Returns: list[Link]: The parsed response data. """ - return self._parse_many( - Link, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Link, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Link: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Link: """ Performs a POST request against the /system/links endpoint. @@ -109,6 +81,4 @@ def post( Returns: Link: The parsed response data. """ - return self._parse_one( - Link, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Link, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLinksIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLinksIdEndpoint.py index 5f35ed4d4..8baead84f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLinksIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLinksIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Link from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLinksIdEndpoint( ConnectWiseEndpoint, IGettable[Link, ConnectWiseManageRequestParams], - IPuttable[Link, ConnectWiseManageRequestParams], IPatchable[Link, ConnectWiseManageRequestParams], + IPuttable[Link, ConnectWiseManageRequestParams], IPaginateable[Link, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Link) - IPuttable.__init__(self, Link) IPatchable.__init__(self, Link) + IPuttable.__init__(self, Link) IPaginateable.__init__(self, Link) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Link]: """ Performs a GET request against the /system/links/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Link, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Link, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Link: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/links/{id} endpoint. + Performs a DELETE request against the /system/links/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Link: The parsed response data. """ - return self._parse_one( - Link, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Link: """ - Performs a DELETE request against the /system/links/{id} endpoint. + Performs a GET request against the /system/links/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Link: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Link, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Link: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Link: """ - Performs a PUT request against the /system/links/{id} endpoint. + Performs a PATCH request against the /system/links/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: Link: The parsed response data. """ - return self._parse_one( - Link, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Link, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Link: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Link: """ - Performs a PATCH request against the /system/links/{id} endpoint. + Performs a PUT request against the /system/links/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: Link: The parsed response data. """ - return self._parse_one( - Link, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Link, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsCountEndpoint.py index ad5f0b7b2..65fd13f64 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemLocationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/locations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/locations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsEndpoint.py index e0fa335f9..0c4b8f172 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemLocationsCountEndpoint import ( - SystemLocationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemLocationsIdEndpoint import ( - SystemLocationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemLocationsCountEndpoint import SystemLocationsCountEndpoint +from pyconnectwise.endpoints.manage.SystemLocationsIdEndpoint import SystemLocationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Location from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsEndpoint( @@ -24,36 +18,29 @@ class SystemLocationsEndpoint( IPostable[Location, ConnectWiseManageRequestParams], IPaginateable[Location, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "locations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "locations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Location]) IPostable.__init__(self, Location) IPaginateable.__init__(self, Location) - self.count = self._register_child_endpoint( - SystemLocationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemLocationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemLocationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemLocationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemLocationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemLocationsIdEndpoint: The initialized SystemLocationsIdEndpoint object. """ child = SystemLocationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Location]: """ Performs a GET request against the /system/locations endpoint and returns an initialized PaginatedResponse object. @@ -70,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Location, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Location, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Location]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Location]: """ Performs a GET request against the /system/locations endpoint. @@ -93,15 +69,9 @@ def get( Returns: list[Location]: The parsed response data. """ - return self._parse_many( - Location, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Location, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Location: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Location: """ Performs a POST request against the /system/locations endpoint. @@ -111,6 +81,4 @@ def post( Returns: Location: The parsed response data. """ - return self._parse_one( - Location, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Location, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsCountEndpoint.py index 2e34b132f..ebfd4b878 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdDepartmentsCountEndpoint( @@ -16,18 +15,13 @@ class SystemLocationsIdDepartmentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/locations/{id}/departments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/locations/{id}/departments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsEndpoint.py index 9515145c1..c522d3060 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemLocationsIdDepartmentsCountEndpoint import ( SystemLocationsIdDepartmentsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemLocationsIdDepartmentsIdEndpoint import ( - SystemLocationsIdDepartmentsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemLocationsIdDepartmentsIdEndpoint import SystemLocationsIdDepartmentsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocationDepartment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdDepartmentsEndpoint( @@ -22,10 +19,8 @@ class SystemLocationsIdDepartmentsEndpoint( IGettable[list[LocationDepartment], ConnectWiseManageRequestParams], IPaginateable[LocationDepartment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "departments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "departments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LocationDepartment]) IPaginateable.__init__(self, LocationDepartment) @@ -33,26 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemLocationsIdDepartmentsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemLocationsIdDepartmentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemLocationsIdDepartmentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemLocationsIdDepartmentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemLocationsIdDepartmentsIdEndpoint: The initialized SystemLocationsIdDepartmentsIdEndpoint object. """ - child = SystemLocationsIdDepartmentsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemLocationsIdDepartmentsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocationDepartment]: """ Performs a GET request against the /system/locations/{id}/departments endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LocationDepartment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LocationDepartment, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[LocationDepartment]: """ Performs a GET request against the /system/locations/{id}/departments endpoint. @@ -92,7 +75,4 @@ def get( Returns: list[LocationDepartment]: The parsed response data. """ - return self._parse_many( - LocationDepartment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(LocationDepartment, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsIdEndpoint.py index 10adba176..542c1948c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdDepartmentsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocationDepartment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdDepartmentsIdEndpoint( @@ -16,18 +15,13 @@ class SystemLocationsIdDepartmentsIdEndpoint( IGettable[LocationDepartment, ConnectWiseManageRequestParams], IPaginateable[LocationDepartment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LocationDepartment) IPaginateable.__init__(self, LocationDepartment) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocationDepartment]: """ Performs a GET request against the /system/locations/{id}/departments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LocationDepartment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LocationDepartment, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LocationDepartment: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LocationDepartment: """ Performs a GET request against the /system/locations/{id}/departments/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: LocationDepartment: The parsed response data. """ - return self._parse_one( - LocationDepartment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(LocationDepartment, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdEndpoint.py index d4b80618e..6def99651 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdEndpoint.py @@ -1,59 +1,42 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemLocationsIdDepartmentsEndpoint import ( - SystemLocationsIdDepartmentsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemLocationsIdUsagesEndpoint import ( - SystemLocationsIdUsagesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemLocationsIdWorkrolesEndpoint import ( - SystemLocationsIdWorkrolesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemLocationsIdDepartmentsEndpoint import SystemLocationsIdDepartmentsEndpoint +from pyconnectwise.endpoints.manage.SystemLocationsIdUsagesEndpoint import SystemLocationsIdUsagesEndpoint +from pyconnectwise.endpoints.manage.SystemLocationsIdWorkrolesEndpoint import SystemLocationsIdWorkrolesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Location from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdEndpoint( ConnectWiseEndpoint, IGettable[Location, ConnectWiseManageRequestParams], - IPuttable[Location, ConnectWiseManageRequestParams], IPatchable[Location, ConnectWiseManageRequestParams], + IPuttable[Location, ConnectWiseManageRequestParams], IPaginateable[Location, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Location) - IPuttable.__init__(self, Location) IPatchable.__init__(self, Location) + IPuttable.__init__(self, Location) IPaginateable.__init__(self, Location) - self.usages = self._register_child_endpoint( - SystemLocationsIdUsagesEndpoint(client, parent_endpoint=self) + self.departments = self._register_child_endpoint( + SystemLocationsIdDepartmentsEndpoint(client, parent_endpoint=self) ) + self.usages = self._register_child_endpoint(SystemLocationsIdUsagesEndpoint(client, parent_endpoint=self)) self.work_roles = self._register_child_endpoint( SystemLocationsIdWorkrolesEndpoint(client, parent_endpoint=self) ) - self.departments = self._register_child_endpoint( - SystemLocationsIdDepartmentsEndpoint(client, parent_endpoint=self) - ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Location]: """ Performs a GET request against the /system/locations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -70,54 +53,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Location, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Location, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Location: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/locations/{id} endpoint. + Performs a DELETE request against the /system/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Location: The parsed response data. """ - return self._parse_one( - Location, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Location: """ - Performs a DELETE request against the /system/locations/{id} endpoint. + Performs a GET request against the /system/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Location: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Location, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Location: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Location: """ - Performs a PUT request against the /system/locations/{id} endpoint. + Performs a PATCH request against the /system/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +87,11 @@ def put( Returns: Location: The parsed response data. """ - return self._parse_one( - Location, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Location, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Location: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Location: """ - Performs a PATCH request against the /system/locations/{id} endpoint. + Performs a PUT request against the /system/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,6 +99,4 @@ def patch( Returns: Location: The parsed response data. """ - return self._parse_one( - Location, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Location, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesEndpoint.py index 02951f51f..91ac378ff 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemLocationsIdUsagesListEndpoint import ( - SystemLocationsIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemLocationsIdUsagesListEndpoint import SystemLocationsIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdUsagesEndpoint( @@ -19,22 +16,15 @@ class SystemLocationsIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - SystemLocationsIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(SystemLocationsIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/locations/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/locations/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesListEndpoint.py index 3559b90a8..b837101ff 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SystemLocationsIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/locations/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/locations/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesCountEndpoint.py index dd03f0a91..c2e52d29b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdWorkrolesCountEndpoint( @@ -16,18 +15,13 @@ class SystemLocationsIdWorkrolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/locations/{id}/workRoles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/locations/{id}/workRoles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesEndpoint.py index 23ef23471..0b68f41c6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemLocationsIdWorkrolesCountEndpoint import ( SystemLocationsIdWorkrolesCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemLocationsIdWorkrolesIdEndpoint import ( - SystemLocationsIdWorkrolesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemLocationsIdWorkrolesIdEndpoint import SystemLocationsIdWorkrolesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocationWorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdWorkrolesEndpoint( @@ -22,10 +19,8 @@ class SystemLocationsIdWorkrolesEndpoint( IGettable[list[LocationWorkRole], ConnectWiseManageRequestParams], IPaginateable[LocationWorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workRoles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workRoles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[LocationWorkRole]) IPaginateable.__init__(self, LocationWorkRole) @@ -33,24 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemLocationsIdWorkrolesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemLocationsIdWorkrolesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemLocationsIdWorkrolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemLocationsIdWorkrolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemLocationsIdWorkrolesIdEndpoint: The initialized SystemLocationsIdWorkrolesIdEndpoint object. """ child = SystemLocationsIdWorkrolesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocationWorkRole]: """ Performs a GET request against the /system/locations/{id}/workRoles endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LocationWorkRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LocationWorkRole, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[LocationWorkRole]: """ Performs a GET request against the /system/locations/{id}/workRoles endpoint. @@ -90,7 +75,4 @@ def get( Returns: list[LocationWorkRole]: The parsed response data. """ - return self._parse_many( - LocationWorkRole, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(LocationWorkRole, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesIdEndpoint.py index 90242360d..7e1bdf571 100644 --- a/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemLocationsIdWorkrolesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import LocationWorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemLocationsIdWorkrolesIdEndpoint( @@ -16,18 +15,13 @@ class SystemLocationsIdWorkrolesIdEndpoint( IGettable[LocationWorkRole, ConnectWiseManageRequestParams], IPaginateable[LocationWorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, LocationWorkRole) IPaginateable.__init__(self, LocationWorkRole) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[LocationWorkRole]: """ Performs a GET request against the /system/locations/{id}/workRoles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - LocationWorkRole, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), LocationWorkRole, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> LocationWorkRole: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> LocationWorkRole: """ Performs a GET request against the /system/locations/{id}/workRoles/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: LocationWorkRole: The parsed response data. """ - return self._parse_one( - LocationWorkRole, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(LocationWorkRole, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncAuthorizeEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncAuthorizeEndpoint.py index cfb609f6e..94f4a4bd6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncAuthorizeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncAuthorizeEndpoint.py @@ -3,6 +3,4 @@ class SystemM365contactsyncAuthorizeEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "authorize", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "authorize", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncCheckvalidsyncEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncCheckvalidsyncEndpoint.py index cd163b2e3..9403c66ca 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncCheckvalidsyncEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncCheckvalidsyncEndpoint.py @@ -13,9 +13,7 @@ class SystemM365contactsyncCheckvalidsyncEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "checkvalidsync", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "checkvalidsync", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) def post( diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncEndpoint.py index ba0f326f2..00ff0b70a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncEndpoint.py @@ -21,20 +21,14 @@ class SystemM365contactsyncEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "m365contactsync", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "m365contactsync", parent_endpoint=parent_endpoint) - self.info = self._register_child_endpoint( - SystemM365contactsyncInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemM365contactsyncInfoEndpoint(client, parent_endpoint=self)) self.authorize = self._register_child_endpoint( SystemM365contactsyncAuthorizeEndpoint(client, parent_endpoint=self) ) self.notifydeactivation = self._register_child_endpoint( - SystemM365contactsyncNotifydeactivationEndpoint( - client, parent_endpoint=self - ) + SystemM365contactsyncNotifydeactivationEndpoint(client, parent_endpoint=self) ) self.notifyerror = self._register_child_endpoint( SystemM365contactsyncNotifyerrorEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdEndpoint.py index 28930ee94..178868028 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdEndpoint.py @@ -12,16 +12,10 @@ class SystemM365contactsyncIdEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - self.test = self._register_child_endpoint( - SystemM365contactsyncIdTestEndpoint(client, parent_endpoint=self) - ) + self.test = self._register_child_endpoint(SystemM365contactsyncIdTestEndpoint(client, parent_endpoint=self)) self.viewauth = self._register_child_endpoint( SystemM365contactsyncIdViewauthEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - SystemM365contactsyncIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemM365contactsyncIdInfoEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdInfoEndpoint.py index d9f94fa6f..47b0ae0a9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdInfoEndpoint.py @@ -17,9 +17,7 @@ class SystemM365contactsyncIdInfoEndpoint( IPaginateable[M365ContactSyncInfo, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, M365ContactSyncInfo) IPaginateable.__init__(self, M365ContactSyncInfo) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdTestEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdTestEndpoint.py index 1eee6f199..c6ac00f7f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdTestEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdTestEndpoint.py @@ -3,6 +3,4 @@ class SystemM365contactsyncIdTestEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "test", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "test", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdViewauthEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdViewauthEndpoint.py index eee0a3ab1..369cdd31c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdViewauthEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncIdViewauthEndpoint.py @@ -3,6 +3,4 @@ class SystemM365contactsyncIdViewauthEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "viewauth", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "viewauth", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoCountEndpoint.py index ad43090aa..5795c1485 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoCountEndpoint.py @@ -17,9 +17,7 @@ class SystemM365contactsyncInfoCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoEndpoint.py index 955608952..3ac4e087e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncInfoEndpoint.py @@ -20,15 +20,11 @@ class SystemM365contactsyncInfoEndpoint( IPaginateable[M365ContactSyncInfo, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[M365ContactSyncInfo]) IPaginateable.__init__(self, M365ContactSyncInfo) - self.count = self._register_child_endpoint( - SystemM365contactsyncInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemM365contactsyncInfoCountEndpoint(client, parent_endpoint=self)) def paginated( self, diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifydeactivationEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifydeactivationEndpoint.py index 6a5dc1369..00f21acbe 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifydeactivationEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifydeactivationEndpoint.py @@ -13,9 +13,7 @@ class SystemM365contactsyncNotifydeactivationEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifydeactivation", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "notifydeactivation", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) def post( diff --git a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifyerrorEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifyerrorEndpoint.py index d726ff5e5..8c815fab0 100644 --- a/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifyerrorEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemM365contactsyncNotifyerrorEndpoint.py @@ -13,9 +13,7 @@ class SystemM365contactsyncNotifyerrorEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifyerror", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "notifyerror", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) def post( diff --git a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesCountEndpoint.py index 185f70a2e..41669386c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemManagementnetworksecuritiesCountEndpoint( @@ -16,18 +15,13 @@ class SystemManagementnetworksecuritiesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/managementNetworkSecurities/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/managementNetworkSecurities/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesEndpoint.py index 70d75d064..573ddc292 100644 --- a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemManagementnetworksecuritiesCountEndpoint import ( SystemManagementnetworksecuritiesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemManagementnetworksecuritiesIdEndpoint import ( SystemManagementnetworksecuritiesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ManagementNetworkSecurity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemManagementnetworksecuritiesEndpoint( @@ -24,10 +22,8 @@ class SystemManagementnetworksecuritiesEndpoint( IPostable[ManagementNetworkSecurity, ConnectWiseManageRequestParams], IPaginateable[ManagementNetworkSecurity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managementNetworkSecurities", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managementNetworkSecurities", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagementNetworkSecurity]) IPostable.__init__(self, ManagementNetworkSecurity) IPaginateable.__init__(self, ManagementNetworkSecurity) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemManagementnetworksecuritiesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemManagementnetworksecuritiesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemManagementnetworksecuritiesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemManagementnetworksecuritiesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemManagementnetworksecuritiesIdEndpoint: The initialized SystemManagementnetworksecuritiesIdEndpoint object. """ - child = SystemManagementnetworksecuritiesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemManagementnetworksecuritiesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementNetworkSecurity]: """ Performs a GET request against the /system/managementNetworkSecurities endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementNetworkSecurity, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementNetworkSecurity, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagementNetworkSecurity]: """ Performs a GET request against the /system/managementNetworkSecurities endpoint. @@ -96,14 +80,11 @@ def get( list[ManagementNetworkSecurity]: The parsed response data. """ return self._parse_many( - ManagementNetworkSecurity, - super()._make_request("GET", data=data, params=params).json(), + ManagementNetworkSecurity, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementNetworkSecurity: """ Performs a POST request against the /system/managementNetworkSecurities endpoint. @@ -115,6 +96,5 @@ def post( ManagementNetworkSecurity: The parsed response data. """ return self._parse_one( - ManagementNetworkSecurity, - super()._make_request("POST", data=data, params=params).json(), + ManagementNetworkSecurity, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdEndpoint.py index b8bfeb0a9..1a8034c91 100644 --- a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemManagementnetworksecuritiesIdTestcredentialsEndpoint import ( SystemManagementnetworksecuritiesIdTestcredentialsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ManagementNetworkSecurity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemManagementnetworksecuritiesIdEndpoint( ConnectWiseEndpoint, IGettable[ManagementNetworkSecurity, ConnectWiseManageRequestParams], - IPuttable[ManagementNetworkSecurity, ConnectWiseManageRequestParams], IPatchable[ManagementNetworkSecurity, ConnectWiseManageRequestParams], + IPuttable[ManagementNetworkSecurity, ConnectWiseManageRequestParams], IPaginateable[ManagementNetworkSecurity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ManagementNetworkSecurity) - IPuttable.__init__(self, ManagementNetworkSecurity) IPatchable.__init__(self, ManagementNetworkSecurity) + IPuttable.__init__(self, ManagementNetworkSecurity) IPaginateable.__init__(self, ManagementNetworkSecurity) self.test_credentials = self._register_child_endpoint( - SystemManagementnetworksecuritiesIdTestcredentialsEndpoint( - client, parent_endpoint=self - ) + SystemManagementnetworksecuritiesIdTestcredentialsEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagementNetworkSecurity]: """ Performs a GET request against the /system/managementNetworkSecurities/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,54 +50,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagementNetworkSecurity, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagementNetworkSecurity, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ManagementNetworkSecurity: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/managementNetworkSecurities/{id} endpoint. + Performs a DELETE request against the /system/managementNetworkSecurities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ManagementNetworkSecurity: The parsed response data. """ - return self._parse_one( - ManagementNetworkSecurity, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ManagementNetworkSecurity: """ - Performs a DELETE request against the /system/managementNetworkSecurities/{id} endpoint. + Performs a GET request against the /system/managementNetworkSecurities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ManagementNetworkSecurity: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ManagementNetworkSecurity, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ManagementNetworkSecurity: """ - Performs a PUT request against the /system/managementNetworkSecurities/{id} endpoint. + Performs a PATCH request against the /system/managementNetworkSecurities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -117,17 +90,14 @@ def put( ManagementNetworkSecurity: The parsed response data. """ return self._parse_one( - ManagementNetworkSecurity, - super()._make_request("PUT", data=data, params=params).json(), + ManagementNetworkSecurity, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ManagementNetworkSecurity: """ - Performs a PATCH request against the /system/managementNetworkSecurities/{id} endpoint. + Performs a PUT request against the /system/managementNetworkSecurities/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -135,7 +105,4 @@ def patch( Returns: ManagementNetworkSecurity: The parsed response data. """ - return self._parse_one( - ManagementNetworkSecurity, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ManagementNetworkSecurity, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdTestcredentialsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdTestcredentialsEndpoint.py index 6e836f964..b2159a78a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdTestcredentialsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemManagementnetworksecuritiesIdTestcredentialsEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SuccessResponse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemManagementnetworksecuritiesIdTestcredentialsEndpoint( @@ -16,18 +15,13 @@ class SystemManagementnetworksecuritiesIdTestcredentialsEndpoint( IGettable[SuccessResponse, ConnectWiseManageRequestParams], IPaginateable[SuccessResponse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testCredentials", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testCredentials", parent_endpoint=parent_endpoint) IGettable.__init__(self, SuccessResponse) IPaginateable.__init__(self, SuccessResponse) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SuccessResponse]: """ Performs a GET request against the /system/managementNetworkSecurities/{id}/testCredentials endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SuccessResponse, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SuccessResponse, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a GET request against the /system/managementNetworkSecurities/{id}/testCredentials endpoint. @@ -67,7 +52,4 @@ def get( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportEndpoint.py index 3b20f1e65..710c8d6d5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportEndpoint.py @@ -1,21 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMarketplaceimportGetdefinitionEndpoint import ( SystemMarketplaceimportGetdefinitionEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMarketplaceimportImportEndpoint import ( - SystemMarketplaceimportImportEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMarketplaceimportImportEndpoint import SystemMarketplaceimportImportEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMarketplaceimportEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "marketplaceimport", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "marketplaceimport", parent_endpoint=parent_endpoint) - self.import_ = self._register_child_endpoint( - SystemMarketplaceimportImportEndpoint(client, parent_endpoint=self) - ) self.getdefinition = self._register_child_endpoint( SystemMarketplaceimportGetdefinitionEndpoint(client, parent_endpoint=self) ) + self.import_ = self._register_child_endpoint( + SystemMarketplaceimportImportEndpoint(client, parent_endpoint=self) + ) diff --git a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionEndpoint.py index 8431a8f8a..29a8794f9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionEndpoint.py @@ -1,28 +1,27 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMarketplaceimportGetdefinitionIdEndpoint import ( SystemMarketplaceimportGetdefinitionIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemMarketplaceimportGetdefinitionEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "getdefinition", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "getdefinition", parent_endpoint=parent_endpoint) - def id( - self, id: int # noqa: A002 - ) -> SystemMarketplaceimportGetdefinitionIdEndpoint: + def id(self, _id: int) -> SystemMarketplaceimportGetdefinitionIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMarketplaceimportGetdefinitionIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMarketplaceimportGetdefinitionIdEndpoint: The initialized SystemMarketplaceimportGetdefinitionIdEndpoint object. """ - child = SystemMarketplaceimportGetdefinitionIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMarketplaceimportGetdefinitionIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionIdEndpoint.py index 5deed6d0c..f1e27389b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportGetdefinitionIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MarketplaceImport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMarketplaceimportGetdefinitionIdEndpoint( @@ -16,18 +15,13 @@ class SystemMarketplaceimportGetdefinitionIdEndpoint( IGettable[MarketplaceImport, ConnectWiseManageRequestParams], IPaginateable[MarketplaceImport, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MarketplaceImport) IPaginateable.__init__(self, MarketplaceImport) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MarketplaceImport]: """ Performs a GET request against the /system/marketplaceimport/getdefinition/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MarketplaceImport, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MarketplaceImport, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketplaceImport: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketplaceImport: """ Performs a GET request against the /system/marketplaceimport/getdefinition/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: MarketplaceImport: The parsed response data. """ - return self._parse_one( - MarketplaceImport, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(MarketplaceImport, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportImportEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportImportEndpoint.py index 1e33c9619..5dd0a6419 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportImportEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMarketplaceimportImportEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import MarketplaceImport -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMarketplaceimportImportEndpoint( ConnectWiseEndpoint, IPostable[MarketplaceImport, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "import", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "import", parent_endpoint=parent_endpoint) IPostable.__init__(self, MarketplaceImport) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MarketplaceImport: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MarketplaceImport: """ Performs a POST request against the /system/marketplaceimport/import endpoint. @@ -32,7 +26,4 @@ def post( Returns: MarketplaceImport: The parsed response data. """ - return self._parse_one( - MarketplaceImport, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MarketplaceImport, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersCountEndpoint.py index 28063a0a6..078c3ec71 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersEndpoint.py index 497a8dc5b..07c7509e4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersEndpoint.py @@ -1,27 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersCountEndpoint import ( - SystemMembersCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdEndpoint import ( - SystemMembersIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersTypesEndpoint import ( - SystemMembersTypesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersWithssoEndpoint import ( - SystemMembersWithssoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMembersCountEndpoint import SystemMembersCountEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdEndpoint import SystemMembersIdEndpoint +from pyconnectwise.endpoints.manage.SystemMembersTypesEndpoint import SystemMembersTypesEndpoint +from pyconnectwise.endpoints.manage.SystemMembersWithssoEndpoint import SystemMembersWithssoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Member from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersEndpoint( @@ -30,42 +20,31 @@ class SystemMembersEndpoint( IPostable[Member, ConnectWiseManageRequestParams], IPaginateable[Member, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "members", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "members", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Member]) IPostable.__init__(self, Member) IPaginateable.__init__(self, Member) - self.count = self._register_child_endpoint( - SystemMembersCountEndpoint(client, parent_endpoint=self) - ) - self.types = self._register_child_endpoint( - SystemMembersTypesEndpoint(client, parent_endpoint=self) - ) - self.with_sso = self._register_child_endpoint( - SystemMembersWithssoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMembersCountEndpoint(client, parent_endpoint=self)) + self.types = self._register_child_endpoint(SystemMembersTypesEndpoint(client, parent_endpoint=self)) + self.with_sso = self._register_child_endpoint(SystemMembersWithssoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMembersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdEndpoint: The initialized SystemMembersIdEndpoint object. """ child = SystemMembersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Member]: """ Performs a GET request against the /system/members endpoint and returns an initialized PaginatedResponse object. @@ -82,20 +61,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Member, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Member, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Member]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Member]: """ Performs a GET request against the /system/members endpoint. @@ -105,15 +73,9 @@ def get( Returns: list[Member]: The parsed response data. """ - return self._parse_many( - Member, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Member, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Member: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Member: """ Performs a POST request against the /system/members endpoint. @@ -123,6 +85,4 @@ def post( Returns: Member: The parsed response data. """ - return self._parse_one( - Member, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Member, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsCountEndpoint.py index 84b892d0e..6e379e7ca 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdAccrualsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdAccrualsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/{id}/accruals/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/{id}/accruals/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsEndpoint.py index 8e18f9d7d..2a6be493d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersIdAccrualsCountEndpoint import ( - SystemMembersIdAccrualsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdAccrualsIdEndpoint import ( - SystemMembersIdAccrualsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMembersIdAccrualsCountEndpoint import SystemMembersIdAccrualsCountEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdAccrualsIdEndpoint import SystemMembersIdAccrualsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberAccrual from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdAccrualsEndpoint( @@ -24,36 +18,29 @@ class SystemMembersIdAccrualsEndpoint( IPostable[MemberAccrual, ConnectWiseManageRequestParams], IPaginateable[MemberAccrual, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "accruals", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "accruals", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberAccrual]) IPostable.__init__(self, MemberAccrual) IPaginateable.__init__(self, MemberAccrual) - self.count = self._register_child_endpoint( - SystemMembersIdAccrualsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMembersIdAccrualsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMembersIdAccrualsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersIdAccrualsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdAccrualsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdAccrualsIdEndpoint: The initialized SystemMembersIdAccrualsIdEndpoint object. """ child = SystemMembersIdAccrualsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberAccrual]: """ Performs a GET request against the /system/members/{id}/accruals endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberAccrual, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberAccrual, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberAccrual]: """ Performs a GET request against the /system/members/{id}/accruals endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[MemberAccrual]: The parsed response data. """ - return self._parse_many( - MemberAccrual, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(MemberAccrual, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberAccrual: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberAccrual: """ Performs a POST request against the /system/members/{id}/accruals endpoint. @@ -111,7 +85,4 @@ def post( Returns: MemberAccrual: The parsed response data. """ - return self._parse_one( - MemberAccrual, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MemberAccrual, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsIdEndpoint.py index c403297ce..32aaf9356 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdAccrualsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberAccrual from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdAccrualsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberAccrual, ConnectWiseManageRequestParams], - IPuttable[MemberAccrual, ConnectWiseManageRequestParams], IPatchable[MemberAccrual, ConnectWiseManageRequestParams], + IPuttable[MemberAccrual, ConnectWiseManageRequestParams], IPaginateable[MemberAccrual, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberAccrual) - IPuttable.__init__(self, MemberAccrual) IPatchable.__init__(self, MemberAccrual) + IPuttable.__init__(self, MemberAccrual) IPaginateable.__init__(self, MemberAccrual) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberAccrual]: """ Performs a GET request against the /system/members/{id}/accruals/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberAccrual, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberAccrual, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberAccrual: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/members/{id}/accruals/{id} endpoint. + Performs a DELETE request against the /system/members/{id}/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberAccrual: The parsed response data. """ - return self._parse_one( - MemberAccrual, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberAccrual: """ - Performs a DELETE request against the /system/members/{id}/accruals/{id} endpoint. + Performs a GET request against the /system/members/{id}/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberAccrual: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberAccrual, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberAccrual: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MemberAccrual: """ - Performs a PUT request against the /system/members/{id}/accruals/{id} endpoint. + Performs a PATCH request against the /system/members/{id}/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: MemberAccrual: The parsed response data. """ - return self._parse_one( - MemberAccrual, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(MemberAccrual, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberAccrual: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberAccrual: """ - Performs a PATCH request against the /system/members/{id}/accruals/{id} endpoint. + Performs a PUT request against the /system/members/{id}/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: MemberAccrual: The parsed response data. """ - return self._parse_one( - MemberAccrual, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MemberAccrual, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsCountEndpoint.py index 7f2aa3d14..f67d2aca3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdCertificationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdCertificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/{id}/certifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/{id}/certifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsEndpoint.py index 6450cc2fa..6c48e64c5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMembersIdCertificationsCountEndpoint import ( SystemMembersIdCertificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemMembersIdCertificationsIdEndpoint import ( SystemMembersIdCertificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberCertification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdCertificationsEndpoint( @@ -24,10 +22,8 @@ class SystemMembersIdCertificationsEndpoint( IPostable[MemberCertification, ConnectWiseManageRequestParams], IPaginateable[MemberCertification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "certifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "certifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberCertification]) IPostable.__init__(self, MemberCertification) IPaginateable.__init__(self, MemberCertification) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemMembersIdCertificationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemMembersIdCertificationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersIdCertificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdCertificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdCertificationsIdEndpoint: The initialized SystemMembersIdCertificationsIdEndpoint object. """ - child = SystemMembersIdCertificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMembersIdCertificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberCertification]: """ Performs a GET request against the /system/members/{id}/certifications endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberCertification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberCertification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberCertification]: """ Performs a GET request against the /system/members/{id}/certifications endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[MemberCertification]: The parsed response data. """ - return self._parse_many( - MemberCertification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MemberCertification, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MemberCertification: """ Performs a POST request against the /system/members/{id}/certifications endpoint. @@ -114,7 +93,4 @@ def post( Returns: MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MemberCertification, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsIdEndpoint.py index 94efc52e5..cfad4b5a7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdCertificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberCertification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdCertificationsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberCertification, ConnectWiseManageRequestParams], - IPuttable[MemberCertification, ConnectWiseManageRequestParams], IPatchable[MemberCertification, ConnectWiseManageRequestParams], + IPuttable[MemberCertification, ConnectWiseManageRequestParams], IPaginateable[MemberCertification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberCertification) - IPuttable.__init__(self, MemberCertification) IPatchable.__init__(self, MemberCertification) + IPuttable.__init__(self, MemberCertification) IPaginateable.__init__(self, MemberCertification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberCertification]: """ Performs a GET request against the /system/members/{id}/certifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberCertification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberCertification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberCertification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/members/{id}/certifications/{id} endpoint. + Performs a DELETE request against the /system/members/{id}/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> MemberCertification: """ - Performs a DELETE request against the /system/members/{id}/certifications/{id} endpoint. + Performs a GET request against the /system/members/{id}/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberCertification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberCertification, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> MemberCertification: """ - Performs a PUT request against the /system/members/{id}/certifications/{id} endpoint. + Performs a PATCH request against the /system/members/{id}/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MemberCertification, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MemberCertification: """ - Performs a PATCH request against the /system/members/{id}/certifications/{id} endpoint. + Performs a PUT request against the /system/members/{id}/certifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MemberCertification, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdDeactivateEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdDeactivateEndpoint.py index e0a1e18f3..6d569a216 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdDeactivateEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdDeactivateEndpoint.py @@ -1,27 +1,23 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import MemberDeactivation -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdDeactivateEndpoint( ConnectWiseEndpoint, IPostable[MemberDeactivation, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "deactivate", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "deactivate", parent_endpoint=parent_endpoint) IPostable.__init__(self, MemberDeactivation) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MemberDeactivation: """ Performs a POST request against the /system/members/{id}/deactivate endpoint. @@ -32,7 +28,4 @@ def post( Returns: MemberDeactivation: The parsed response data. """ - return self._parse_one( - MemberDeactivation, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MemberDeactivation, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsCountEndpoint.py index feb559c65..7f1900a97 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdDelegationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdDelegationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/{id}/delegations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/{id}/delegations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsEndpoint.py index e21ce3849..10ab5e021 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMembersIdDelegationsCountEndpoint import ( SystemMembersIdDelegationsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMembersIdDelegationsIdEndpoint import ( - SystemMembersIdDelegationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMembersIdDelegationsIdEndpoint import SystemMembersIdDelegationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberDelegation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdDelegationsEndpoint( @@ -24,10 +20,8 @@ class SystemMembersIdDelegationsEndpoint( IPostable[MemberDelegation, ConnectWiseManageRequestParams], IPaginateable[MemberDelegation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "delegations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "delegations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberDelegation]) IPostable.__init__(self, MemberDelegation) IPaginateable.__init__(self, MemberDelegation) @@ -36,24 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemMembersIdDelegationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemMembersIdDelegationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersIdDelegationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdDelegationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdDelegationsIdEndpoint: The initialized SystemMembersIdDelegationsIdEndpoint object. """ child = SystemMembersIdDelegationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberDelegation]: """ Performs a GET request against the /system/members/{id}/delegations endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberDelegation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberDelegation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberDelegation]: """ Performs a GET request against the /system/members/{id}/delegations endpoint. @@ -93,16 +77,9 @@ def get( Returns: list[MemberDelegation]: The parsed response data. """ - return self._parse_many( - MemberDelegation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MemberDelegation, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ Performs a POST request against the /system/members/{id}/delegations endpoint. @@ -112,7 +89,4 @@ def post( Returns: MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MemberDelegation, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsIdEndpoint.py index 6e1cf3ff5..ee2da5fff 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdDelegationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberDelegation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdDelegationsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberDelegation, ConnectWiseManageRequestParams], - IPuttable[MemberDelegation, ConnectWiseManageRequestParams], IPatchable[MemberDelegation, ConnectWiseManageRequestParams], + IPuttable[MemberDelegation, ConnectWiseManageRequestParams], IPaginateable[MemberDelegation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberDelegation) - IPuttable.__init__(self, MemberDelegation) IPatchable.__init__(self, MemberDelegation) + IPuttable.__init__(self, MemberDelegation) IPaginateable.__init__(self, MemberDelegation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberDelegation]: """ Performs a GET request against the /system/members/{id}/delegations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberDelegation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberDelegation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/members/{id}/delegations/{id} endpoint. + Performs a DELETE request against the /system/members/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ - Performs a DELETE request against the /system/members/{id}/delegations/{id} endpoint. + Performs a GET request against the /system/members/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberDelegation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberDelegation, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ - Performs a PUT request against the /system/members/{id}/delegations/{id} endpoint. + Performs a PATCH request against the /system/members/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MemberDelegation, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ - Performs a PATCH request against the /system/members/{id}/delegations/{id} endpoint. + Performs a PUT request against the /system/members/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MemberDelegation, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdEndpoint.py index 86fce9af2..1bc7384db 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdEndpoint.py @@ -1,22 +1,12 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersIdAccrualsEndpoint import ( - SystemMembersIdAccrualsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdCertificationsEndpoint import ( - SystemMembersIdCertificationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdDeactivateEndpoint import ( - SystemMembersIdDeactivateEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdDelegationsEndpoint import ( - SystemMembersIdDelegationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdImageEndpoint import ( - SystemMembersIdImageEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdLinkssouserEndpoint import ( - SystemMembersIdLinkssouserEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMembersIdAccrualsEndpoint import SystemMembersIdAccrualsEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdCertificationsEndpoint import SystemMembersIdCertificationsEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdDeactivateEndpoint import SystemMembersIdDeactivateEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdDelegationsEndpoint import SystemMembersIdDelegationsEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdImageEndpoint import SystemMembersIdImageEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdLinkssouserEndpoint import SystemMembersIdLinkssouserEndpoint from pyconnectwise.endpoints.manage.SystemMembersIdManageddeviceaccountsEndpoint import ( SystemMembersIdManageddeviceaccountsEndpoint, ) @@ -26,112 +16,73 @@ from pyconnectwise.endpoints.manage.SystemMembersIdNotificationsettingsEndpoint import ( SystemMembersIdNotificationsettingsEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMembersIdPersonasEndpoint import ( - SystemMembersIdPersonasEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdSkillsEndpoint import ( - SystemMembersIdSkillsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdSubmitEndpoint import ( - SystemMembersIdSubmitEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdTokensEndpoint import ( - SystemMembersIdTokensEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdUnlinkssouserEndpoint import ( - SystemMembersIdUnlinkssouserEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMembersIdPersonasEndpoint import SystemMembersIdPersonasEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdSkillsEndpoint import SystemMembersIdSkillsEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdSubmitEndpoint import SystemMembersIdSubmitEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdTokensEndpoint import SystemMembersIdTokensEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdUnlinkssouserEndpoint import SystemMembersIdUnlinkssouserEndpoint from pyconnectwise.endpoints.manage.SystemMembersIdUnusedtimesheetsEndpoint import ( SystemMembersIdUnusedtimesheetsEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMembersIdUsagesEndpoint import ( - SystemMembersIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemMembersIdUsagesEndpoint import SystemMembersIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Member from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdEndpoint( ConnectWiseEndpoint, IGettable[Member, ConnectWiseManageRequestParams], - IPuttable[Member, ConnectWiseManageRequestParams], IPatchable[Member, ConnectWiseManageRequestParams], + IPuttable[Member, ConnectWiseManageRequestParams], IPaginateable[Member, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Member) - IPuttable.__init__(self, Member) IPatchable.__init__(self, Member) + IPuttable.__init__(self, Member) IPaginateable.__init__(self, Member) - self.skills = self._register_child_endpoint( - SystemMembersIdSkillsEndpoint(client, parent_endpoint=self) - ) - self.unlink_sso_user = self._register_child_endpoint( - SystemMembersIdUnlinkssouserEndpoint(client, parent_endpoint=self) - ) - self.deactivate = self._register_child_endpoint( - SystemMembersIdDeactivateEndpoint(client, parent_endpoint=self) - ) - self.submit = self._register_child_endpoint( - SystemMembersIdSubmitEndpoint(client, parent_endpoint=self) - ) + self.accruals = self._register_child_endpoint(SystemMembersIdAccrualsEndpoint(client, parent_endpoint=self)) self.certifications = self._register_child_endpoint( SystemMembersIdCertificationsEndpoint(client, parent_endpoint=self) ) - self.notification_settings = self._register_child_endpoint( - SystemMembersIdNotificationsettingsEndpoint(client, parent_endpoint=self) - ) - self.personas = self._register_child_endpoint( - SystemMembersIdPersonasEndpoint(client, parent_endpoint=self) - ) - self.image = self._register_child_endpoint( - SystemMembersIdImageEndpoint(client, parent_endpoint=self) + self.deactivate = self._register_child_endpoint(SystemMembersIdDeactivateEndpoint(client, parent_endpoint=self)) + self.delegations = self._register_child_endpoint( + SystemMembersIdDelegationsEndpoint(client, parent_endpoint=self) ) + self.image = self._register_child_endpoint(SystemMembersIdImageEndpoint(client, parent_endpoint=self)) self.link_sso_user = self._register_child_endpoint( SystemMembersIdLinkssouserEndpoint(client, parent_endpoint=self) ) - self.usages = self._register_child_endpoint( - SystemMembersIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.unused_time_sheets = self._register_child_endpoint( - SystemMembersIdUnusedtimesheetsEndpoint(client, parent_endpoint=self) - ) - self.tokens = self._register_child_endpoint( - SystemMembersIdTokensEndpoint(client, parent_endpoint=self) - ) - self.delegations = self._register_child_endpoint( - SystemMembersIdDelegationsEndpoint(client, parent_endpoint=self) - ) - self.accruals = self._register_child_endpoint( - SystemMembersIdAccrualsEndpoint(client, parent_endpoint=self) + self.managed_device_accounts = self._register_child_endpoint( + SystemMembersIdManageddeviceaccountsEndpoint(client, parent_endpoint=self) ) self.mycertifications = self._register_child_endpoint( SystemMembersIdMycertificationsEndpoint(client, parent_endpoint=self) ) - self.managed_device_accounts = self._register_child_endpoint( - SystemMembersIdManageddeviceaccountsEndpoint(client, parent_endpoint=self) + self.notification_settings = self._register_child_endpoint( + SystemMembersIdNotificationsettingsEndpoint(client, parent_endpoint=self) + ) + self.personas = self._register_child_endpoint(SystemMembersIdPersonasEndpoint(client, parent_endpoint=self)) + self.skills = self._register_child_endpoint(SystemMembersIdSkillsEndpoint(client, parent_endpoint=self)) + self.submit = self._register_child_endpoint(SystemMembersIdSubmitEndpoint(client, parent_endpoint=self)) + self.tokens = self._register_child_endpoint(SystemMembersIdTokensEndpoint(client, parent_endpoint=self)) + self.unlink_sso_user = self._register_child_endpoint( + SystemMembersIdUnlinkssouserEndpoint(client, parent_endpoint=self) ) + self.unused_time_sheets = self._register_child_endpoint( + SystemMembersIdUnusedtimesheetsEndpoint(client, parent_endpoint=self) + ) + self.usages = self._register_child_endpoint(SystemMembersIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Member]: """ Performs a GET request against the /system/members/{id} endpoint and returns an initialized PaginatedResponse object. @@ -148,20 +99,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Member, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Member, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Member: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Member: """ Performs a GET request against the /system/members/{id} endpoint. @@ -171,17 +111,11 @@ def get( Returns: Member: The parsed response data. """ - return self._parse_one( - Member, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Member, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Member: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Member: """ - Performs a PUT request against the /system/members/{id} endpoint. + Performs a PATCH request against the /system/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -189,17 +123,11 @@ def put( Returns: Member: The parsed response data. """ - return self._parse_one( - Member, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Member, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Member: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Member: """ - Performs a PATCH request against the /system/members/{id} endpoint. + Performs a PUT request against the /system/members/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -207,6 +135,4 @@ def patch( Returns: Member: The parsed response data. """ - return self._parse_one( - Member, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Member, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdImageEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdImageEndpoint.py index 81c0eb79e..e5a522be1 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdImageEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdImageEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdImageEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "image", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "image", parent_endpoint=parent_endpoint) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a GET request against the /system/members/{id}/image endpoint. diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdLinkssouserEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdLinkssouserEndpoint.py index e46b11489..443317073 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdLinkssouserEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdLinkssouserEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdLinkssouserEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "linkSsoUser", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "linkSsoUser", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/members/{id}/linkSsoUser endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsBulkEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsBulkEndpoint.py index ffee472f0..8921fba72 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsBulkEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsBulkEndpoint.py @@ -1,13 +1,12 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IDeleteable, - IPuttable, -) +from pyconnectwise.interfaces import IDeleteable, IPuttable from pyconnectwise.models.manage import BulkResult -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdManageddeviceaccountsBulkEndpoint( @@ -15,18 +14,12 @@ class SystemMembersIdManageddeviceaccountsBulkEndpoint( IDeleteable[ConnectWiseManageRequestParams], IPuttable[BulkResult, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "bulk", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "bulk", parent_endpoint=parent_endpoint) IDeleteable.__init__(self, None) IPuttable.__init__(self, BulkResult) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BulkResult: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BulkResult: """ Performs a DELETE request against the /system/members/{id}/managedDeviceAccounts/bulk endpoint. @@ -36,15 +29,9 @@ def delete( Returns: BulkResult: The parsed response data. """ - return self._parse_one( - BulkResult, super()._make_request("DELETE", data=data, params=params).json() - ) - - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> BulkResult: + return self._parse_one(BulkResult, super()._make_request("DELETE", data=data, params=params).json()) + + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> BulkResult: """ Performs a PUT request against the /system/members/{id}/managedDeviceAccounts/bulk endpoint. @@ -54,6 +41,4 @@ def put( Returns: BulkResult: The parsed response data. """ - return self._parse_one( - BulkResult, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(BulkResult, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsEndpoint.py index 36f51ffbb..2dffc95af 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdManageddeviceaccountsEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMembersIdManageddeviceaccountsBulkEndpoint import ( SystemMembersIdManageddeviceaccountsBulkEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ManagedDeviceAccount from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdManageddeviceaccountsEndpoint( @@ -19,24 +18,17 @@ class SystemMembersIdManageddeviceaccountsEndpoint( IGettable[list[ManagedDeviceAccount], ConnectWiseManageRequestParams], IPaginateable[ManagedDeviceAccount, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "managedDeviceAccounts", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "managedDeviceAccounts", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ManagedDeviceAccount]) IPaginateable.__init__(self, ManagedDeviceAccount) self.bulk = self._register_child_endpoint( - SystemMembersIdManageddeviceaccountsBulkEndpoint( - client, parent_endpoint=self - ) + SystemMembersIdManageddeviceaccountsBulkEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ManagedDeviceAccount]: """ Performs a GET request against the /system/members/{id}/managedDeviceAccounts endpoint and returns an initialized PaginatedResponse object. @@ -54,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ManagedDeviceAccount, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ManagedDeviceAccount, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ManagedDeviceAccount]: """ Performs a GET request against the /system/members/{id}/managedDeviceAccounts endpoint. @@ -76,7 +61,4 @@ def get( Returns: list[ManagedDeviceAccount]: The parsed response data. """ - return self._parse_many( - ManagedDeviceAccount, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ManagedDeviceAccount, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsCountEndpoint.py index 606af8992..c9a94ee53 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdMycertificationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdMycertificationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/{id}/mycertifications/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/{id}/mycertifications/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsEndpoint.py index c559fd29b..4e60b4f29 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMembersIdMycertificationsCountEndpoint import ( SystemMembersIdMycertificationsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemMembersIdMycertificationsIdEndpoint import ( SystemMembersIdMycertificationsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberCertification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdMycertificationsEndpoint( @@ -24,10 +22,8 @@ class SystemMembersIdMycertificationsEndpoint( IPostable[MemberCertification, ConnectWiseManageRequestParams], IPaginateable[MemberCertification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "mycertifications", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "mycertifications", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberCertification]) IPostable.__init__(self, MemberCertification) IPaginateable.__init__(self, MemberCertification) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemMembersIdMycertificationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemMembersIdMycertificationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersIdMycertificationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdMycertificationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdMycertificationsIdEndpoint: The initialized SystemMembersIdMycertificationsIdEndpoint object. """ - child = SystemMembersIdMycertificationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMembersIdMycertificationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberCertification]: """ Performs a GET request against the /system/members/{id}/mycertifications endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberCertification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberCertification, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberCertification]: """ Performs a GET request against the /system/members/{id}/mycertifications endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[MemberCertification]: The parsed response data. """ - return self._parse_many( - MemberCertification, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MemberCertification, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MemberCertification: """ Performs a POST request against the /system/members/{id}/mycertifications endpoint. @@ -114,7 +93,4 @@ def post( Returns: MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MemberCertification, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsIdEndpoint.py index 9bd7ceb0e..2043d3255 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdMycertificationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberCertification from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdMycertificationsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberCertification, ConnectWiseManageRequestParams], - IPuttable[MemberCertification, ConnectWiseManageRequestParams], IPatchable[MemberCertification, ConnectWiseManageRequestParams], + IPuttable[MemberCertification, ConnectWiseManageRequestParams], IPaginateable[MemberCertification, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberCertification) - IPuttable.__init__(self, MemberCertification) IPatchable.__init__(self, MemberCertification) + IPuttable.__init__(self, MemberCertification) IPaginateable.__init__(self, MemberCertification) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberCertification]: """ Performs a GET request against the /system/members/{id}/mycertifications/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberCertification, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberCertification, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberCertification: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/members/{id}/mycertifications/{id} endpoint. + Performs a DELETE request against the /system/members/{id}/mycertifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> MemberCertification: """ - Performs a DELETE request against the /system/members/{id}/mycertifications/{id} endpoint. + Performs a GET request against the /system/members/{id}/mycertifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberCertification: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberCertification, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> MemberCertification: """ - Performs a PUT request against the /system/members/{id}/mycertifications/{id} endpoint. + Performs a PATCH request against the /system/members/{id}/mycertifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MemberCertification, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MemberCertification: """ - Performs a PATCH request against the /system/members/{id}/mycertifications/{id} endpoint. + Performs a PUT request against the /system/members/{id}/mycertifications/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: MemberCertification: The parsed response data. """ - return self._parse_one( - MemberCertification, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MemberCertification, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsCountEndpoint.py index 7fc80e3a7..21b30fa6c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdNotificationsettingsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdNotificationsettingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/{id}/notificationSettings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/{id}/notificationSettings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsEndpoint.py index 704c4993e..d15b930d2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMembersIdNotificationsettingsCountEndpoint import ( SystemMembersIdNotificationsettingsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemMembersIdNotificationsettingsIdEndpoint import ( SystemMembersIdNotificationsettingsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberNotificationSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdNotificationsettingsEndpoint( @@ -24,42 +22,31 @@ class SystemMembersIdNotificationsettingsEndpoint( IPostable[MemberNotificationSetting, ConnectWiseManageRequestParams], IPaginateable[MemberNotificationSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notificationSettings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notificationSettings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberNotificationSetting]) IPostable.__init__(self, MemberNotificationSetting) IPaginateable.__init__(self, MemberNotificationSetting) self.count = self._register_child_endpoint( - SystemMembersIdNotificationsettingsCountEndpoint( - client, parent_endpoint=self - ) + SystemMembersIdNotificationsettingsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> SystemMembersIdNotificationsettingsIdEndpoint: + def id(self, _id: int) -> SystemMembersIdNotificationsettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdNotificationsettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdNotificationsettingsIdEndpoint: The initialized SystemMembersIdNotificationsettingsIdEndpoint object. """ - child = SystemMembersIdNotificationsettingsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMembersIdNotificationsettingsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberNotificationSetting]: """ Performs a GET request against the /system/members/{id}/notificationSettings endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberNotificationSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberNotificationSetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberNotificationSetting]: """ Performs a GET request against the /system/members/{id}/notificationSettings endpoint. @@ -100,14 +80,11 @@ def get( list[MemberNotificationSetting]: The parsed response data. """ return self._parse_many( - MemberNotificationSetting, - super()._make_request("GET", data=data, params=params).json(), + MemberNotificationSetting, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MemberNotificationSetting: """ Performs a POST request against the /system/members/{id}/notificationSettings endpoint. @@ -119,6 +96,5 @@ def post( MemberNotificationSetting: The parsed response data. """ return self._parse_one( - MemberNotificationSetting, - super()._make_request("POST", data=data, params=params).json(), + MemberNotificationSetting, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsIdEndpoint.py index 78e9c9040..ee14abc0f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdNotificationsettingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberNotificationSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdNotificationsettingsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberNotificationSetting, ConnectWiseManageRequestParams], - IPuttable[MemberNotificationSetting, ConnectWiseManageRequestParams], IPatchable[MemberNotificationSetting, ConnectWiseManageRequestParams], + IPuttable[MemberNotificationSetting, ConnectWiseManageRequestParams], IPaginateable[MemberNotificationSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberNotificationSetting) - IPuttable.__init__(self, MemberNotificationSetting) IPatchable.__init__(self, MemberNotificationSetting) + IPuttable.__init__(self, MemberNotificationSetting) IPaginateable.__init__(self, MemberNotificationSetting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberNotificationSetting]: """ Performs a GET request against the /system/members/{id}/notificationSettings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberNotificationSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberNotificationSetting, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberNotificationSetting: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/members/{id}/notificationSettings/{id} endpoint. + Performs a DELETE request against the /system/members/{id}/notificationSettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberNotificationSetting: The parsed response data. """ - return self._parse_one( - MemberNotificationSetting, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> MemberNotificationSetting: """ - Performs a DELETE request against the /system/members/{id}/notificationSettings/{id} endpoint. + Performs a GET request against the /system/members/{id}/notificationSettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberNotificationSetting: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberNotificationSetting, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> MemberNotificationSetting: """ - Performs a PUT request against the /system/members/{id}/notificationSettings/{id} endpoint. + Performs a PATCH request against the /system/members/{id}/notificationSettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +83,14 @@ def put( MemberNotificationSetting: The parsed response data. """ return self._parse_one( - MemberNotificationSetting, - super()._make_request("PUT", data=data, params=params).json(), + MemberNotificationSetting, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> MemberNotificationSetting: """ - Performs a PATCH request against the /system/members/{id}/notificationSettings/{id} endpoint. + Performs a PUT request against the /system/members/{id}/notificationSettings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +98,4 @@ def patch( Returns: MemberNotificationSetting: The parsed response data. """ - return self._parse_one( - MemberNotificationSetting, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MemberNotificationSetting, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasCountEndpoint.py index 114eed3bb..748d5f63b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdPersonasCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdPersonasCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/{id}/personas/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/{id}/personas/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasEndpoint.py index aff2b145b..4b60a9cc0 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasEndpoint.py @@ -1,59 +1,44 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersIdPersonasCountEndpoint import ( - SystemMembersIdPersonasCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdPersonasIdEndpoint import ( - SystemMembersIdPersonasIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMembersIdPersonasCountEndpoint import SystemMembersIdPersonasCountEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdPersonasIdEndpoint import SystemMembersIdPersonasIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MemberPersona from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdPersonasEndpoint( ConnectWiseEndpoint, IGettable[list[MemberPersona], ConnectWiseManageRequestParams], - IPostable[MemberPersona, ConnectWiseManageRequestParams], IPaginateable[MemberPersona, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "personas", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "personas", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberPersona]) - IPostable.__init__(self, MemberPersona) IPaginateable.__init__(self, MemberPersona) - self.count = self._register_child_endpoint( - SystemMembersIdPersonasCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMembersIdPersonasCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMembersIdPersonasIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersIdPersonasIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdPersonasIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdPersonasIdEndpoint: The initialized SystemMembersIdPersonasIdEndpoint object. """ child = SystemMembersIdPersonasIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberPersona]: """ Performs a GET request against the /system/members/{id}/personas endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberPersona, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberPersona, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberPersona]: """ Performs a GET request against the /system/members/{id}/personas endpoint. @@ -93,25 +71,4 @@ def get( Returns: list[MemberPersona]: The parsed response data. """ - return self._parse_many( - MemberPersona, super()._make_request("GET", data=data, params=params).json() - ) - - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberPersona: - """ - Performs a POST request against the /system/members/{id}/personas endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberPersona: The parsed response data. - """ - return self._parse_one( - MemberPersona, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_many(MemberPersona, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasIdEndpoint.py index e0eee39b2..d9d725822 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdPersonasIdEndpoint.py @@ -1,40 +1,27 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MemberPersona from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdPersonasIdEndpoint( ConnectWiseEndpoint, IGettable[MemberPersona, ConnectWiseManageRequestParams], - IPuttable[MemberPersona, ConnectWiseManageRequestParams], - IPatchable[MemberPersona, ConnectWiseManageRequestParams], IPaginateable[MemberPersona, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberPersona) - IPuttable.__init__(self, MemberPersona) - IPatchable.__init__(self, MemberPersona) IPaginateable.__init__(self, MemberPersona) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberPersona]: """ Performs a GET request against the /system/members/{id}/personas/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberPersona, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberPersona, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberPersona: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberPersona: """ Performs a GET request against the /system/members/{id}/personas/{id} endpoint. @@ -74,57 +52,4 @@ def get( Returns: MemberPersona: The parsed response data. """ - return self._parse_one( - MemberPersona, super()._make_request("GET", data=data, params=params).json() - ) - - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: - """ - Performs a DELETE request against the /system/members/{id}/personas/{id} endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - """ - super()._make_request("DELETE", data=data, params=params) - - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberPersona: - """ - Performs a PUT request against the /system/members/{id}/personas/{id} endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberPersona: The parsed response data. - """ - return self._parse_one( - MemberPersona, super()._make_request("PUT", data=data, params=params).json() - ) - - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberPersona: - """ - Performs a PATCH request against the /system/members/{id}/personas/{id} endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberPersona: The parsed response data. - """ - return self._parse_one( - MemberPersona, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MemberPersona, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsCountEndpoint.py index f8f6f19ee..14dad6bc2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdSkillsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdSkillsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/{id}/skills/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/{id}/skills/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsEndpoint.py index ebf5ee19c..a13b74cee 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersIdSkillsCountEndpoint import ( - SystemMembersIdSkillsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersIdSkillsIdEndpoint import ( - SystemMembersIdSkillsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMembersIdSkillsCountEndpoint import SystemMembersIdSkillsCountEndpoint +from pyconnectwise.endpoints.manage.SystemMembersIdSkillsIdEndpoint import SystemMembersIdSkillsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberSkill from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdSkillsEndpoint( @@ -24,36 +18,29 @@ class SystemMembersIdSkillsEndpoint( IPostable[MemberSkill, ConnectWiseManageRequestParams], IPaginateable[MemberSkill, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "skills", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "skills", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberSkill]) IPostable.__init__(self, MemberSkill) IPaginateable.__init__(self, MemberSkill) - self.count = self._register_child_endpoint( - SystemMembersIdSkillsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMembersIdSkillsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMembersIdSkillsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersIdSkillsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersIdSkillsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersIdSkillsIdEndpoint: The initialized SystemMembersIdSkillsIdEndpoint object. """ child = SystemMembersIdSkillsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberSkill]: """ Performs a GET request against the /system/members/{id}/skills endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberSkill, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberSkill, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[MemberSkill]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[MemberSkill]: """ Performs a GET request against the /system/members/{id}/skills endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[MemberSkill]: The parsed response data. """ - return self._parse_many( - MemberSkill, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(MemberSkill, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ Performs a POST request against the /system/members/{id}/skills endpoint. @@ -111,6 +83,4 @@ def post( Returns: MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(MemberSkill, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsIdEndpoint.py index bd2cee7da..4c30ea4e4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdSkillsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberSkill from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdSkillsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberSkill, ConnectWiseManageRequestParams], - IPuttable[MemberSkill, ConnectWiseManageRequestParams], IPatchable[MemberSkill, ConnectWiseManageRequestParams], + IPuttable[MemberSkill, ConnectWiseManageRequestParams], IPaginateable[MemberSkill, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberSkill) - IPuttable.__init__(self, MemberSkill) IPatchable.__init__(self, MemberSkill) + IPuttable.__init__(self, MemberSkill) IPaginateable.__init__(self, MemberSkill) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberSkill]: """ Performs a GET request against the /system/members/{id}/skills/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberSkill, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberSkill, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/members/{id}/skills/{id} endpoint. + Performs a DELETE request against the /system/members/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ - Performs a DELETE request against the /system/members/{id}/skills/{id} endpoint. + Performs a GET request against the /system/members/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberSkill: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberSkill, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ - Performs a PUT request against the /system/members/{id}/skills/{id} endpoint. + Performs a PATCH request against the /system/members/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(MemberSkill, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ - Performs a PATCH request against the /system/members/{id}/skills/{id} endpoint. + Performs a PUT request against the /system/members/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(MemberSkill, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdSubmitEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdSubmitEndpoint.py index e21c7b876..22d42a290 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdSubmitEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdSubmitEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class SystemMembersIdSubmitEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "submit", parent_endpoint=parent_endpoint - ) +class SystemMembersIdSubmitEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "submit", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/members/{id}/submit endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdTokensEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdTokensEndpoint.py index 35eddc0c9..862805fa9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdTokensEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdTokensEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Token -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class SystemMembersIdTokensEndpoint( - ConnectWiseEndpoint, IPostable[Token, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tokens", parent_endpoint=parent_endpoint - ) +class SystemMembersIdTokensEndpoint(ConnectWiseEndpoint, IPostable[Token, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tokens", parent_endpoint=parent_endpoint) IPostable.__init__(self, Token) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Token: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Token: """ Performs a POST request against the /system/members/{id}/tokens endpoint. @@ -32,6 +24,4 @@ def post( Returns: Token: The parsed response data. """ - return self._parse_one( - Token, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Token, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdUnlinkssouserEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdUnlinkssouserEndpoint.py index 73b027180..602ed1a03 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdUnlinkssouserEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdUnlinkssouserEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdUnlinkssouserEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "unlinkSsoUser", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "unlinkSsoUser", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/members/{id}/unlinkSsoUser endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdUnusedtimesheetsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdUnusedtimesheetsEndpoint.py index 75ff4573d..584bf5e85 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdUnusedtimesheetsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdUnusedtimesheetsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdUnusedtimesheetsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "unusedTimeSheets", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "unusedTimeSheets", parent_endpoint=parent_endpoint) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a DELETE request against the /system/members/{id}/unusedTimeSheets endpoint. diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesEndpoint.py index 07ce99fe7..10d6db0ff 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersIdUsagesListEndpoint import ( - SystemMembersIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMembersIdUsagesListEndpoint import SystemMembersIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdUsagesEndpoint( @@ -19,22 +16,15 @@ class SystemMembersIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - SystemMembersIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(SystemMembersIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/members/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/members/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesListEndpoint.py index 899211217..b1621b1f2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class SystemMembersIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /system/members/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /system/members/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersTypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersTypesCountEndpoint.py index d6ef5fdec..69a50c4af 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersTypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersTypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersTypesCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersTypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/types/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/types/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersTypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersTypesEndpoint.py index 83afc65c4..e6ba4e0df 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersTypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersTypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersTypesCountEndpoint import ( - SystemMembersTypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersTypesIdEndpoint import ( - SystemMembersTypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMembersTypesInfoEndpoint import ( - SystemMembersTypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMembersTypesCountEndpoint import SystemMembersTypesCountEndpoint +from pyconnectwise.endpoints.manage.SystemMembersTypesIdEndpoint import SystemMembersTypesIdEndpoint +from pyconnectwise.endpoints.manage.SystemMembersTypesInfoEndpoint import SystemMembersTypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersTypesEndpoint( @@ -27,39 +19,30 @@ class SystemMembersTypesEndpoint( IPostable[MemberType, ConnectWiseManageRequestParams], IPaginateable[MemberType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "types", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "types", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberType]) IPostable.__init__(self, MemberType) IPaginateable.__init__(self, MemberType) - self.count = self._register_child_endpoint( - SystemMembersTypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemMembersTypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMembersTypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemMembersTypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMembersTypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMembersTypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMembersTypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMembersTypesIdEndpoint: The initialized SystemMembersTypesIdEndpoint object. """ child = SystemMembersTypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberType]: """ Performs a GET request against the /system/members/types endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MemberType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MemberType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[MemberType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[MemberType]: """ Performs a GET request against the /system/members/types endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[MemberType]: The parsed response data. """ - return self._parse_many( - MemberType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(MemberType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberType: """ Performs a POST request against the /system/members/types endpoint. @@ -117,6 +83,4 @@ def post( Returns: MemberType: The parsed response data. """ - return self._parse_one( - MemberType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(MemberType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdEndpoint.py index 05f403688..37387fcfb 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersTypesIdInfoEndpoint import ( - SystemMembersTypesIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemMembersTypesIdInfoEndpoint import SystemMembersTypesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersTypesIdEndpoint( ConnectWiseEndpoint, IGettable[MemberType, ConnectWiseManageRequestParams], - IPuttable[MemberType, ConnectWiseManageRequestParams], IPatchable[MemberType, ConnectWiseManageRequestParams], + IPuttable[MemberType, ConnectWiseManageRequestParams], IPaginateable[MemberType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberType) - IPuttable.__init__(self, MemberType) IPatchable.__init__(self, MemberType) + IPuttable.__init__(self, MemberType) IPaginateable.__init__(self, MemberType) - self.info = self._register_child_endpoint( - SystemMembersTypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemMembersTypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberType]: """ Performs a GET request against the /system/members/types/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MemberType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MemberType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/members/types/{id} endpoint. + Performs a DELETE request against the /system/members/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberType: The parsed response data. """ - return self._parse_one( - MemberType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberType: """ - Performs a DELETE request against the /system/members/types/{id} endpoint. + Performs a GET request against the /system/members/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MemberType: """ - Performs a PUT request against the /system/members/types/{id} endpoint. + Performs a PATCH request against the /system/members/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: MemberType: The parsed response data. """ - return self._parse_one( - MemberType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(MemberType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberType: """ - Performs a PATCH request against the /system/members/types/{id} endpoint. + Performs a PUT request against the /system/members/types/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: MemberType: The parsed response data. """ - return self._parse_one( - MemberType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(MemberType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdInfoEndpoint.py index 1087fb189..c65e3a39b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersTypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MemberTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersTypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemMembersTypesIdInfoEndpoint( IGettable[MemberTypeInfo, ConnectWiseManageRequestParams], IPaginateable[MemberTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberTypeInfo) IPaginateable.__init__(self, MemberTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberTypeInfo]: """ Performs a GET request against the /system/members/types/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberTypeInfo: """ Performs a GET request against the /system/members/types/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: MemberTypeInfo: The parsed response data. """ - return self._parse_one( - MemberTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(MemberTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoCountEndpoint.py index 3aa011ffb..bb8a4ae33 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersTypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemMembersTypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/members/types/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/members/types/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoEndpoint.py index 506827620..e90c40263 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersTypesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMembersTypesInfoCountEndpoint import ( - SystemMembersTypesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMembersTypesInfoCountEndpoint import SystemMembersTypesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MemberTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersTypesInfoEndpoint( @@ -19,22 +16,15 @@ class SystemMembersTypesInfoEndpoint( IGettable[list[MemberTypeInfo], ConnectWiseManageRequestParams], IPaginateable[MemberTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberTypeInfo]) IPaginateable.__init__(self, MemberTypeInfo) - self.count = self._register_child_endpoint( - SystemMembersTypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMembersTypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberTypeInfo]: """ Performs a GET request against the /system/members/types/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberTypeInfo]: """ Performs a GET request against the /system/members/types/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[MemberTypeInfo]: The parsed response data. """ - return self._parse_many( - MemberTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MemberTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembersWithssoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembersWithssoEndpoint.py index be7f04389..6e0b3b27e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembersWithssoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembersWithssoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Member from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMembersWithssoEndpoint( @@ -16,18 +15,13 @@ class SystemMembersWithssoEndpoint( IGettable[list[Member], ConnectWiseManageRequestParams], IPaginateable[Member, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "withSso", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "withSso", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Member]) IPaginateable.__init__(self, Member) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Member]: """ Performs a GET request against the /system/members/withSso endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Member, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Member, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Member]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Member]: """ Performs a GET request against the /system/members/withSso endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Member]: The parsed response data. """ - return self._parse_many( - Member, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Member, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembertemplatesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembertemplatesCountEndpoint.py index e344f95e6..2d2ce0e36 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembertemplatesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembertemplatesCountEndpoint.py @@ -17,9 +17,7 @@ class SystemMembertemplatesCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMembertemplatesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembertemplatesEndpoint.py index 942d16f7f..3572929f5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembertemplatesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembertemplatesEndpoint.py @@ -9,13 +9,9 @@ class SystemMembertemplatesEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "membertemplates", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "membertemplates", parent_endpoint=parent_endpoint) - self.count = self._register_child_endpoint( - SystemMembertemplatesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMembertemplatesCountEndpoint(client, parent_endpoint=self)) def id(self, id: int) -> SystemMembertemplatesIdEndpoint: # noqa: A002 """ diff --git a/src/pyconnectwise/endpoints/manage/SystemMembertemplatesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMembertemplatesIdEndpoint.py index d81d5a40f..94b6161be 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMembertemplatesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMembertemplatesIdEndpoint.py @@ -20,9 +20,7 @@ class SystemMembertemplatesIdEndpoint( IPaginateable[MemberTemplate, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberTemplate) IPatchable.__init__(self, MemberTemplate) IPaginateable.__init__(self, MemberTemplate) diff --git a/src/pyconnectwise/endpoints/manage/SystemMenuentriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMenuentriesCountEndpoint.py index 50dac1e87..e49a1ef3a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMenuentriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMenuentriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMenuentriesCountEndpoint( @@ -16,18 +15,13 @@ class SystemMenuentriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/menuentries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/menuentries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMenuentriesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMenuentriesEndpoint.py index 5116d51e7..4d0db7ce2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMenuentriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMenuentriesEndpoint.py @@ -1,24 +1,84 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMenuentriesIdEndpoint import ( - SystemMenuentriesIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMenuentriesCountEndpoint import SystemMenuentriesCountEndpoint +from pyconnectwise.endpoints.manage.SystemMenuentriesIdEndpoint import SystemMenuentriesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable +from pyconnectwise.models.manage import MenuEntry +from pyconnectwise.responses.paginated_response import PaginatedResponse +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + +class SystemMenuentriesEndpoint( + ConnectWiseEndpoint, + IGettable[list[MenuEntry], ConnectWiseManageRequestParams], + IPostable[MenuEntry, ConnectWiseManageRequestParams], + IPaginateable[MenuEntry, ConnectWiseManageRequestParams], +): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "menuentries", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[MenuEntry]) + IPostable.__init__(self, MenuEntry) + IPaginateable.__init__(self, MenuEntry) -class SystemMenuentriesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "menuEntries", parent_endpoint=parent_endpoint - ) + self.count = self._register_child_endpoint(SystemMenuentriesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMenuentriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMenuentriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMenuentriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMenuentriesIdEndpoint: The initialized SystemMenuentriesIdEndpoint object. """ child = SystemMenuentriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child + + def paginated( + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[MenuEntry]: + """ + Performs a GET request against the /system/menuentries endpoint and returns an initialized PaginatedResponse object. + + Parameters: + page (int): The page number to request. + page_size (int): The number of results to return per page. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaginatedResponse[MenuEntry]: The initialized PaginatedResponse object. + """ + if params: + params["page"] = page + params["pageSize"] = page_size + else: + params = {"page": page, "pageSize": page_size} + return PaginatedResponse(super()._make_request("GET", params=params), MenuEntry, self, page, page_size, params) + + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[MenuEntry]: + """ + Performs a GET request against the /system/menuentries endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + list[MenuEntry]: The parsed response data. + """ + return self._parse_many(MenuEntry, super()._make_request("GET", data=data, params=params).json()) + + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MenuEntry: + """ + Performs a POST request against the /system/menuentries endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MenuEntry: The parsed response data. + """ + return self._parse_one(MenuEntry, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdEndpoint.py index f533181d1..37ec6d586 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdEndpoint.py @@ -1,15 +1,94 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMenuentriesIdLocationsEndpoint import ( - SystemMenuentriesIdLocationsEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMenuentriesIdImageEndpoint import SystemMenuentriesIdImageEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable +from pyconnectwise.models.manage import MenuEntry +from pyconnectwise.responses.paginated_response import PaginatedResponse +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + + +class SystemMenuentriesIdEndpoint( + ConnectWiseEndpoint, + IGettable[MenuEntry, ConnectWiseManageRequestParams], + IPatchable[MenuEntry, ConnectWiseManageRequestParams], + IPuttable[MenuEntry, ConnectWiseManageRequestParams], + IPaginateable[MenuEntry, ConnectWiseManageRequestParams], +): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IGettable.__init__(self, MenuEntry) + IPatchable.__init__(self, MenuEntry) + IPuttable.__init__(self, MenuEntry) + IPaginateable.__init__(self, MenuEntry) + + self.image = self._register_child_endpoint(SystemMenuentriesIdImageEndpoint(client, parent_endpoint=self)) + + def paginated( + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[MenuEntry]: + """ + Performs a GET request against the /system/menuentries/{id} endpoint and returns an initialized PaginatedResponse object. + + Parameters: + page (int): The page number to request. + page_size (int): The number of results to return per page. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaginatedResponse[MenuEntry]: The initialized PaginatedResponse object. + """ + if params: + params["page"] = page + params["pageSize"] = page_size + else: + params = {"page": page, "pageSize": page_size} + return PaginatedResponse(super()._make_request("GET", params=params), MenuEntry, self, page, page_size, params) + + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: + """ + Performs a DELETE request against the /system/menuentries/{id} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + """ + super()._make_request("DELETE", data=data, params=params) + + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MenuEntry: + """ + Performs a GET request against the /system/menuentries/{id} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MenuEntry: The parsed response data. + """ + return self._parse_one(MenuEntry, super()._make_request("GET", data=data, params=params).json()) + + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MenuEntry: + """ + Performs a PATCH request against the /system/menuentries/{id} endpoint. + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MenuEntry: The parsed response data. + """ + return self._parse_one(MenuEntry, super()._make_request("PATCH", data=data, params=params).json()) -class SystemMenuentriesIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MenuEntry: + """ + Performs a PUT request against the /system/menuentries/{id} endpoint. - self.locations = self._register_child_endpoint( - SystemMenuentriesIdLocationsEndpoint(client, parent_endpoint=self) - ) + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MenuEntry: The parsed response data. + """ + return self._parse_one(MenuEntry, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdImageEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdImageEndpoint.py index ce98ef702..dcd767931 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdImageEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdImageEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMenuentriesIdImageEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "image", parent_endpoint=parent_endpoint - ) - - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "image", parent_endpoint=parent_endpoint) + + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a GET request against the /system/menuentries/{id}/image endpoint. @@ -25,11 +21,7 @@ def get( """ super()._make_request("GET", data=data, params=params) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a POST request against the /system/menuentries/{id}/image endpoint. diff --git a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsCountEndpoint.py index 3eb82aa3b..12136fb5b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMenuentriesIdLocationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMenuentriesIdLocationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/menuEntries/{id}/locations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/menuEntries/{id}/locations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsEndpoint.py index dfc6ee1bd..3b77e713f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMenuentriesIdLocationsCountEndpoint import ( SystemMenuentriesIdLocationsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMenuentriesIdLocationsIdEndpoint import ( - SystemMenuentriesIdLocationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMenuentriesIdLocationsIdEndpoint import SystemMenuentriesIdLocationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MenuEntryLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMenuentriesIdLocationsEndpoint( @@ -24,10 +20,8 @@ class SystemMenuentriesIdLocationsEndpoint( IPostable[MenuEntryLocation, ConnectWiseManageRequestParams], IPaginateable[MenuEntryLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "locations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "locations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MenuEntryLocation]) IPostable.__init__(self, MenuEntryLocation) IPaginateable.__init__(self, MenuEntryLocation) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemMenuentriesIdLocationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemMenuentriesIdLocationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMenuentriesIdLocationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMenuentriesIdLocationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMenuentriesIdLocationsIdEndpoint: The initialized SystemMenuentriesIdLocationsIdEndpoint object. """ - child = SystemMenuentriesIdLocationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMenuentriesIdLocationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MenuEntryLocation]: """ Performs a GET request against the /system/menuEntries/{id}/locations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MenuEntryLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MenuEntryLocation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MenuEntryLocation]: """ Performs a GET request against the /system/menuEntries/{id}/locations endpoint. @@ -95,16 +77,9 @@ def get( Returns: list[MenuEntryLocation]: The parsed response data. """ - return self._parse_many( - MenuEntryLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MenuEntryLocation, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MenuEntryLocation: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MenuEntryLocation: """ Performs a POST request against the /system/menuEntries/{id}/locations endpoint. @@ -114,7 +89,4 @@ def post( Returns: MenuEntryLocation: The parsed response data. """ - return self._parse_one( - MenuEntryLocation, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MenuEntryLocation, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsIdEndpoint.py index 10c4a8e30..a8535c26a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMenuentriesIdLocationsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MenuEntryLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMenuentriesIdLocationsIdEndpoint( @@ -16,18 +15,13 @@ class SystemMenuentriesIdLocationsIdEndpoint( IGettable[MenuEntryLocation, ConnectWiseManageRequestParams], IPaginateable[MenuEntryLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MenuEntryLocation) IPaginateable.__init__(self, MenuEntryLocation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MenuEntryLocation]: """ Performs a GET request against the /system/menuEntries/{id}/locations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,43 +39,27 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MenuEntryLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MenuEntryLocation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MenuEntryLocation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/menuEntries/{id}/locations/{id} endpoint. + Performs a DELETE request against the /system/menuEntries/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MenuEntryLocation: The parsed response data. """ - return self._parse_one( - MenuEntryLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MenuEntryLocation: """ - Performs a DELETE request against the /system/menuEntries/{id}/locations/{id} endpoint. + Performs a GET request against the /system/menuEntries/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MenuEntryLocation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MenuEntryLocation, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountEndpoint.py index 43d52fa4f..530aa27c3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMyaccountIdEndpoint import ( - SystemMyaccountIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMyaccountIdEndpoint import SystemMyaccountIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "myAccount", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "myAccount", parent_endpoint=parent_endpoint) - def id(self, id: int) -> SystemMyaccountIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMyaccountIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMyaccountIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMyaccountIdEndpoint: The initialized SystemMyaccountIdEndpoint object. """ child = SystemMyaccountIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsCountEndpoint.py index 8d21696ee..479cfdaed 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountIdDelegationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMyaccountIdDelegationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myAccount/{id}/delegations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myAccount/{id}/delegations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsEndpoint.py index f7718a3ae..4761d4102 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMyaccountIdDelegationsCountEndpoint import ( SystemMyaccountIdDelegationsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMyaccountIdDelegationsIdEndpoint import ( - SystemMyaccountIdDelegationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMyaccountIdDelegationsIdEndpoint import SystemMyaccountIdDelegationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberDelegation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountIdDelegationsEndpoint( @@ -24,10 +20,8 @@ class SystemMyaccountIdDelegationsEndpoint( IPostable[MemberDelegation, ConnectWiseManageRequestParams], IPaginateable[MemberDelegation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "delegations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "delegations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberDelegation]) IPostable.__init__(self, MemberDelegation) IPaginateable.__init__(self, MemberDelegation) @@ -36,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemMyaccountIdDelegationsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemMyaccountIdDelegationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMyaccountIdDelegationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMyaccountIdDelegationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMyaccountIdDelegationsIdEndpoint: The initialized SystemMyaccountIdDelegationsIdEndpoint object. """ - child = SystemMyaccountIdDelegationsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMyaccountIdDelegationsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberDelegation]: """ Performs a GET request against the /system/myAccount/{id}/delegations endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberDelegation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberDelegation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[MemberDelegation]: """ Performs a GET request against the /system/myAccount/{id}/delegations endpoint. @@ -95,16 +77,9 @@ def get( Returns: list[MemberDelegation]: The parsed response data. """ - return self._parse_many( - MemberDelegation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(MemberDelegation, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ Performs a POST request against the /system/myAccount/{id}/delegations endpoint. @@ -114,7 +89,4 @@ def post( Returns: MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(MemberDelegation, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsIdEndpoint.py index c8ad499e3..84af0ed79 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdDelegationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberDelegation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountIdDelegationsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberDelegation, ConnectWiseManageRequestParams], - IPuttable[MemberDelegation, ConnectWiseManageRequestParams], IPatchable[MemberDelegation, ConnectWiseManageRequestParams], + IPuttable[MemberDelegation, ConnectWiseManageRequestParams], IPaginateable[MemberDelegation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberDelegation) - IPuttable.__init__(self, MemberDelegation) IPatchable.__init__(self, MemberDelegation) + IPuttable.__init__(self, MemberDelegation) IPaginateable.__init__(self, MemberDelegation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberDelegation]: """ Performs a GET request against the /system/myAccount/{id}/delegations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberDelegation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberDelegation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/myAccount/{id}/delegations/{id} endpoint. + Performs a DELETE request against the /system/myAccount/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ - Performs a DELETE request against the /system/myAccount/{id}/delegations/{id} endpoint. + Performs a GET request against the /system/myAccount/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberDelegation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberDelegation, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ - Performs a PUT request against the /system/myAccount/{id}/delegations/{id} endpoint. + Performs a PATCH request against the /system/myAccount/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(MemberDelegation, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberDelegation: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberDelegation: """ - Performs a PATCH request against the /system/myAccount/{id}/delegations/{id} endpoint. + Performs a PUT request against the /system/myAccount/{id}/delegations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: MemberDelegation: The parsed response data. """ - return self._parse_one( - MemberDelegation, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(MemberDelegation, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdEndpoint.py index 9591e317c..7f5b167a4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdEndpoint.py @@ -1,53 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMyaccountIdDelegationsEndpoint import ( - SystemMyaccountIdDelegationsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMyaccountIdSkillsEndpoint import ( - SystemMyaccountIdSkillsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemMyaccountIdDelegationsEndpoint import SystemMyaccountIdDelegationsEndpoint +from pyconnectwise.endpoints.manage.SystemMyaccountIdSkillsEndpoint import SystemMyaccountIdSkillsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MyAccount from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountIdEndpoint( ConnectWiseEndpoint, IGettable[MyAccount, ConnectWiseManageRequestParams], - IPuttable[MyAccount, ConnectWiseManageRequestParams], IPatchable[MyAccount, ConnectWiseManageRequestParams], + IPuttable[MyAccount, ConnectWiseManageRequestParams], IPaginateable[MyAccount, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MyAccount) - IPuttable.__init__(self, MyAccount) IPatchable.__init__(self, MyAccount) + IPuttable.__init__(self, MyAccount) IPaginateable.__init__(self, MyAccount) - self.skills = self._register_child_endpoint( - SystemMyaccountIdSkillsEndpoint(client, parent_endpoint=self) - ) self.delegations = self._register_child_endpoint( SystemMyaccountIdDelegationsEndpoint(client, parent_endpoint=self) ) + self.skills = self._register_child_endpoint(SystemMyaccountIdSkillsEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MyAccount]: """ Performs a GET request against the /system/myAccount/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,20 +49,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MyAccount, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MyAccount, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MyAccount: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MyAccount: """ Performs a GET request against the /system/myAccount/{id} endpoint. @@ -87,17 +61,11 @@ def get( Returns: MyAccount: The parsed response data. """ - return self._parse_one( - MyAccount, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(MyAccount, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MyAccount: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MyAccount: """ - Performs a PUT request against the /system/myAccount/{id} endpoint. + Performs a PATCH request against the /system/myAccount/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -105,17 +73,11 @@ def put( Returns: MyAccount: The parsed response data. """ - return self._parse_one( - MyAccount, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(MyAccount, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MyAccount: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MyAccount: """ - Performs a PATCH request against the /system/myAccount/{id} endpoint. + Performs a PUT request against the /system/myAccount/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -123,6 +85,4 @@ def patch( Returns: MyAccount: The parsed response data. """ - return self._parse_one( - MyAccount, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(MyAccount, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsCountEndpoint.py index e6edf1108..a2d7e7229 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountIdSkillsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMyaccountIdSkillsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myAccount/{id}/skills/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myAccount/{id}/skills/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsEndpoint.py index 4e485b7be..69f81ad45 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMyaccountIdSkillsCountEndpoint import ( - SystemMyaccountIdSkillsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMyaccountIdSkillsIdEndpoint import ( - SystemMyaccountIdSkillsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemMyaccountIdSkillsCountEndpoint import SystemMyaccountIdSkillsCountEndpoint +from pyconnectwise.endpoints.manage.SystemMyaccountIdSkillsIdEndpoint import SystemMyaccountIdSkillsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import MemberSkill from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountIdSkillsEndpoint( @@ -24,36 +18,29 @@ class SystemMyaccountIdSkillsEndpoint( IPostable[MemberSkill, ConnectWiseManageRequestParams], IPaginateable[MemberSkill, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "skills", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "skills", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MemberSkill]) IPostable.__init__(self, MemberSkill) IPaginateable.__init__(self, MemberSkill) - self.count = self._register_child_endpoint( - SystemMyaccountIdSkillsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMyaccountIdSkillsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMyaccountIdSkillsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMyaccountIdSkillsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMyaccountIdSkillsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMyaccountIdSkillsIdEndpoint: The initialized SystemMyaccountIdSkillsIdEndpoint object. """ child = SystemMyaccountIdSkillsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberSkill]: """ Performs a GET request against the /system/myAccount/{id}/skills endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberSkill, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberSkill, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[MemberSkill]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[MemberSkill]: """ Performs a GET request against the /system/myAccount/{id}/skills endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[MemberSkill]: The parsed response data. """ - return self._parse_many( - MemberSkill, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(MemberSkill, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ Performs a POST request against the /system/myAccount/{id}/skills endpoint. @@ -111,6 +83,4 @@ def post( Returns: MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(MemberSkill, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsIdEndpoint.py index 40db0a4b7..31d541c11 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMyaccountIdSkillsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import MemberSkill from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMyaccountIdSkillsIdEndpoint( ConnectWiseEndpoint, IGettable[MemberSkill, ConnectWiseManageRequestParams], - IPuttable[MemberSkill, ConnectWiseManageRequestParams], IPatchable[MemberSkill, ConnectWiseManageRequestParams], + IPuttable[MemberSkill, ConnectWiseManageRequestParams], IPaginateable[MemberSkill, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, MemberSkill) - IPuttable.__init__(self, MemberSkill) IPatchable.__init__(self, MemberSkill) + IPuttable.__init__(self, MemberSkill) IPaginateable.__init__(self, MemberSkill) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MemberSkill]: """ Performs a GET request against the /system/myAccount/{id}/skills/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MemberSkill, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MemberSkill, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/myAccount/{id}/skills/{id} endpoint. + Performs a DELETE request against the /system/myAccount/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ - Performs a DELETE request against the /system/myAccount/{id}/skills/{id} endpoint. + Performs a GET request against the /system/myAccount/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + MemberSkill: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(MemberSkill, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ - Performs a PUT request against the /system/myAccount/{id}/skills/{id} endpoint. + Performs a PATCH request against the /system/myAccount/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(MemberSkill, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> MemberSkill: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MemberSkill: """ - Performs a PATCH request against the /system/myAccount/{id}/skills/{id} endpoint. + Performs a PUT request against the /system/myAccount/{id}/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +90,4 @@ def patch( Returns: MemberSkill: The parsed response data. """ - return self._parse_one( - MemberSkill, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(MemberSkill, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureCountEndpoint.py index 246d366a1..c8d4466f2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructureCountEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCorporatestructureCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myCompany/corporateStructure/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myCompany/corporateStructure/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureEndpoint.py index 5a5df88a2..b96117744 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyCorporatestructureCountEndpoint import ( SystemMycompanyCorporatestructureCountEndpoint, @@ -8,16 +10,13 @@ from pyconnectwise.endpoints.manage.SystemMycompanyCorporatestructureInfoEndpoint import ( SystemMycompanyCorporatestructureInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CorporateStructure from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructureEndpoint( @@ -25,10 +24,8 @@ class SystemMycompanyCorporatestructureEndpoint( IGettable[list[CorporateStructure], ConnectWiseManageRequestParams], IPaginateable[CorporateStructure, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "corporateStructure", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "corporateStructure", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CorporateStructure]) IPaginateable.__init__(self, CorporateStructure) @@ -39,26 +36,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemMycompanyCorporatestructureInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemMycompanyCorporatestructureIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyCorporatestructureIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyCorporatestructureIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyCorporatestructureIdEndpoint: The initialized SystemMycompanyCorporatestructureIdEndpoint object. """ - child = SystemMycompanyCorporatestructureIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMycompanyCorporatestructureIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CorporateStructure]: """ Performs a GET request against the /system/myCompany/corporateStructure endpoint and returns an initialized PaginatedResponse object. @@ -76,18 +68,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CorporateStructure, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CorporateStructure, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CorporateStructure]: """ Performs a GET request against the /system/myCompany/corporateStructure endpoint. @@ -98,7 +83,4 @@ def get( Returns: list[CorporateStructure]: The parsed response data. """ - return self._parse_many( - CorporateStructure, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CorporateStructure, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdEndpoint.py index 1a7f837d6..32a8e6cd8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyCorporatestructureIdInfoEndpoint import ( SystemMycompanyCorporatestructureIdInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import CorporateStructure from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructureIdEndpoint( ConnectWiseEndpoint, IGettable[CorporateStructure, ConnectWiseManageRequestParams], - IPuttable[CorporateStructure, ConnectWiseManageRequestParams], IPatchable[CorporateStructure, ConnectWiseManageRequestParams], + IPuttable[CorporateStructure, ConnectWiseManageRequestParams], IPaginateable[CorporateStructure, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CorporateStructure) - IPuttable.__init__(self, CorporateStructure) IPatchable.__init__(self, CorporateStructure) + IPuttable.__init__(self, CorporateStructure) IPaginateable.__init__(self, CorporateStructure) self.info = self._register_child_endpoint( - SystemMycompanyCorporatestructureIdInfoEndpoint( - client, parent_endpoint=self - ) + SystemMycompanyCorporatestructureIdInfoEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CorporateStructure]: """ Performs a GET request against the /system/myCompany/corporateStructure/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,19 +50,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CorporateStructure, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CorporateStructure, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CorporateStructure: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CorporateStructure: """ Performs a GET request against the /system/myCompany/corporateStructure/{id} endpoint. @@ -83,18 +63,11 @@ def get( Returns: CorporateStructure: The parsed response data. """ - return self._parse_one( - CorporateStructure, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CorporateStructure, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CorporateStructure: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> CorporateStructure: """ - Performs a PUT request against the /system/myCompany/corporateStructure/{id} endpoint. + Performs a PATCH request against the /system/myCompany/corporateStructure/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -102,18 +75,11 @@ def put( Returns: CorporateStructure: The parsed response data. """ - return self._parse_one( - CorporateStructure, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(CorporateStructure, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> CorporateStructure: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CorporateStructure: """ - Performs a PATCH request against the /system/myCompany/corporateStructure/{id} endpoint. + Performs a PUT request against the /system/myCompany/corporateStructure/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -121,7 +87,4 @@ def patch( Returns: CorporateStructure: The parsed response data. """ - return self._parse_one( - CorporateStructure, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(CorporateStructure, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdInfoEndpoint.py index b06772ff8..99b8f5096 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CorporateStructureInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructureIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCorporatestructureIdInfoEndpoint( IGettable[CorporateStructureInfo, ConnectWiseManageRequestParams], IPaginateable[CorporateStructureInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CorporateStructureInfo) IPaginateable.__init__(self, CorporateStructureInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CorporateStructureInfo]: """ Performs a GET request against the /system/myCompany/corporateStructure/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CorporateStructureInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CorporateStructureInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CorporateStructureInfo: """ Performs a GET request against the /system/myCompany/corporateStructure/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: CorporateStructureInfo: The parsed response data. """ - return self._parse_one( - CorporateStructureInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CorporateStructureInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoCountEndpoint.py index 641dc8f28..df5c09ddb 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructureInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCorporatestructureInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myCompany/corporateStructure/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myCompany/corporateStructure/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoEndpoint.py index 2a1f0530b..2d9c214ab 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructureInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyCorporatestructureInfoCountEndpoint import ( SystemMycompanyCorporatestructureInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CorporateStructureInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructureInfoEndpoint( @@ -19,24 +18,17 @@ class SystemMycompanyCorporatestructureInfoEndpoint( IGettable[list[CorporateStructureInfo], ConnectWiseManageRequestParams], IPaginateable[CorporateStructureInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CorporateStructureInfo]) IPaginateable.__init__(self, CorporateStructureInfo) self.count = self._register_child_endpoint( - SystemMycompanyCorporatestructureInfoCountEndpoint( - client, parent_endpoint=self - ) + SystemMycompanyCorporatestructureInfoCountEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CorporateStructureInfo]: """ Performs a GET request against the /system/myCompany/corporateStructure/info endpoint and returns an initialized PaginatedResponse object. @@ -54,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CorporateStructureInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CorporateStructureInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CorporateStructureInfo]: """ Performs a GET request against the /system/myCompany/corporateStructure/info endpoint. @@ -76,7 +61,4 @@ def get( Returns: list[CorporateStructureInfo]: The parsed response data. """ - return self._parse_many( - CorporateStructureInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CorporateStructureInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsCountEndpoint.py index eac5e480b..9d4cfc40f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructurelevelsCountEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCorporatestructurelevelsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myCompany/corporateStructureLevels/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myCompany/corporateStructureLevels/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsEndpoint.py index 4ed51e45b..dd9c844c3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyCorporatestructurelevelsCountEndpoint import ( SystemMycompanyCorporatestructurelevelsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.SystemMycompanyCorporatestructurelevelsIdEndpoint import ( SystemMycompanyCorporatestructurelevelsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CorporateStructureLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructurelevelsEndpoint( @@ -22,41 +21,30 @@ class SystemMycompanyCorporatestructurelevelsEndpoint( IGettable[list[CorporateStructureLevel], ConnectWiseManageRequestParams], IPaginateable[CorporateStructureLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "corporateStructureLevels", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "corporateStructureLevels", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CorporateStructureLevel]) IPaginateable.__init__(self, CorporateStructureLevel) self.count = self._register_child_endpoint( - SystemMycompanyCorporatestructurelevelsCountEndpoint( - client, parent_endpoint=self - ) + SystemMycompanyCorporatestructurelevelsCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> SystemMycompanyCorporatestructurelevelsIdEndpoint: + def id(self, _id: int) -> SystemMycompanyCorporatestructurelevelsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyCorporatestructurelevelsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyCorporatestructurelevelsIdEndpoint: The initialized SystemMycompanyCorporatestructurelevelsIdEndpoint object. """ - child = SystemMycompanyCorporatestructurelevelsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMycompanyCorporatestructurelevelsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CorporateStructureLevel]: """ Performs a GET request against the /system/myCompany/corporateStructureLevels endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CorporateStructureLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CorporateStructureLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[CorporateStructureLevel]: """ Performs a GET request against the /system/myCompany/corporateStructureLevels endpoint. @@ -96,7 +77,4 @@ def get( Returns: list[CorporateStructureLevel]: The parsed response data. """ - return self._parse_many( - CorporateStructureLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(CorporateStructureLevel, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsIdEndpoint.py index 32a9a66c5..1fa2b55b7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCorporatestructurelevelsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CorporateStructureLevel from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCorporatestructurelevelsIdEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCorporatestructurelevelsIdEndpoint( IGettable[CorporateStructureLevel, ConnectWiseManageRequestParams], IPaginateable[CorporateStructureLevel, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, CorporateStructureLevel) IPaginateable.__init__(self, CorporateStructureLevel) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CorporateStructureLevel]: """ Performs a GET request against the /system/myCompany/corporateStructureLevels/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - CorporateStructureLevel, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), CorporateStructureLevel, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> CorporateStructureLevel: """ Performs a GET request against the /system/myCompany/corporateStructureLevels/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: CorporateStructureLevel: The parsed response data. """ - return self._parse_one( - CorporateStructureLevel, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(CorporateStructureLevel, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmCountEndpoint.py index c916997df..f3a8b7fc7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCrmCountEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCrmCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myCompany/crm/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myCompany/crm/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmEndpoint.py index f345b6056..58d9c1431 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmEndpoint.py @@ -1,23 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyCrmCountEndpoint import ( - SystemMycompanyCrmCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMycompanyCrmIdEndpoint import ( - SystemMycompanyCrmIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMycompanyCrmInfoEndpoint import ( - SystemMycompanyCrmInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyCrmCountEndpoint import SystemMycompanyCrmCountEndpoint +from pyconnectwise.endpoints.manage.SystemMycompanyCrmIdEndpoint import SystemMycompanyCrmIdEndpoint +from pyconnectwise.endpoints.manage.SystemMycompanyCrmInfoEndpoint import SystemMycompanyCrmInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Crm from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCrmEndpoint( @@ -25,38 +18,29 @@ class SystemMycompanyCrmEndpoint( IGettable[list[Crm], ConnectWiseManageRequestParams], IPaginateable[Crm, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "crm", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "crm", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Crm]) IPaginateable.__init__(self, Crm) - self.count = self._register_child_endpoint( - SystemMycompanyCrmCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemMycompanyCrmInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMycompanyCrmCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemMycompanyCrmInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMycompanyCrmIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyCrmIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyCrmIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyCrmIdEndpoint: The initialized SystemMycompanyCrmIdEndpoint object. """ child = SystemMycompanyCrmIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Crm]: """ Performs a GET request against the /system/myCompany/crm endpoint and returns an initialized PaginatedResponse object. @@ -73,20 +57,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Crm, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Crm, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Crm]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Crm]: """ Performs a GET request against the /system/myCompany/crm endpoint. @@ -96,6 +69,4 @@ def get( Returns: list[Crm]: The parsed response data. """ - return self._parse_many( - Crm, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Crm, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdEndpoint.py index 536102f2c..8399119f8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyCrmIdInfoEndpoint import ( - SystemMycompanyCrmIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyCrmIdInfoEndpoint import SystemMycompanyCrmIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Crm from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCrmIdEndpoint( ConnectWiseEndpoint, IGettable[Crm, ConnectWiseManageRequestParams], - IPuttable[Crm, ConnectWiseManageRequestParams], IPatchable[Crm, ConnectWiseManageRequestParams], + IPuttable[Crm, ConnectWiseManageRequestParams], IPaginateable[Crm, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Crm) - IPuttable.__init__(self, Crm) IPatchable.__init__(self, Crm) + IPuttable.__init__(self, Crm) IPaginateable.__init__(self, Crm) - self.info = self._register_child_endpoint( - SystemMycompanyCrmIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemMycompanyCrmIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Crm]: """ Performs a GET request against the /system/myCompany/crm/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,20 +45,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Crm, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Crm, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Crm: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Crm: """ Performs a GET request against the /system/myCompany/crm/{id} endpoint. @@ -81,17 +57,11 @@ def get( Returns: Crm: The parsed response data. """ - return self._parse_one( - Crm, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Crm, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Crm: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Crm: """ - Performs a PUT request against the /system/myCompany/crm/{id} endpoint. + Performs a PATCH request against the /system/myCompany/crm/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -99,17 +69,11 @@ def put( Returns: Crm: The parsed response data. """ - return self._parse_one( - Crm, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Crm, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Crm: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Crm: """ - Performs a PATCH request against the /system/myCompany/crm/{id} endpoint. + Performs a PUT request against the /system/myCompany/crm/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -117,6 +81,4 @@ def patch( Returns: Crm: The parsed response data. """ - return self._parse_one( - Crm, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Crm, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdInfoEndpoint.py index 4d5345920..40e11041c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CrmInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCrmIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCrmIdInfoEndpoint( IGettable[CrmInfo, ConnectWiseManageRequestParams], IPaginateable[CrmInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, CrmInfo) IPaginateable.__init__(self, CrmInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CrmInfo]: """ Performs a GET request against the /system/myCompany/crm/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - CrmInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), CrmInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> CrmInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> CrmInfo: """ Performs a GET request against the /system/myCompany/crm/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: CrmInfo: The parsed response data. """ - return self._parse_one( - CrmInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(CrmInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoCountEndpoint.py index 319259d38..80f70a334 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCrmInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyCrmInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myCompany/crm/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myCompany/crm/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoEndpoint.py index 9a9a0b0ea..f90a38e10 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyCrmInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyCrmInfoCountEndpoint import ( - SystemMycompanyCrmInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyCrmInfoCountEndpoint import SystemMycompanyCrmInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import CrmInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyCrmInfoEndpoint( @@ -19,22 +16,15 @@ class SystemMycompanyCrmInfoEndpoint( IGettable[list[CrmInfo], ConnectWiseManageRequestParams], IPaginateable[CrmInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[CrmInfo]) IPaginateable.__init__(self, CrmInfo) - self.count = self._register_child_endpoint( - SystemMycompanyCrmInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMycompanyCrmInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[CrmInfo]: """ Performs a GET request against the /system/myCompany/crm/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - CrmInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), CrmInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[CrmInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[CrmInfo]: """ Performs a GET request against the /system/myCompany/crm/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[CrmInfo]: The parsed response data. """ - return self._parse_many( - CrmInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(CrmInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsEndpoint.py index e927b91d7..932003332 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyDocumentsIdEndpoint import ( - SystemMycompanyDocumentsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyDocumentsIdEndpoint import SystemMycompanyDocumentsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import DocumentSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyDocumentsEndpoint( @@ -19,31 +16,26 @@ class SystemMycompanyDocumentsEndpoint( IGettable[list[DocumentSetup], ConnectWiseManageRequestParams], IPaginateable[DocumentSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "documents", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "documents", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[DocumentSetup]) IPaginateable.__init__(self, DocumentSetup) - def id(self, id: int) -> SystemMycompanyDocumentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyDocumentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyDocumentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyDocumentsIdEndpoint: The initialized SystemMycompanyDocumentsIdEndpoint object. """ child = SystemMycompanyDocumentsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DocumentSetup]: """ Performs a GET request against the /system/mycompany/documents endpoint and returns an initialized PaginatedResponse object. @@ -61,18 +53,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DocumentSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DocumentSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[DocumentSetup]: """ Performs a GET request against the /system/mycompany/documents endpoint. @@ -83,6 +68,4 @@ def get( Returns: list[DocumentSetup]: The parsed response data. """ - return self._parse_many( - DocumentSetup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(DocumentSetup, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsIdEndpoint.py index c49074e68..92bfbab05 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyDocumentsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import DocumentSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyDocumentsIdEndpoint( ConnectWiseEndpoint, IGettable[DocumentSetup, ConnectWiseManageRequestParams], - IPuttable[DocumentSetup, ConnectWiseManageRequestParams], IPatchable[DocumentSetup, ConnectWiseManageRequestParams], + IPuttable[DocumentSetup, ConnectWiseManageRequestParams], IPaginateable[DocumentSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, DocumentSetup) - IPuttable.__init__(self, DocumentSetup) IPatchable.__init__(self, DocumentSetup) + IPuttable.__init__(self, DocumentSetup) IPaginateable.__init__(self, DocumentSetup) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[DocumentSetup]: """ Performs a GET request against the /system/mycompany/documents/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - DocumentSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), DocumentSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DocumentSetup: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DocumentSetup: """ Performs a GET request against the /system/mycompany/documents/{id} endpoint. @@ -74,17 +56,11 @@ def get( Returns: DocumentSetup: The parsed response data. """ - return self._parse_one( - DocumentSetup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(DocumentSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> DocumentSetup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> DocumentSetup: """ - Performs a PUT request against the /system/mycompany/documents/{id} endpoint. + Performs a PATCH request against the /system/mycompany/documents/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +68,11 @@ def put( Returns: DocumentSetup: The parsed response data. """ - return self._parse_one( - DocumentSetup, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(DocumentSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> DocumentSetup: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> DocumentSetup: """ - Performs a PATCH request against the /system/mycompany/documents/{id} endpoint. + Performs a PUT request against the /system/mycompany/documents/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,7 +80,4 @@ def patch( Returns: DocumentSetup: The parsed response data. """ - return self._parse_one( - DocumentSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(DocumentSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyEndpoint.py index 2fd528dba..991070734 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyEndpoint.py @@ -1,33 +1,24 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyDocumentsEndpoint import ( - SystemMycompanyDocumentsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMycompanyInfoEndpoint import ( - SystemMycompanyInfoEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMycompanyDocumentsEndpoint import SystemMycompanyDocumentsEndpoint +from pyconnectwise.endpoints.manage.SystemMycompanyInfoEndpoint import SystemMycompanyInfoEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyReportingservicesEndpoint import ( SystemMycompanyReportingservicesEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMycompanyServicesEndpoint import ( - SystemMycompanyServicesEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMycompanyServicesEndpoint import SystemMycompanyServicesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "mycompany", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "mycompany", parent_endpoint=parent_endpoint) + self.documents = self._register_child_endpoint(SystemMycompanyDocumentsEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemMycompanyInfoEndpoint(client, parent_endpoint=self)) self.reporting_services = self._register_child_endpoint( SystemMycompanyReportingservicesEndpoint(client, parent_endpoint=self) ) - self.documents = self._register_child_endpoint( - SystemMycompanyDocumentsEndpoint(client, parent_endpoint=self) - ) - self.services = self._register_child_endpoint( - SystemMycompanyServicesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemMycompanyInfoEndpoint(client, parent_endpoint=self) - ) + self.services = self._register_child_endpoint(SystemMycompanyServicesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoEndpoint.py index ac7eddce1..591c5eea6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoEndpoint.py @@ -1,15 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyInfoServicesEndpoint import ( - SystemMycompanyInfoServicesEndpoint, -) +from pyconnectwise.endpoints.manage.SystemMycompanyInfoServicesEndpoint import SystemMycompanyInfoServicesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) - - self.services = self._register_child_endpoint( - SystemMycompanyInfoServicesEndpoint(client, parent_endpoint=self) - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) + + self.services = self._register_child_endpoint(SystemMycompanyInfoServicesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesEndpoint.py index 956676cd8..7ba332df1 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyInfoServicesIdEndpoint import ( - SystemMycompanyInfoServicesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyInfoServicesIdEndpoint import SystemMycompanyInfoServicesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyInfoServicesEndpoint( @@ -19,31 +16,26 @@ class SystemMycompanyInfoServicesEndpoint( IGettable[list[ServiceInfo], ConnectWiseManageRequestParams], IPaginateable[ServiceInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "services", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "services", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ServiceInfo]) IPaginateable.__init__(self, ServiceInfo) - def id(self, id: int) -> SystemMycompanyInfoServicesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyInfoServicesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyInfoServicesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyInfoServicesIdEndpoint: The initialized SystemMycompanyInfoServicesIdEndpoint object. """ child = SystemMycompanyInfoServicesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceInfo]: """ Performs a GET request against the /system/mycompany/info/services endpoint and returns an initialized PaginatedResponse object. @@ -61,19 +53,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ServiceInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ServiceInfo]: """ Performs a GET request against the /system/mycompany/info/services endpoint. @@ -83,6 +66,4 @@ def get( Returns: list[ServiceInfo]: The parsed response data. """ - return self._parse_many( - ServiceInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ServiceInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesIdEndpoint.py index 73c1f1a21..e7e37f16c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyInfoServicesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ServiceInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyInfoServicesIdEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyInfoServicesIdEndpoint( IGettable[ServiceInfo, ConnectWiseManageRequestParams], IPaginateable[ServiceInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ServiceInfo) IPaginateable.__init__(self, ServiceInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ServiceInfo]: """ Performs a GET request against the /system/mycompany/info/services/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ServiceInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ServiceInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ServiceInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ServiceInfo: """ Performs a GET request against the /system/mycompany/info/services/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: ServiceInfo: The parsed response data. """ - return self._parse_one( - ServiceInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ServiceInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherCountEndpoint.py index fb9937f58..54439213d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyOtherCountEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyOtherCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myCompany/other/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myCompany/other/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherEndpoint.py index 391364783..fd082f688 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyOtherCountEndpoint import ( - SystemMycompanyOtherCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemMycompanyOtherIdEndpoint import ( - SystemMycompanyOtherIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyOtherCountEndpoint import SystemMycompanyOtherCountEndpoint +from pyconnectwise.endpoints.manage.SystemMycompanyOtherIdEndpoint import SystemMycompanyOtherIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Other from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyOtherEndpoint( @@ -22,35 +17,28 @@ class SystemMycompanyOtherEndpoint( IGettable[list[Other], ConnectWiseManageRequestParams], IPaginateable[Other, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "other", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "other", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Other]) IPaginateable.__init__(self, Other) - self.count = self._register_child_endpoint( - SystemMycompanyOtherCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemMycompanyOtherCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemMycompanyOtherIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyOtherIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyOtherIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyOtherIdEndpoint: The initialized SystemMycompanyOtherIdEndpoint object. """ child = SystemMycompanyOtherIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Other]: """ Performs a GET request against the /system/myCompany/other endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Other, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Other, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Other]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Other]: """ Performs a GET request against the /system/myCompany/other endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[Other]: The parsed response data. """ - return self._parse_many( - Other, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Other, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherIdEndpoint.py index 103fdcaa4..140ca2b74 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyOtherIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Other from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyOtherIdEndpoint( ConnectWiseEndpoint, IGettable[Other, ConnectWiseManageRequestParams], - IPuttable[Other, ConnectWiseManageRequestParams], IPatchable[Other, ConnectWiseManageRequestParams], + IPuttable[Other, ConnectWiseManageRequestParams], IPaginateable[Other, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Other) - IPuttable.__init__(self, Other) IPatchable.__init__(self, Other) + IPuttable.__init__(self, Other) IPaginateable.__init__(self, Other) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Other]: """ Performs a GET request against the /system/myCompany/other/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +42,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Other, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Other, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Other: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Other: """ Performs a GET request against the /system/myCompany/other/{id} endpoint. @@ -74,17 +54,11 @@ def get( Returns: Other: The parsed response data. """ - return self._parse_one( - Other, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Other, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Other: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Other: """ - Performs a PUT request against the /system/myCompany/other/{id} endpoint. + Performs a PATCH request against the /system/myCompany/other/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +66,11 @@ def put( Returns: Other: The parsed response data. """ - return self._parse_one( - Other, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Other, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Other: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Other: """ - Performs a PATCH request against the /system/myCompany/other/{id} endpoint. + Performs a PUT request against the /system/myCompany/other/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +78,4 @@ def patch( Returns: Other: The parsed response data. """ - return self._parse_one( - Other, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Other, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesEndpoint.py index adee6e3bf..3ed3f92f1 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyReportingservicesIdEndpoint import ( SystemMycompanyReportingservicesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ReportingService from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyReportingservicesEndpoint( @@ -19,33 +18,26 @@ class SystemMycompanyReportingservicesEndpoint( IGettable[list[ReportingService], ConnectWiseManageRequestParams], IPaginateable[ReportingService, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reportingServices", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reportingServices", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ReportingService]) IPaginateable.__init__(self, ReportingService) - def id(self, id: int) -> SystemMycompanyReportingservicesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyReportingservicesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyReportingservicesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyReportingservicesIdEndpoint: The initialized SystemMycompanyReportingservicesIdEndpoint object. """ - child = SystemMycompanyReportingservicesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemMycompanyReportingservicesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportingService]: """ Performs a GET request against the /system/mycompany/reportingServices endpoint and returns an initialized PaginatedResponse object. @@ -63,18 +55,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ReportingService, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ReportingService, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ReportingService]: """ Performs a GET request against the /system/mycompany/reportingServices endpoint. @@ -85,7 +70,4 @@ def get( Returns: list[ReportingService]: The parsed response data. """ - return self._parse_many( - ReportingService, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ReportingService, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdEndpoint.py index b5db5134f..95747c6f8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdEndpoint.py @@ -1,49 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyReportingservicesIdTestconnectionEndpoint import ( SystemMycompanyReportingservicesIdTestconnectionEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ReportingService from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyReportingservicesIdEndpoint( ConnectWiseEndpoint, IGettable[ReportingService, ConnectWiseManageRequestParams], - IPuttable[ReportingService, ConnectWiseManageRequestParams], IPatchable[ReportingService, ConnectWiseManageRequestParams], + IPuttable[ReportingService, ConnectWiseManageRequestParams], IPaginateable[ReportingService, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ReportingService) - IPuttable.__init__(self, ReportingService) IPatchable.__init__(self, ReportingService) + IPuttable.__init__(self, ReportingService) IPaginateable.__init__(self, ReportingService) self.test_connection = self._register_child_endpoint( - SystemMycompanyReportingservicesIdTestconnectionEndpoint( - client, parent_endpoint=self - ) + SystemMycompanyReportingservicesIdTestconnectionEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportingService]: """ Performs a GET request against the /system/mycompany/reportingServices/{id} endpoint and returns an initialized PaginatedResponse object. @@ -61,19 +50,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ReportingService, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ReportingService, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportingService: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportingService: """ Performs a GET request against the /system/mycompany/reportingServices/{id} endpoint. @@ -83,18 +63,11 @@ def get( Returns: ReportingService: The parsed response data. """ - return self._parse_one( - ReportingService, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ReportingService, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportingService: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ReportingService: """ - Performs a PUT request against the /system/mycompany/reportingServices/{id} endpoint. + Performs a PATCH request against the /system/mycompany/reportingServices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -102,18 +75,11 @@ def put( Returns: ReportingService: The parsed response data. """ - return self._parse_one( - ReportingService, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ReportingService, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportingService: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportingService: """ - Performs a PATCH request against the /system/mycompany/reportingServices/{id} endpoint. + Performs a PUT request against the /system/mycompany/reportingServices/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -121,7 +87,4 @@ def patch( Returns: ReportingService: The parsed response data. """ - return self._parse_one( - ReportingService, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ReportingService, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdTestconnectionEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdTestconnectionEndpoint.py index c827bb010..3193d2be2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdTestconnectionEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyReportingservicesIdTestconnectionEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyReportingservicesIdTestconnectionEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testConnection", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testConnection", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/mycompany/reportingServices/{id}/testConnection endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesEndpoint.py index ef197e21f..d8e0d3963 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMycompanyServicesIdEndpoint import ( - SystemMycompanyServicesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyServicesIdEndpoint import SystemMycompanyServicesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Service from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyServicesEndpoint( @@ -19,31 +16,26 @@ class SystemMycompanyServicesEndpoint( IGettable[list[Service], ConnectWiseManageRequestParams], IPaginateable[Service, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "services", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "services", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Service]) IPaginateable.__init__(self, Service) - def id(self, id: int) -> SystemMycompanyServicesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyServicesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyServicesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyServicesIdEndpoint: The initialized SystemMycompanyServicesIdEndpoint object. """ child = SystemMycompanyServicesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Service]: """ Performs a GET request against the /system/mycompany/services endpoint and returns an initialized PaginatedResponse object. @@ -60,20 +52,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Service, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Service, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Service]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Service]: """ Performs a GET request against the /system/mycompany/services endpoint. @@ -83,6 +64,4 @@ def get( Returns: list[Service]: The parsed response data. """ - return self._parse_many( - Service, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Service, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesIdEndpoint.py index 7f631da28..db51254e8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyServicesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Service from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyServicesIdEndpoint( ConnectWiseEndpoint, IGettable[Service, ConnectWiseManageRequestParams], - IPuttable[Service, ConnectWiseManageRequestParams], IPatchable[Service, ConnectWiseManageRequestParams], + IPuttable[Service, ConnectWiseManageRequestParams], IPaginateable[Service, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Service) - IPuttable.__init__(self, Service) IPatchable.__init__(self, Service) + IPuttable.__init__(self, Service) IPaginateable.__init__(self, Service) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Service]: """ Performs a GET request against the /system/mycompany/services/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +42,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Service, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Service, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Service: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Service: """ Performs a GET request against the /system/mycompany/services/{id} endpoint. @@ -74,17 +54,11 @@ def get( Returns: Service: The parsed response data. """ - return self._parse_one( - Service, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Service, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Service: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Service: """ - Performs a PUT request against the /system/mycompany/services/{id} endpoint. + Performs a PATCH request against the /system/mycompany/services/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +66,11 @@ def put( Returns: Service: The parsed response data. """ - return self._parse_one( - Service, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Service, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Service: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Service: """ - Performs a PATCH request against the /system/mycompany/services/{id} endpoint. + Performs a PUT request against the /system/mycompany/services/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +78,4 @@ def patch( Returns: Service: The parsed response data. """ - return self._parse_one( - Service, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Service, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseCountEndpoint.py index c94245a2e..d7290d56b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyTimeexpenseCountEndpoint( @@ -16,18 +15,13 @@ class SystemMycompanyTimeexpenseCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/myCompany/timeExpense/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/myCompany/timeExpense/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseEndpoint.py index 485554b1d..cff13636d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemMycompanyTimeexpenseCountEndpoint import ( SystemMycompanyTimeexpenseCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemMycompanyTimeexpenseIdEndpoint import ( - SystemMycompanyTimeexpenseIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMycompanyTimeexpenseIdEndpoint import SystemMycompanyTimeexpenseIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeExpense from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyTimeexpenseEndpoint( @@ -22,10 +19,8 @@ class SystemMycompanyTimeexpenseEndpoint( IGettable[list[TimeExpense], ConnectWiseManageRequestParams], IPaginateable[TimeExpense, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "timeExpense", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "timeExpense", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeExpense]) IPaginateable.__init__(self, TimeExpense) @@ -33,24 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemMycompanyTimeexpenseCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemMycompanyTimeexpenseIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemMycompanyTimeexpenseIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemMycompanyTimeexpenseIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemMycompanyTimeexpenseIdEndpoint: The initialized SystemMycompanyTimeexpenseIdEndpoint object. """ child = SystemMycompanyTimeexpenseIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeExpense]: """ Performs a GET request against the /system/myCompany/timeExpense endpoint and returns an initialized PaginatedResponse object. @@ -68,19 +60,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeExpense, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeExpense, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TimeExpense]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TimeExpense]: """ Performs a GET request against the /system/myCompany/timeExpense endpoint. @@ -90,6 +73,4 @@ def get( Returns: list[TimeExpense]: The parsed response data. """ - return self._parse_many( - TimeExpense, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TimeExpense, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseIdEndpoint.py index dfdba404f..10d7100ae 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMycompanyTimeexpenseIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TimeExpense from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMycompanyTimeexpenseIdEndpoint( ConnectWiseEndpoint, IGettable[TimeExpense, ConnectWiseManageRequestParams], - IPuttable[TimeExpense, ConnectWiseManageRequestParams], IPatchable[TimeExpense, ConnectWiseManageRequestParams], + IPuttable[TimeExpense, ConnectWiseManageRequestParams], IPaginateable[TimeExpense, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeExpense) - IPuttable.__init__(self, TimeExpense) IPatchable.__init__(self, TimeExpense) + IPuttable.__init__(self, TimeExpense) IPaginateable.__init__(self, TimeExpense) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeExpense]: """ Performs a GET request against the /system/myCompany/timeExpense/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeExpense, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeExpense, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeExpense: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeExpense: """ Performs a GET request against the /system/myCompany/timeExpense/{id} endpoint. @@ -74,17 +56,11 @@ def get( Returns: TimeExpense: The parsed response data. """ - return self._parse_one( - TimeExpense, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(TimeExpense, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeExpense: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TimeExpense: """ - Performs a PUT request against the /system/myCompany/timeExpense/{id} endpoint. + Performs a PATCH request against the /system/myCompany/timeExpense/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +68,11 @@ def put( Returns: TimeExpense: The parsed response data. """ - return self._parse_one( - TimeExpense, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TimeExpense, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeExpense: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeExpense: """ - Performs a PATCH request against the /system/myCompany/timeExpense/{id} endpoint. + Performs a PUT request against the /system/myCompany/timeExpense/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,6 +80,4 @@ def patch( Returns: TimeExpense: The parsed response data. """ - return self._parse_one( - TimeExpense, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TimeExpense, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMymembersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMymembersEndpoint.py index 1d6b58e06..f0d4ee951 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMymembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMymembersEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMymembersInfoEndpoint import ( - SystemMymembersInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMymembersInfoEndpoint import SystemMymembersInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MyMember from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMymembersEndpoint( @@ -19,22 +16,15 @@ class SystemMymembersEndpoint( IGettable[MyMember, ConnectWiseManageRequestParams], IPaginateable[MyMember, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "myMembers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "myMembers", parent_endpoint=parent_endpoint) IGettable.__init__(self, MyMember) IPaginateable.__init__(self, MyMember) - self.info = self._register_child_endpoint( - SystemMymembersInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemMymembersInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MyMember]: """ Performs a GET request against the /system/myMembers endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MyMember, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MyMember, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MyMember: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MyMember: """ Performs a GET request against the /system/myMembers endpoint. @@ -74,6 +53,4 @@ def get( Returns: MyMember: The parsed response data. """ - return self._parse_one( - MyMember, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(MyMember, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMymembersInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMymembersInfoEndpoint.py index 3426c7b37..312165e6e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMymembersInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMymembersInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MyMemberInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMymembersInfoEndpoint( @@ -16,18 +15,13 @@ class SystemMymembersInfoEndpoint( IGettable[MyMemberInfo, ConnectWiseManageRequestParams], IPaginateable[MyMemberInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, MyMemberInfo) IPaginateable.__init__(self, MyMemberInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MyMemberInfo]: """ Performs a GET request against the /system/myMembers/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - MyMemberInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), MyMemberInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> MyMemberInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> MyMemberInfo: """ Performs a GET request against the /system/myMembers/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: MyMemberInfo: The parsed response data. """ - return self._parse_one( - MyMemberInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(MyMemberInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemMysecurityCustomizeitemsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMysecurityCustomizeitemsEndpoint.py index 41fdef085..770a01534 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMysecurityCustomizeitemsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMysecurityCustomizeitemsEndpoint.py @@ -1,8 +1,11 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemMysecurityCustomizeitemsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "customizeItems", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "customizeItems", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemMysecurityEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemMysecurityEndpoint.py index e1057e848..443ba6b7b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemMysecurityEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemMysecurityEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemMysecurityCustomizeitemsEndpoint import ( - SystemMysecurityCustomizeitemsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemMysecurityCustomizeitemsEndpoint import SystemMysecurityCustomizeitemsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import MySecurity from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemMysecurityEndpoint( @@ -19,10 +16,8 @@ class SystemMysecurityEndpoint( IGettable[list[MySecurity], ConnectWiseManageRequestParams], IPaginateable[MySecurity, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "mySecurity", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "mySecurity", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[MySecurity]) IPaginateable.__init__(self, MySecurity) @@ -31,10 +26,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[MySecurity]: """ Performs a GET request against the /system/mySecurity endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +43,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - MySecurity, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), MySecurity, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[MySecurity]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[MySecurity]: """ Performs a GET request against the /system/mySecurity endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[MySecurity]: The parsed response data. """ - return self._parse_many( - MySecurity, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(MySecurity, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsCountEndpoint.py index ad359c982..27b65a475 100644 --- a/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemNotificationrecipientsCountEndpoint( @@ -16,18 +15,13 @@ class SystemNotificationrecipientsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/notificationRecipients/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/notificationRecipients/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsEndpoint.py index ea375cd91..d276412e3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemNotificationrecipientsCountEndpoint import ( SystemNotificationrecipientsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemNotificationrecipientsIdEndpoint import ( - SystemNotificationrecipientsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemNotificationrecipientsIdEndpoint import SystemNotificationrecipientsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import NotificationRecipient from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemNotificationrecipientsEndpoint( @@ -22,10 +19,8 @@ class SystemNotificationrecipientsEndpoint( IGettable[list[NotificationRecipient], ConnectWiseManageRequestParams], IPaginateable[NotificationRecipient, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notificationRecipients", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notificationRecipients", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[NotificationRecipient]) IPaginateable.__init__(self, NotificationRecipient) @@ -33,26 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemNotificationrecipientsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemNotificationrecipientsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemNotificationrecipientsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemNotificationrecipientsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemNotificationrecipientsIdEndpoint: The initialized SystemNotificationrecipientsIdEndpoint object. """ - child = SystemNotificationrecipientsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemNotificationrecipientsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[NotificationRecipient]: """ Performs a GET request against the /system/notificationRecipients endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - NotificationRecipient, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), NotificationRecipient, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[NotificationRecipient]: """ Performs a GET request against the /system/notificationRecipients endpoint. @@ -92,7 +75,4 @@ def get( Returns: list[NotificationRecipient]: The parsed response data. """ - return self._parse_many( - NotificationRecipient, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(NotificationRecipient, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsIdEndpoint.py index 25e11f8d0..b9bc1f259 100644 --- a/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemNotificationrecipientsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import NotificationRecipient from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemNotificationrecipientsIdEndpoint( @@ -16,18 +15,13 @@ class SystemNotificationrecipientsIdEndpoint( IGettable[NotificationRecipient, ConnectWiseManageRequestParams], IPaginateable[NotificationRecipient, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, NotificationRecipient) IPaginateable.__init__(self, NotificationRecipient) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[NotificationRecipient]: """ Performs a GET request against the /system/notificationRecipients/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - NotificationRecipient, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), NotificationRecipient, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> NotificationRecipient: """ Performs a GET request against the /system/notificationRecipients/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: NotificationRecipient: The parsed response data. """ - return self._parse_one( - NotificationRecipient, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(NotificationRecipient, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsCountEndpoint.py index d3b39c5bb..845d77448 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOffice365EmailsetupsCountEndpoint( @@ -16,18 +15,13 @@ class SystemOffice365EmailsetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/office365/emailSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/office365/emailSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsEndpoint.py index 9b02659c4..6d2883975 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemOffice365EmailsetupsCountEndpoint import ( SystemOffice365EmailsetupsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemOffice365EmailsetupsIdEndpoint import ( - SystemOffice365EmailsetupsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemOffice365EmailsetupsIdEndpoint import SystemOffice365EmailsetupsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Office365EmailSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOffice365EmailsetupsEndpoint( @@ -24,10 +20,8 @@ class SystemOffice365EmailsetupsEndpoint( IPostable[Office365EmailSetup, ConnectWiseManageRequestParams], IPaginateable[Office365EmailSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "emailSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "emailSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Office365EmailSetup]) IPostable.__init__(self, Office365EmailSetup) IPaginateable.__init__(self, Office365EmailSetup) @@ -36,24 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemOffice365EmailsetupsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemOffice365EmailsetupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemOffice365EmailsetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemOffice365EmailsetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemOffice365EmailsetupsIdEndpoint: The initialized SystemOffice365EmailsetupsIdEndpoint object. """ child = SystemOffice365EmailsetupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Office365EmailSetup]: """ Performs a GET request against the /system/office365/emailSetups endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Office365EmailSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Office365EmailSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[Office365EmailSetup]: """ Performs a GET request against the /system/office365/emailSetups endpoint. @@ -93,15 +77,10 @@ def get( Returns: list[Office365EmailSetup]: The parsed response data. """ - return self._parse_many( - Office365EmailSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(Office365EmailSetup, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> Office365EmailSetup: """ Performs a POST request against the /system/office365/emailSetups endpoint. @@ -112,7 +91,4 @@ def post( Returns: Office365EmailSetup: The parsed response data. """ - return self._parse_one( - Office365EmailSetup, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(Office365EmailSetup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdAuthorizeEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdAuthorizeEndpoint.py index c50821244..256d14210 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdAuthorizeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdAuthorizeEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOffice365EmailsetupsIdAuthorizeEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "authorize", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "authorize", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/office365/emailSetups/{id}/authorize endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdEndpoint.py index 6e4b5f74f..0fe925c38 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemOffice365EmailsetupsIdAuthorizeEndpoint import ( SystemOffice365EmailsetupsIdAuthorizeEndpoint, @@ -5,51 +7,38 @@ from pyconnectwise.endpoints.manage.SystemOffice365EmailsetupsIdTestconnectionEndpoint import ( SystemOffice365EmailsetupsIdTestconnectionEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Office365EmailSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOffice365EmailsetupsIdEndpoint( ConnectWiseEndpoint, IGettable[Office365EmailSetup, ConnectWiseManageRequestParams], - IPuttable[Office365EmailSetup, ConnectWiseManageRequestParams], IPatchable[Office365EmailSetup, ConnectWiseManageRequestParams], + IPuttable[Office365EmailSetup, ConnectWiseManageRequestParams], IPaginateable[Office365EmailSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Office365EmailSetup) - IPuttable.__init__(self, Office365EmailSetup) IPatchable.__init__(self, Office365EmailSetup) + IPuttable.__init__(self, Office365EmailSetup) IPaginateable.__init__(self, Office365EmailSetup) self.authorize = self._register_child_endpoint( SystemOffice365EmailsetupsIdAuthorizeEndpoint(client, parent_endpoint=self) ) self.test_connection = self._register_child_endpoint( - SystemOffice365EmailsetupsIdTestconnectionEndpoint( - client, parent_endpoint=self - ) + SystemOffice365EmailsetupsIdTestconnectionEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Office365EmailSetup]: """ Performs a GET request against the /system/office365/emailSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -67,54 +56,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - Office365EmailSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), Office365EmailSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Office365EmailSetup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/office365/emailSetups/{id} endpoint. + Performs a DELETE request against the /system/office365/emailSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Office365EmailSetup: The parsed response data. """ - return self._parse_one( - Office365EmailSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> Office365EmailSetup: """ - Performs a DELETE request against the /system/office365/emailSetups/{id} endpoint. + Performs a GET request against the /system/office365/emailSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Office365EmailSetup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Office365EmailSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> Office365EmailSetup: """ - Performs a PUT request against the /system/office365/emailSetups/{id} endpoint. + Performs a PATCH request against the /system/office365/emailSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -122,18 +95,13 @@ def put( Returns: Office365EmailSetup: The parsed response data. """ - return self._parse_one( - Office365EmailSetup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(Office365EmailSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> Office365EmailSetup: """ - Performs a PATCH request against the /system/office365/emailSetups/{id} endpoint. + Performs a PUT request against the /system/office365/emailSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -141,7 +109,4 @@ def patch( Returns: Office365EmailSetup: The parsed response data. """ - return self._parse_one( - Office365EmailSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(Office365EmailSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdTestconnectionEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdTestconnectionEndpoint.py index d05a49f98..d46194c20 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdTestconnectionEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOffice365EmailsetupsIdTestconnectionEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOffice365EmailsetupsIdTestconnectionEndpoint( ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testConnection", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testConnection", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /system/office365/emailSetups/{id}/testConnection endpoint. @@ -32,7 +26,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOffice365Endpoint.py b/src/pyconnectwise/endpoints/manage/SystemOffice365Endpoint.py index 50ece8824..ae8d3bc94 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOffice365Endpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOffice365Endpoint.py @@ -1,14 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemOffice365EmailsetupsEndpoint import ( - SystemOffice365EmailsetupsEndpoint, -) +from pyconnectwise.endpoints.manage.SystemOffice365EmailsetupsEndpoint import SystemOffice365EmailsetupsEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOffice365Endpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "office365", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "office365", parent_endpoint=parent_endpoint) self.email_setups = self._register_child_endpoint( SystemOffice365EmailsetupsEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingCountEndpoint.py index e343839f4..b656fa244 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingCountEndpoint.py @@ -17,9 +17,7 @@ class SystemOnpremisesearchsettingCountEndpoint( IPaginateable[Count, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) @@ -67,6 +65,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingEndpoint.py index 8aa22b6c2..0123431fa 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingEndpoint.py @@ -9,9 +9,7 @@ class SystemOnpremisesearchsettingEndpoint(ConnectWiseEndpoint): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "onPremiseSearchSetting", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "onPremiseSearchSetting", parent_endpoint=parent_endpoint) self.count = self._register_child_endpoint( SystemOnpremisesearchsettingCountEndpoint(client, parent_endpoint=self) @@ -26,8 +24,6 @@ def id(self, id: int) -> SystemOnpremisesearchsettingIdEndpoint: # noqa: A002 Returns: SystemOnpremisesearchsettingIdEndpoint: The initialized SystemOnpremisesearchsettingIdEndpoint object. """ - child = SystemOnpremisesearchsettingIdEndpoint( - self.client, parent_endpoint=self - ) + child = SystemOnpremisesearchsettingIdEndpoint(self.client, parent_endpoint=self) child._id = id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingIdEndpoint.py index c9b9c5707..9593ddf69 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOnpremisesearchsettingIdEndpoint.py @@ -22,9 +22,7 @@ class SystemOnpremisesearchsettingIdEndpoint( IPaginateable[OnPremiseSearchSetting, ConnectWiseManageRequestParams], ): def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OnPremiseSearchSetting) IPuttable.__init__(self, OnPremiseSearchSetting) IPatchable.__init__(self, OnPremiseSearchSetting) diff --git a/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsCountEndpoint.py index 7799163d4..d08d6c27e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOsgradeweightsCountEndpoint( @@ -16,18 +15,13 @@ class SystemOsgradeweightsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/osgradeweights/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/osgradeweights/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsEndpoint.py index 88df88700..4e2aa17f6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemOsgradeweightsCountEndpoint import ( - SystemOsgradeweightsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemOsgradeweightsIdEndpoint import ( - SystemOsgradeweightsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemOsgradeweightsCountEndpoint import SystemOsgradeweightsCountEndpoint +from pyconnectwise.endpoints.manage.SystemOsgradeweightsIdEndpoint import SystemOsgradeweightsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import OsGradeWeight from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOsgradeweightsEndpoint( @@ -22,35 +17,28 @@ class SystemOsgradeweightsEndpoint( IGettable[list[OsGradeWeight], ConnectWiseManageRequestParams], IPaginateable[OsGradeWeight, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "osgradeweights", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "osgradeweights", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[OsGradeWeight]) IPaginateable.__init__(self, OsGradeWeight) - self.count = self._register_child_endpoint( - SystemOsgradeweightsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemOsgradeweightsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemOsgradeweightsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemOsgradeweightsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemOsgradeweightsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemOsgradeweightsIdEndpoint: The initialized SystemOsgradeweightsIdEndpoint object. """ child = SystemOsgradeweightsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OsGradeWeight]: """ Performs a GET request against the /system/osgradeweights endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OsGradeWeight, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OsGradeWeight, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[OsGradeWeight]: """ Performs a GET request against the /system/osgradeweights endpoint. @@ -90,6 +71,4 @@ def get( Returns: list[OsGradeWeight]: The parsed response data. """ - return self._parse_many( - OsGradeWeight, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(OsGradeWeight, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsIdEndpoint.py index 038f088c5..dd76319a7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemOsgradeweightsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import OsGradeWeight from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemOsgradeweightsIdEndpoint( ConnectWiseEndpoint, IGettable[OsGradeWeight, ConnectWiseManageRequestParams], - IPuttable[OsGradeWeight, ConnectWiseManageRequestParams], IPatchable[OsGradeWeight, ConnectWiseManageRequestParams], + IPuttable[OsGradeWeight, ConnectWiseManageRequestParams], IPaginateable[OsGradeWeight, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, OsGradeWeight) - IPuttable.__init__(self, OsGradeWeight) IPatchable.__init__(self, OsGradeWeight) + IPuttable.__init__(self, OsGradeWeight) IPaginateable.__init__(self, OsGradeWeight) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[OsGradeWeight]: """ Performs a GET request against the /system/osgradeweights/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - OsGradeWeight, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), OsGradeWeight, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OsGradeWeight: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OsGradeWeight: """ Performs a GET request against the /system/osgradeweights/{id} endpoint. @@ -74,17 +56,11 @@ def get( Returns: OsGradeWeight: The parsed response data. """ - return self._parse_one( - OsGradeWeight, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(OsGradeWeight, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> OsGradeWeight: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> OsGradeWeight: """ - Performs a PUT request against the /system/osgradeweights/{id} endpoint. + Performs a PATCH request against the /system/osgradeweights/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +68,11 @@ def put( Returns: OsGradeWeight: The parsed response data. """ - return self._parse_one( - OsGradeWeight, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(OsGradeWeight, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> OsGradeWeight: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> OsGradeWeight: """ - Performs a PATCH request against the /system/osgradeweights/{id} endpoint. + Performs a PUT request against the /system/osgradeweights/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,7 +80,4 @@ def patch( Returns: OsGradeWeight: The parsed response data. """ - return self._parse_one( - OsGradeWeight, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(OsGradeWeight, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemParsingtypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemParsingtypesCountEndpoint.py index 52349030b..dfa0a2dca 100644 --- a/src/pyconnectwise/endpoints/manage/SystemParsingtypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemParsingtypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemParsingtypesCountEndpoint( @@ -16,18 +15,13 @@ class SystemParsingtypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/parsingTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/parsingTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemParsingtypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemParsingtypesEndpoint.py index f49c4f7ad..3cf327f0b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemParsingtypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemParsingtypesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemParsingtypesCountEndpoint import ( - SystemParsingtypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemParsingtypesIdEndpoint import ( - SystemParsingtypesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemParsingtypesCountEndpoint import SystemParsingtypesCountEndpoint +from pyconnectwise.endpoints.manage.SystemParsingtypesIdEndpoint import SystemParsingtypesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ParsingType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemParsingtypesEndpoint( @@ -22,35 +17,28 @@ class SystemParsingtypesEndpoint( IGettable[list[ParsingType], ConnectWiseManageRequestParams], IPaginateable[ParsingType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "parsingTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "parsingTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ParsingType]) IPaginateable.__init__(self, ParsingType) - self.count = self._register_child_endpoint( - SystemParsingtypesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemParsingtypesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemParsingtypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemParsingtypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemParsingtypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemParsingtypesIdEndpoint: The initialized SystemParsingtypesIdEndpoint object. """ child = SystemParsingtypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ParsingType]: """ Performs a GET request against the /system/parsingTypes endpoint and returns an initialized PaginatedResponse object. @@ -68,19 +56,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ParsingType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ParsingType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ParsingType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ParsingType]: """ Performs a GET request against the /system/parsingTypes endpoint. @@ -90,6 +69,4 @@ def get( Returns: list[ParsingType]: The parsed response data. """ - return self._parse_many( - ParsingType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ParsingType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemParsingtypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemParsingtypesIdEndpoint.py index 438102b58..908a32ed7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemParsingtypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemParsingtypesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ParsingType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemParsingtypesIdEndpoint( @@ -16,18 +15,13 @@ class SystemParsingtypesIdEndpoint( IGettable[ParsingType, ConnectWiseManageRequestParams], IPaginateable[ParsingType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ParsingType) IPaginateable.__init__(self, ParsingType) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ParsingType]: """ Performs a GET request against the /system/parsingTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ParsingType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ParsingType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ParsingType: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ParsingType: """ Performs a GET request against the /system/parsingTypes/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: ParsingType: The parsed response data. """ - return self._parse_one( - ParsingType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(ParsingType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemParsingvariablesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemParsingvariablesCountEndpoint.py index ecf112294..36a429efc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemParsingvariablesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemParsingvariablesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemParsingvariablesCountEndpoint( @@ -16,18 +15,13 @@ class SystemParsingvariablesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/parsingVariables/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/parsingVariables/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemParsingvariablesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemParsingvariablesEndpoint.py index 896026702..f53f7b84c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemParsingvariablesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemParsingvariablesEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemParsingvariablesCountEndpoint import ( - SystemParsingvariablesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemParsingvariablesIdEndpoint import ( - SystemParsingvariablesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemParsingvariablesCountEndpoint import SystemParsingvariablesCountEndpoint +from pyconnectwise.endpoints.manage.SystemParsingvariablesIdEndpoint import SystemParsingvariablesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ParsingVariable from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemParsingvariablesEndpoint( @@ -22,35 +17,28 @@ class SystemParsingvariablesEndpoint( IGettable[list[ParsingVariable], ConnectWiseManageRequestParams], IPaginateable[ParsingVariable, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "parsingVariables", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "parsingVariables", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ParsingVariable]) IPaginateable.__init__(self, ParsingVariable) - self.count = self._register_child_endpoint( - SystemParsingvariablesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemParsingvariablesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemParsingvariablesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemParsingvariablesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemParsingvariablesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemParsingvariablesIdEndpoint: The initialized SystemParsingvariablesIdEndpoint object. """ child = SystemParsingvariablesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ParsingVariable]: """ Performs a GET request against the /system/parsingVariables endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ParsingVariable, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ParsingVariable, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ParsingVariable]: """ Performs a GET request against the /system/parsingVariables endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[ParsingVariable]: The parsed response data. """ - return self._parse_many( - ParsingVariable, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ParsingVariable, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemParsingvariablesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemParsingvariablesIdEndpoint.py index 9c33f8521..3089a10fd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemParsingvariablesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemParsingvariablesIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ParsingVariable from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemParsingvariablesIdEndpoint( @@ -16,18 +15,13 @@ class SystemParsingvariablesIdEndpoint( IGettable[ParsingVariable, ConnectWiseManageRequestParams], IPaginateable[ParsingVariable, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ParsingVariable) IPaginateable.__init__(self, ParsingVariable) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ParsingVariable]: """ Performs a GET request against the /system/parsingVariables/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ParsingVariable, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ParsingVariable, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ParsingVariable: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ParsingVariable: """ Performs a GET request against the /system/parsingVariables/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: ParsingVariable: The parsed response data. """ - return self._parse_one( - ParsingVariable, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ParsingVariable, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemPortalreportsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemPortalreportsCountEndpoint.py index 434f264c5..6fc943283 100644 --- a/src/pyconnectwise/endpoints/manage/SystemPortalreportsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemPortalreportsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemPortalreportsCountEndpoint( @@ -16,18 +15,13 @@ class SystemPortalreportsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/portalReports/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/portalReports/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemPortalreportsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemPortalreportsEndpoint.py index e6b456eb5..669b86d53 100644 --- a/src/pyconnectwise/endpoints/manage/SystemPortalreportsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemPortalreportsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemPortalreportsCountEndpoint import ( - SystemPortalreportsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemPortalreportsIdEndpoint import ( - SystemPortalreportsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemPortalreportsCountEndpoint import SystemPortalreportsCountEndpoint +from pyconnectwise.endpoints.manage.SystemPortalreportsIdEndpoint import SystemPortalreportsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import PortalReport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemPortalreportsEndpoint( @@ -24,36 +18,29 @@ class SystemPortalreportsEndpoint( IPostable[PortalReport, ConnectWiseManageRequestParams], IPaginateable[PortalReport, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "portalReports", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "portalReports", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[PortalReport]) IPostable.__init__(self, PortalReport) IPaginateable.__init__(self, PortalReport) - self.count = self._register_child_endpoint( - SystemPortalreportsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemPortalreportsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemPortalreportsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemPortalreportsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemPortalreportsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemPortalreportsIdEndpoint: The initialized SystemPortalreportsIdEndpoint object. """ child = SystemPortalreportsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalReport]: """ Performs a GET request against the /system/portalReports endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalReport, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalReport, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[PortalReport]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[PortalReport]: """ Performs a GET request against the /system/portalReports endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[PortalReport]: The parsed response data. """ - return self._parse_many( - PortalReport, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(PortalReport, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalReport: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PortalReport: """ Performs a POST request against the /system/portalReports endpoint. @@ -111,6 +83,4 @@ def post( Returns: PortalReport: The parsed response data. """ - return self._parse_one( - PortalReport, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(PortalReport, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemPortalreportsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemPortalreportsIdEndpoint.py index 158fd5065..1140a1bca 100644 --- a/src/pyconnectwise/endpoints/manage/SystemPortalreportsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemPortalreportsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import PortalReport from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemPortalreportsIdEndpoint( ConnectWiseEndpoint, IGettable[PortalReport, ConnectWiseManageRequestParams], - IPuttable[PortalReport, ConnectWiseManageRequestParams], IPatchable[PortalReport, ConnectWiseManageRequestParams], + IPuttable[PortalReport, ConnectWiseManageRequestParams], IPaginateable[PortalReport, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, PortalReport) - IPuttable.__init__(self, PortalReport) IPatchable.__init__(self, PortalReport) + IPuttable.__init__(self, PortalReport) IPaginateable.__init__(self, PortalReport) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[PortalReport]: """ Performs a GET request against the /system/portalReports/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - PortalReport, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), PortalReport, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalReport: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/portalReports/{id} endpoint. + Performs a DELETE request against the /system/portalReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PortalReport: The parsed response data. """ - return self._parse_one( - PortalReport, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PortalReport: """ - Performs a DELETE request against the /system/portalReports/{id} endpoint. + Performs a GET request against the /system/portalReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PortalReport: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(PortalReport, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalReport: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> PortalReport: """ - Performs a PUT request against the /system/portalReports/{id} endpoint. + Performs a PATCH request against the /system/portalReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: PortalReport: The parsed response data. """ - return self._parse_one( - PortalReport, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(PortalReport, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> PortalReport: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> PortalReport: """ - Performs a PATCH request against the /system/portalReports/{id} endpoint. + Performs a PUT request against the /system/portalReports/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: PortalReport: The parsed response data. """ - return self._parse_one( - PortalReport, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(PortalReport, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupCountEndpoint.py index 10decce6b..55bf931cc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemQuotelinksetupCountEndpoint( @@ -16,18 +15,13 @@ class SystemQuotelinksetupCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/quoteLinkSetup/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/quoteLinkSetup/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupEndpoint.py index 530e2f3a4..26d52f617 100644 --- a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupEndpoint.py @@ -1,24 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemQuotelinksetupCountEndpoint import ( - SystemQuotelinksetupCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemQuotelinksetupIdEndpoint import ( - SystemQuotelinksetupIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemQuotelinksetupCountEndpoint import SystemQuotelinksetupCountEndpoint +from pyconnectwise.endpoints.manage.SystemQuotelinksetupIdEndpoint import SystemQuotelinksetupIdEndpoint from pyconnectwise.endpoints.manage.SystemQuotelinksetupTestconnectionEndpoint import ( SystemQuotelinksetupTestconnectionEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import QuoteLink from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemQuotelinksetupEndpoint( @@ -27,39 +21,32 @@ class SystemQuotelinksetupEndpoint( IPostable[QuoteLink, ConnectWiseManageRequestParams], IPaginateable[QuoteLink, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "quoteLinkSetup", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "quoteLinkSetup", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[QuoteLink]) IPostable.__init__(self, QuoteLink) IPaginateable.__init__(self, QuoteLink) - self.count = self._register_child_endpoint( - SystemQuotelinksetupCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemQuotelinksetupCountEndpoint(client, parent_endpoint=self)) self.test_connection = self._register_child_endpoint( SystemQuotelinksetupTestconnectionEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemQuotelinksetupIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemQuotelinksetupIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemQuotelinksetupIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemQuotelinksetupIdEndpoint: The initialized SystemQuotelinksetupIdEndpoint object. """ child = SystemQuotelinksetupIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[QuoteLink]: """ Performs a GET request against the /system/quoteLinkSetup endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +63,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - QuoteLink, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), QuoteLink, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[QuoteLink]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[QuoteLink]: """ Performs a GET request against the /system/quoteLinkSetup endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[QuoteLink]: The parsed response data. """ - return self._parse_many( - QuoteLink, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(QuoteLink, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> QuoteLink: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> QuoteLink: """ Performs a POST request against the /system/quoteLinkSetup endpoint. @@ -117,6 +87,4 @@ def post( Returns: QuoteLink: The parsed response data. """ - return self._parse_one( - QuoteLink, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(QuoteLink, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupIdEndpoint.py index 9aa0a0c96..ddb791073 100644 --- a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import QuoteLink from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemQuotelinksetupIdEndpoint( ConnectWiseEndpoint, IGettable[QuoteLink, ConnectWiseManageRequestParams], - IPuttable[QuoteLink, ConnectWiseManageRequestParams], IPatchable[QuoteLink, ConnectWiseManageRequestParams], + IPuttable[QuoteLink, ConnectWiseManageRequestParams], IPaginateable[QuoteLink, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, QuoteLink) - IPuttable.__init__(self, QuoteLink) IPatchable.__init__(self, QuoteLink) + IPuttable.__init__(self, QuoteLink) IPaginateable.__init__(self, QuoteLink) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[QuoteLink]: """ Performs a GET request against the /system/quoteLinkSetup/{id} endpoint and returns an initialized PaginatedResponse object. @@ -51,54 +42,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - QuoteLink, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), QuoteLink, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> QuoteLink: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/quoteLinkSetup/{id} endpoint. + Performs a DELETE request against the /system/quoteLinkSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - QuoteLink: The parsed response data. """ - return self._parse_one( - QuoteLink, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> QuoteLink: """ - Performs a DELETE request against the /system/quoteLinkSetup/{id} endpoint. + Performs a GET request against the /system/quoteLinkSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + QuoteLink: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(QuoteLink, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> QuoteLink: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> QuoteLink: """ - Performs a PUT request against the /system/quoteLinkSetup/{id} endpoint. + Performs a PATCH request against the /system/quoteLinkSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +76,11 @@ def put( Returns: QuoteLink: The parsed response data. """ - return self._parse_one( - QuoteLink, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(QuoteLink, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> QuoteLink: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> QuoteLink: """ - Performs a PATCH request against the /system/quoteLinkSetup/{id} endpoint. + Performs a PUT request against the /system/quoteLinkSetup/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,6 +88,4 @@ def patch( Returns: QuoteLink: The parsed response data. """ - return self._parse_one( - QuoteLink, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(QuoteLink, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupTestconnectionEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupTestconnectionEndpoint.py index 2ecd82b13..49dbfd158 100644 --- a/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupTestconnectionEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemQuotelinksetupTestconnectionEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SuccessResponse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemQuotelinksetupTestconnectionEndpoint( @@ -16,18 +15,13 @@ class SystemQuotelinksetupTestconnectionEndpoint( IGettable[SuccessResponse, ConnectWiseManageRequestParams], IPaginateable[SuccessResponse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "testConnection", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "testConnection", parent_endpoint=parent_endpoint) IGettable.__init__(self, SuccessResponse) IPaginateable.__init__(self, SuccessResponse) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SuccessResponse]: """ Performs a GET request against the /system/quoteLinkSetup/testConnection endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SuccessResponse, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SuccessResponse, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a GET request against the /system/quoteLinkSetup/testConnection endpoint. @@ -67,7 +52,4 @@ def get( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsCountEndpoint.py index d30ee6c60..1353776e8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsCountEndpoint( @@ -16,18 +15,13 @@ class SystemReportcardsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/reportCards/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/reportCards/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsEndpoint.py index 3d67860d1..44b0f80e4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemReportcardsCountEndpoint import ( - SystemReportcardsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemReportcardsIdEndpoint import ( - SystemReportcardsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemReportcardsInfoEndpoint import ( - SystemReportcardsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemReportcardsCountEndpoint import SystemReportcardsCountEndpoint +from pyconnectwise.endpoints.manage.SystemReportcardsIdEndpoint import SystemReportcardsIdEndpoint +from pyconnectwise.endpoints.manage.SystemReportcardsInfoEndpoint import SystemReportcardsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ReportCard from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsEndpoint( @@ -27,39 +19,30 @@ class SystemReportcardsEndpoint( IPostable[ReportCard, ConnectWiseManageRequestParams], IPaginateable[ReportCard, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reportCards", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reportCards", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ReportCard]) IPostable.__init__(self, ReportCard) IPaginateable.__init__(self, ReportCard) - self.count = self._register_child_endpoint( - SystemReportcardsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemReportcardsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemReportcardsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemReportcardsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemReportcardsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemReportcardsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemReportcardsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemReportcardsIdEndpoint: The initialized SystemReportcardsIdEndpoint object. """ child = SystemReportcardsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportCard]: """ Performs a GET request against the /system/reportCards endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ReportCard, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ReportCard, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ReportCard]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ReportCard]: """ Performs a GET request against the /system/reportCards endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[ReportCard]: The parsed response data. """ - return self._parse_many( - ReportCard, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ReportCard, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCard: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportCard: """ Performs a POST request against the /system/reportCards endpoint. @@ -117,6 +83,4 @@ def post( Returns: ReportCard: The parsed response data. """ - return self._parse_one( - ReportCard, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ReportCard, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsCountEndpoint.py index b00e02581..e2bd90654 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsIdDetailsCountEndpoint( @@ -16,18 +15,13 @@ class SystemReportcardsIdDetailsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/reportCards/{id}/details/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/reportCards/{id}/details/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsEndpoint.py index b3668e528..5d072ce47 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemReportcardsIdDetailsCountEndpoint import ( SystemReportcardsIdDetailsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemReportcardsIdDetailsIdEndpoint import ( - SystemReportcardsIdDetailsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemReportcardsIdDetailsIdEndpoint import SystemReportcardsIdDetailsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ReportCardDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsIdDetailsEndpoint( @@ -24,10 +20,8 @@ class SystemReportcardsIdDetailsEndpoint( IPostable[ReportCardDetail, ConnectWiseManageRequestParams], IPaginateable[ReportCardDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "details", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "details", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ReportCardDetail]) IPostable.__init__(self, ReportCardDetail) IPaginateable.__init__(self, ReportCardDetail) @@ -36,24 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemReportcardsIdDetailsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemReportcardsIdDetailsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemReportcardsIdDetailsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemReportcardsIdDetailsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemReportcardsIdDetailsIdEndpoint: The initialized SystemReportcardsIdDetailsIdEndpoint object. """ child = SystemReportcardsIdDetailsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportCardDetail]: """ Performs a GET request against the /system/reportCards/{id}/details endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ReportCardDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ReportCardDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ReportCardDetail]: """ Performs a GET request against the /system/reportCards/{id}/details endpoint. @@ -93,16 +77,9 @@ def get( Returns: list[ReportCardDetail]: The parsed response data. """ - return self._parse_many( - ReportCardDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ReportCardDetail, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCardDetail: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportCardDetail: """ Performs a POST request against the /system/reportCards/{id}/details endpoint. @@ -112,7 +89,4 @@ def post( Returns: ReportCardDetail: The parsed response data. """ - return self._parse_one( - ReportCardDetail, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ReportCardDetail, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsIdEndpoint.py index 0c2a1f4cb..77892a7ae 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdDetailsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ReportCardDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsIdDetailsIdEndpoint( ConnectWiseEndpoint, IGettable[ReportCardDetail, ConnectWiseManageRequestParams], - IPuttable[ReportCardDetail, ConnectWiseManageRequestParams], IPatchable[ReportCardDetail, ConnectWiseManageRequestParams], + IPuttable[ReportCardDetail, ConnectWiseManageRequestParams], IPaginateable[ReportCardDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ReportCardDetail) - IPuttable.__init__(self, ReportCardDetail) IPatchable.__init__(self, ReportCardDetail) + IPuttable.__init__(self, ReportCardDetail) IPaginateable.__init__(self, ReportCardDetail) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportCardDetail]: """ Performs a GET request against the /system/reportCards/{id}/details/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ReportCardDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ReportCardDetail, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCardDetail: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/reportCards/{id}/details/{id} endpoint. + Performs a DELETE request against the /system/reportCards/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ReportCardDetail: The parsed response data. """ - return self._parse_one( - ReportCardDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportCardDetail: """ - Performs a DELETE request against the /system/reportCards/{id}/details/{id} endpoint. + Performs a GET request against the /system/reportCards/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ReportCardDetail: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ReportCardDetail, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCardDetail: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ReportCardDetail: """ - Performs a PUT request against the /system/reportCards/{id}/details/{id} endpoint. + Performs a PATCH request against the /system/reportCards/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: ReportCardDetail: The parsed response data. """ - return self._parse_one( - ReportCardDetail, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ReportCardDetail, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCardDetail: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportCardDetail: """ - Performs a PATCH request against the /system/reportCards/{id}/details/{id} endpoint. + Performs a PUT request against the /system/reportCards/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: ReportCardDetail: The parsed response data. """ - return self._parse_one( - ReportCardDetail, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ReportCardDetail, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdEndpoint.py index 691a11c27..701dd22a4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemReportcardsIdDetailsEndpoint import ( - SystemReportcardsIdDetailsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemReportcardsIdInfoEndpoint import ( - SystemReportcardsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemReportcardsIdDetailsEndpoint import SystemReportcardsIdDetailsEndpoint +from pyconnectwise.endpoints.manage.SystemReportcardsIdInfoEndpoint import SystemReportcardsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ReportCard from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsIdEndpoint( ConnectWiseEndpoint, IGettable[ReportCard, ConnectWiseManageRequestParams], - IPuttable[ReportCard, ConnectWiseManageRequestParams], IPatchable[ReportCard, ConnectWiseManageRequestParams], + IPuttable[ReportCard, ConnectWiseManageRequestParams], IPaginateable[ReportCard, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ReportCard) - IPuttable.__init__(self, ReportCard) IPatchable.__init__(self, ReportCard) + IPuttable.__init__(self, ReportCard) IPaginateable.__init__(self, ReportCard) - self.details = self._register_child_endpoint( - SystemReportcardsIdDetailsEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemReportcardsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.details = self._register_child_endpoint(SystemReportcardsIdDetailsEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemReportcardsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportCard]: """ Performs a GET request against the /system/reportCards/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +47,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ReportCard, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ReportCard, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCard: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/reportCards/{id} endpoint. + Performs a DELETE request against the /system/reportCards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ReportCard: The parsed response data. """ - return self._parse_one( - ReportCard, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportCard: """ - Performs a DELETE request against the /system/reportCards/{id} endpoint. + Performs a GET request against the /system/reportCards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ReportCard: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ReportCard, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCard: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ReportCard: """ - Performs a PUT request against the /system/reportCards/{id} endpoint. + Performs a PATCH request against the /system/reportCards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +81,11 @@ def put( Returns: ReportCard: The parsed response data. """ - return self._parse_one( - ReportCard, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ReportCard, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCard: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportCard: """ - Performs a PATCH request against the /system/reportCards/{id} endpoint. + Performs a PUT request against the /system/reportCards/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +93,4 @@ def patch( Returns: ReportCard: The parsed response data. """ - return self._parse_one( - ReportCard, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ReportCard, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdInfoEndpoint.py index 85b5d6363..bf28408b7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ReportCardInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemReportcardsIdInfoEndpoint( IGettable[ReportCardInfo, ConnectWiseManageRequestParams], IPaginateable[ReportCardInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ReportCardInfo) IPaginateable.__init__(self, ReportCardInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportCardInfo]: """ Performs a GET request against the /system/reportCards/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ReportCardInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ReportCardInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportCardInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportCardInfo: """ Performs a GET request against the /system/reportCards/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ReportCardInfo: The parsed response data. """ - return self._parse_one( - ReportCardInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ReportCardInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoCountEndpoint.py index 162baab8d..5c2572d8b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemReportcardsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/reportCards/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/reportCards/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoEndpoint.py index b7cc5e572..8d54988c5 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportcardsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemReportcardsInfoCountEndpoint import ( - SystemReportcardsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemReportcardsInfoCountEndpoint import SystemReportcardsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ReportCardInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportcardsInfoEndpoint( @@ -19,22 +16,15 @@ class SystemReportcardsInfoEndpoint( IGettable[list[ReportCardInfo], ConnectWiseManageRequestParams], IPaginateable[ReportCardInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ReportCardInfo]) IPaginateable.__init__(self, ReportCardInfo) - self.count = self._register_child_endpoint( - SystemReportcardsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemReportcardsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportCardInfo]: """ Performs a GET request against the /system/reportCards/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ReportCardInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ReportCardInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ReportCardInfo]: """ Performs a GET request against the /system/reportCards/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ReportCardInfo]: The parsed response data. """ - return self._parse_many( - ReportCardInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ReportCardInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportsEndpoint.py index f641f980e..e242de878 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportsEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemReportsIdEndpoint import ( - SystemReportsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemReportsIdEndpoint import SystemReportsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Report from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportsEndpoint( @@ -19,31 +16,26 @@ class SystemReportsEndpoint( IGettable[list[Report], ConnectWiseManageRequestParams], IPaginateable[Report, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reports", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reports", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Report]) IPaginateable.__init__(self, Report) - def id(self, id: int) -> SystemReportsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemReportsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemReportsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemReportsIdEndpoint: The initialized SystemReportsIdEndpoint object. """ child = SystemReportsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Report]: """ Performs a GET request against the /system/reports endpoint and returns an initialized PaginatedResponse object. @@ -60,20 +52,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Report, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Report, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Report]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Report]: """ Performs a GET request against the /system/reports endpoint. @@ -83,6 +64,4 @@ def get( Returns: list[Report]: The parsed response data. """ - return self._parse_many( - Report, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Report, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportsIdColumnsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportsIdColumnsEndpoint.py index a74a2c146..11bb6ba23 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportsIdColumnsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportsIdColumnsEndpoint.py @@ -1,8 +1,11 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemReportsIdColumnsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "columns", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "columns", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportsIdCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportsIdCountEndpoint.py index 0cdf43c10..5aebce043 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportsIdCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportsIdCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportsIdCountEndpoint( @@ -16,18 +15,13 @@ class SystemReportsIdCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/reports/{id}/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/reports/{id}/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemReportsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemReportsIdEndpoint.py index df6602111..718124cc8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemReportsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemReportsIdEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemReportsIdColumnsEndpoint import ( - SystemReportsIdColumnsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemReportsIdCountEndpoint import ( - SystemReportsIdCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemReportsIdColumnsEndpoint import SystemReportsIdColumnsEndpoint +from pyconnectwise.endpoints.manage.SystemReportsIdCountEndpoint import SystemReportsIdCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ReportDataResponse from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemReportsIdEndpoint( @@ -22,25 +17,16 @@ class SystemReportsIdEndpoint( IGettable[ReportDataResponse, ConnectWiseManageRequestParams], IPaginateable[ReportDataResponse, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ReportDataResponse) IPaginateable.__init__(self, ReportDataResponse) - self.columns = self._register_child_endpoint( - SystemReportsIdColumnsEndpoint(client, parent_endpoint=self) - ) - self.count = self._register_child_endpoint( - SystemReportsIdCountEndpoint(client, parent_endpoint=self) - ) + self.columns = self._register_child_endpoint(SystemReportsIdColumnsEndpoint(client, parent_endpoint=self)) + self.count = self._register_child_endpoint(SystemReportsIdCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ReportDataResponse]: """ Performs a GET request against the /system/reports/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,19 +44,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ReportDataResponse, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ReportDataResponse, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ReportDataResponse: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ReportDataResponse: """ Performs a GET request against the /system/reports/{id} endpoint. @@ -80,7 +57,4 @@ def get( Returns: ReportDataResponse: The parsed response data. """ - return self._parse_one( - ReportDataResponse, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ReportDataResponse, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesCountEndpoint.py index 16c08c811..3cbd76ef6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSecurityrolesCountEndpoint( @@ -16,18 +15,13 @@ class SystemSecurityrolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/securityroles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/securityroles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesEndpoint.py index ec74dea9d..a4c898dc4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesEndpoint.py @@ -1,24 +1,88 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSecurityrolesIdEndpoint import ( - SystemSecurityrolesIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemSecurityrolesCountEndpoint import SystemSecurityrolesCountEndpoint +from pyconnectwise.endpoints.manage.SystemSecurityrolesIdEndpoint import SystemSecurityrolesIdEndpoint +from pyconnectwise.endpoints.manage.SystemSecurityrolesInfoEndpoint import SystemSecurityrolesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable +from pyconnectwise.models.manage import SecurityRole +from pyconnectwise.responses.paginated_response import PaginatedResponse +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class SystemSecurityrolesEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "securityRoles", parent_endpoint=parent_endpoint - ) - def id(self, id: int) -> SystemSecurityrolesIdEndpoint: # noqa: A002 +class SystemSecurityrolesEndpoint( + ConnectWiseEndpoint, + IGettable[list[SecurityRole], ConnectWiseManageRequestParams], + IPostable[SecurityRole, ConnectWiseManageRequestParams], + IPaginateable[SecurityRole, ConnectWiseManageRequestParams], +): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "securityroles", parent_endpoint=parent_endpoint) + IGettable.__init__(self, list[SecurityRole]) + IPostable.__init__(self, SecurityRole) + IPaginateable.__init__(self, SecurityRole) + + self.count = self._register_child_endpoint(SystemSecurityrolesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemSecurityrolesInfoEndpoint(client, parent_endpoint=self)) + + def id(self, _id: int) -> SystemSecurityrolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSecurityrolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSecurityrolesIdEndpoint: The initialized SystemSecurityrolesIdEndpoint object. """ child = SystemSecurityrolesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child + + def paginated( + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[SecurityRole]: + """ + Performs a GET request against the /system/securityroles endpoint and returns an initialized PaginatedResponse object. + + Parameters: + page (int): The page number to request. + page_size (int): The number of results to return per page. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaginatedResponse[SecurityRole]: The initialized PaginatedResponse object. + """ + if params: + params["page"] = page + params["pageSize"] = page_size + else: + params = {"page": page, "pageSize": page_size} + return PaginatedResponse( + super()._make_request("GET", params=params), SecurityRole, self, page, page_size, params + ) + + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SecurityRole]: + """ + Performs a GET request against the /system/securityroles endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + list[SecurityRole]: The parsed response data. + """ + return self._parse_many(SecurityRole, super()._make_request("GET", data=data, params=params).json()) + + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SecurityRole: + """ + Performs a POST request against the /system/securityroles endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SecurityRole: The parsed response data. + """ + return self._parse_one(SecurityRole, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdEndpoint.py index 746bbaa52..859268acc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdEndpoint.py @@ -1,15 +1,68 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSecurityrolesIdSettingsEndpoint import ( - SystemSecurityrolesIdSettingsEndpoint, -) +from pyconnectwise.endpoints.manage.SystemSecurityrolesIdInfoEndpoint import SystemSecurityrolesIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable +from pyconnectwise.models.manage import SecurityRole +from pyconnectwise.responses.paginated_response import PaginatedResponse +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class SystemSecurityrolesIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - self.settings = self._register_child_endpoint( - SystemSecurityrolesIdSettingsEndpoint(client, parent_endpoint=self) +class SystemSecurityrolesIdEndpoint( + ConnectWiseEndpoint, + IGettable[SecurityRole, ConnectWiseManageRequestParams], + IPaginateable[SecurityRole, ConnectWiseManageRequestParams], +): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) + IGettable.__init__(self, SecurityRole) + IPaginateable.__init__(self, SecurityRole) + + self.info = self._register_child_endpoint(SystemSecurityrolesIdInfoEndpoint(client, parent_endpoint=self)) + + def paginated( + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None + ) -> PaginatedResponse[SecurityRole]: + """ + Performs a GET request against the /system/securityroles/{id} endpoint and returns an initialized PaginatedResponse object. + + Parameters: + page (int): The page number to request. + page_size (int): The number of results to return per page. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaginatedResponse[SecurityRole]: The initialized PaginatedResponse object. + """ + if params: + params["page"] = page + params["pageSize"] = page_size + else: + params = {"page": page, "pageSize": page_size} + return PaginatedResponse( + super()._make_request("GET", params=params), SecurityRole, self, page, page_size, params ) + + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: + """ + Performs a DELETE request against the /system/securityroles/{id} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + """ + super()._make_request("DELETE", data=data, params=params) + + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SecurityRole: + """ + Performs a GET request against the /system/securityroles/{id} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SecurityRole: The parsed response data. + """ + return self._parse_one(SecurityRole, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdInfoEndpoint.py index 902035a74..daab036b2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SecurityRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSecurityrolesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemSecurityrolesIdInfoEndpoint( IGettable[SecurityRoleInfo, ConnectWiseManageRequestParams], IPaginateable[SecurityRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SecurityRoleInfo) IPaginateable.__init__(self, SecurityRoleInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SecurityRoleInfo]: """ Performs a GET request against the /system/securityroles/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SecurityRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SecurityRoleInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SecurityRoleInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SecurityRoleInfo: """ Performs a GET request against the /system/securityroles/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: SecurityRoleInfo: The parsed response data. """ - return self._parse_one( - SecurityRoleInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SecurityRoleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsCountEndpoint.py index 2912882d7..a9937b9a8 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSecurityrolesIdSettingsCountEndpoint( @@ -16,18 +15,13 @@ class SystemSecurityrolesIdSettingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/securityRoles/{id}/settings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/securityRoles/{id}/settings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsEndpoint.py index 2a2827861..d7514976f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemSecurityrolesIdSettingsCountEndpoint import ( SystemSecurityrolesIdSettingsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.SystemSecurityrolesIdSettingsIdEndpoint import ( SystemSecurityrolesIdSettingsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SecurityRoleSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSecurityrolesIdSettingsEndpoint( @@ -22,10 +21,8 @@ class SystemSecurityrolesIdSettingsEndpoint( IGettable[list[SecurityRoleSetting], ConnectWiseManageRequestParams], IPaginateable[SecurityRoleSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "settings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "settings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SecurityRoleSetting]) IPaginateable.__init__(self, SecurityRoleSetting) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemSecurityrolesIdSettingsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemSecurityrolesIdSettingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSecurityrolesIdSettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSecurityrolesIdSettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSecurityrolesIdSettingsIdEndpoint: The initialized SystemSecurityrolesIdSettingsIdEndpoint object. """ - child = SystemSecurityrolesIdSettingsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemSecurityrolesIdSettingsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SecurityRoleSetting]: """ Performs a GET request against the /system/securityRoles/{id}/settings endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +62,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SecurityRoleSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SecurityRoleSetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SecurityRoleSetting]: """ Performs a GET request against the /system/securityRoles/{id}/settings endpoint. @@ -92,7 +77,4 @@ def get( Returns: list[SecurityRoleSetting]: The parsed response data. """ - return self._parse_many( - SecurityRoleSetting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SecurityRoleSetting, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsIdEndpoint.py index 15f31801b..bf7a41ca1 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesIdSettingsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SecurityRoleSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSecurityrolesIdSettingsIdEndpoint( @@ -16,18 +15,13 @@ class SystemSecurityrolesIdSettingsIdEndpoint( IGettable[SecurityRoleSetting, ConnectWiseManageRequestParams], IPaginateable[SecurityRoleSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SecurityRoleSetting) IPaginateable.__init__(self, SecurityRoleSetting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SecurityRoleSetting]: """ Performs a GET request against the /system/securityRoles/{id}/settings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SecurityRoleSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SecurityRoleSetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> SecurityRoleSetting: """ Performs a GET request against the /system/securityRoles/{id}/settings/{id} endpoint. @@ -67,7 +54,4 @@ def get( Returns: SecurityRoleSetting: The parsed response data. """ - return self._parse_one( - SecurityRoleSetting, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(SecurityRoleSetting, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoCountEndpoint.py index c29fd5075..9570dc812 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSecurityrolesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemSecurityrolesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/securityroles/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/securityroles/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoEndpoint.py index 6a65720bb..39c798200 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSecurityrolesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSecurityrolesInfoCountEndpoint import ( - SystemSecurityrolesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemSecurityrolesInfoCountEndpoint import SystemSecurityrolesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SecurityRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSecurityrolesInfoEndpoint( @@ -19,22 +16,15 @@ class SystemSecurityrolesInfoEndpoint( IGettable[list[SecurityRoleInfo], ConnectWiseManageRequestParams], IPaginateable[SecurityRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SecurityRoleInfo]) IPaginateable.__init__(self, SecurityRoleInfo) - self.count = self._register_child_endpoint( - SystemSecurityrolesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSecurityrolesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SecurityRoleInfo]: """ Performs a GET request against the /system/securityroles/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SecurityRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SecurityRoleInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SecurityRoleInfo]: """ Performs a GET request against the /system/securityroles/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[SecurityRoleInfo]: The parsed response data. """ - return self._parse_many( - SecurityRoleInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SecurityRoleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSettingsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSettingsCountEndpoint.py index 797755a89..109435a41 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSettingsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSettingsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSettingsCountEndpoint( @@ -16,18 +15,13 @@ class SystemSettingsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/settings/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/settings/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSettingsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSettingsEndpoint.py index 95607e6f0..f6de0bcf9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSettingsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSettingsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSettingsCountEndpoint import ( - SystemSettingsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSettingsIdEndpoint import ( - SystemSettingsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemSettingsCountEndpoint import SystemSettingsCountEndpoint +from pyconnectwise.endpoints.manage.SystemSettingsIdEndpoint import SystemSettingsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SystemSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSettingsEndpoint( @@ -22,35 +17,28 @@ class SystemSettingsEndpoint( IGettable[list[SystemSetting], ConnectWiseManageRequestParams], IPaginateable[SystemSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "settings", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "settings", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SystemSetting]) IPaginateable.__init__(self, SystemSetting) - self.count = self._register_child_endpoint( - SystemSettingsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSettingsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSettingsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSettingsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSettingsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSettingsIdEndpoint: The initialized SystemSettingsIdEndpoint object. """ child = SystemSettingsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SystemSetting]: """ Performs a GET request against the /system/settings endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SystemSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SystemSetting, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SystemSetting]: """ Performs a GET request against the /system/settings endpoint. @@ -90,6 +71,4 @@ def get( Returns: list[SystemSetting]: The parsed response data. """ - return self._parse_many( - SystemSetting, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SystemSetting, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSettingsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSettingsIdEndpoint.py index b5d0a5bc1..97a74a590 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSettingsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSettingsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SystemSetting from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSettingsIdEndpoint( ConnectWiseEndpoint, IGettable[SystemSetting, ConnectWiseManageRequestParams], - IPuttable[SystemSetting, ConnectWiseManageRequestParams], IPatchable[SystemSetting, ConnectWiseManageRequestParams], + IPuttable[SystemSetting, ConnectWiseManageRequestParams], IPaginateable[SystemSetting, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SystemSetting) - IPuttable.__init__(self, SystemSetting) IPatchable.__init__(self, SystemSetting) + IPuttable.__init__(self, SystemSetting) IPaginateable.__init__(self, SystemSetting) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SystemSetting]: """ Performs a GET request against the /system/settings/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +43,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SystemSetting, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SystemSetting, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SystemSetting: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SystemSetting: """ Performs a GET request against the /system/settings/{id} endpoint. @@ -74,17 +56,11 @@ def get( Returns: SystemSetting: The parsed response data. """ - return self._parse_one( - SystemSetting, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(SystemSetting, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SystemSetting: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SystemSetting: """ - Performs a PUT request against the /system/settings/{id} endpoint. + Performs a PATCH request against the /system/settings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -92,17 +68,11 @@ def put( Returns: SystemSetting: The parsed response data. """ - return self._parse_one( - SystemSetting, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SystemSetting, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SystemSetting: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SystemSetting: """ - Performs a PATCH request against the /system/settings/{id} endpoint. + Performs a PUT request against the /system/settings/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -110,7 +80,4 @@ def patch( Returns: SystemSetting: The parsed response data. """ - return self._parse_one( - SystemSetting, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SystemSetting, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSetupscreensCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSetupscreensCountEndpoint.py index 1b6d255ad..75997fd5d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSetupscreensCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSetupscreensCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSetupscreensCountEndpoint( @@ -16,18 +15,13 @@ class SystemSetupscreensCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/setupScreens/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/setupScreens/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSetupscreensEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSetupscreensEndpoint.py index 0b17ec639..5c5f9cbc9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSetupscreensEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSetupscreensEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSetupscreensCountEndpoint import ( - SystemSetupscreensCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSetupscreensIdEndpoint import ( - SystemSetupscreensIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemSetupscreensCountEndpoint import SystemSetupscreensCountEndpoint +from pyconnectwise.endpoints.manage.SystemSetupscreensIdEndpoint import SystemSetupscreensIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SetupScreen from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSetupscreensEndpoint( @@ -22,35 +17,28 @@ class SystemSetupscreensEndpoint( IGettable[list[SetupScreen], ConnectWiseManageRequestParams], IPaginateable[SetupScreen, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "setupScreens", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "setupScreens", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SetupScreen]) IPaginateable.__init__(self, SetupScreen) - self.count = self._register_child_endpoint( - SystemSetupscreensCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSetupscreensCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSetupscreensIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSetupscreensIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSetupscreensIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSetupscreensIdEndpoint: The initialized SystemSetupscreensIdEndpoint object. """ child = SystemSetupscreensIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SetupScreen]: """ Performs a GET request against the /system/setupScreens endpoint and returns an initialized PaginatedResponse object. @@ -68,19 +56,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SetupScreen, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SetupScreen, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SetupScreen]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SetupScreen]: """ Performs a GET request against the /system/setupScreens endpoint. @@ -90,6 +69,4 @@ def get( Returns: list[SetupScreen]: The parsed response data. """ - return self._parse_many( - SetupScreen, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SetupScreen, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSetupscreensIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSetupscreensIdEndpoint.py index 792bf32d3..91d53f81a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSetupscreensIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSetupscreensIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SetupScreen from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSetupscreensIdEndpoint( @@ -16,18 +15,13 @@ class SystemSetupscreensIdEndpoint( IGettable[SetupScreen, ConnectWiseManageRequestParams], IPaginateable[SetupScreen, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SetupScreen) IPaginateable.__init__(self, SetupScreen) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SetupScreen]: """ Performs a GET request against the /system/setupScreens/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SetupScreen, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SetupScreen, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SetupScreen: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SetupScreen: """ Performs a GET request against the /system/setupScreens/{id} endpoint. @@ -67,6 +52,4 @@ def get( Returns: SetupScreen: The parsed response data. """ - return self._parse_one( - SetupScreen, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(SetupScreen, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesCountEndpoint.py index 34ef195ae..3b2a9d4ef 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillcategoriesCountEndpoint( @@ -16,18 +15,13 @@ class SystemSkillcategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/skillCategories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/skillCategories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesEndpoint.py index 6a5f49d08..26b56522a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSkillcategoriesCountEndpoint import ( - SystemSkillcategoriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSkillcategoriesIdEndpoint import ( - SystemSkillcategoriesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemSkillcategoriesCountEndpoint import SystemSkillcategoriesCountEndpoint +from pyconnectwise.endpoints.manage.SystemSkillcategoriesIdEndpoint import SystemSkillcategoriesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SkillCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillcategoriesEndpoint( @@ -24,36 +18,29 @@ class SystemSkillcategoriesEndpoint( IPostable[SkillCategory, ConnectWiseManageRequestParams], IPaginateable[SkillCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "skillCategories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "skillCategories", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SkillCategory]) IPostable.__init__(self, SkillCategory) IPaginateable.__init__(self, SkillCategory) - self.count = self._register_child_endpoint( - SystemSkillcategoriesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSkillcategoriesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSkillcategoriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSkillcategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSkillcategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSkillcategoriesIdEndpoint: The initialized SystemSkillcategoriesIdEndpoint object. """ child = SystemSkillcategoriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SkillCategory]: """ Performs a GET request against the /system/skillCategories endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SkillCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SkillCategory, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SkillCategory]: """ Performs a GET request against the /system/skillCategories endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[SkillCategory]: The parsed response data. """ - return self._parse_many( - SkillCategory, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SkillCategory, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SkillCategory: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SkillCategory: """ Performs a POST request against the /system/skillCategories endpoint. @@ -111,7 +85,4 @@ def post( Returns: SkillCategory: The parsed response data. """ - return self._parse_one( - SkillCategory, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SkillCategory, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesIdEndpoint.py index 6daa1324b..b73fe2deb 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillcategoriesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SkillCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillcategoriesIdEndpoint( ConnectWiseEndpoint, IGettable[SkillCategory, ConnectWiseManageRequestParams], - IPuttable[SkillCategory, ConnectWiseManageRequestParams], IPatchable[SkillCategory, ConnectWiseManageRequestParams], + IPuttable[SkillCategory, ConnectWiseManageRequestParams], IPaginateable[SkillCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SkillCategory) - IPuttable.__init__(self, SkillCategory) IPatchable.__init__(self, SkillCategory) + IPuttable.__init__(self, SkillCategory) IPaginateable.__init__(self, SkillCategory) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SkillCategory]: """ Performs a GET request against the /system/skillCategories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SkillCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SkillCategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SkillCategory: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/skillCategories/{id} endpoint. + Performs a DELETE request against the /system/skillCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SkillCategory: The parsed response data. """ - return self._parse_one( - SkillCategory, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SkillCategory: """ - Performs a DELETE request against the /system/skillCategories/{id} endpoint. + Performs a GET request against the /system/skillCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SkillCategory: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SkillCategory, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SkillCategory: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SkillCategory: """ - Performs a PUT request against the /system/skillCategories/{id} endpoint. + Performs a PATCH request against the /system/skillCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: SkillCategory: The parsed response data. """ - return self._parse_one( - SkillCategory, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(SkillCategory, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SkillCategory: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SkillCategory: """ - Performs a PATCH request against the /system/skillCategories/{id} endpoint. + Performs a PUT request against the /system/skillCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: SkillCategory: The parsed response data. """ - return self._parse_one( - SkillCategory, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SkillCategory, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillsCountEndpoint.py index cd390fbc6..b1949b7b3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillsCountEndpoint( @@ -16,18 +15,13 @@ class SystemSkillsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/skills/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/skills/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillsEndpoint.py index aa05dcb84..c4f1d6aea 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillsEndpoint.py @@ -1,22 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSkillsCountEndpoint import ( - SystemSkillsCountEndpoint, -) +from pyconnectwise.endpoints.manage.SystemSkillsCountEndpoint import SystemSkillsCountEndpoint from pyconnectwise.endpoints.manage.SystemSkillsIdEndpoint import SystemSkillsIdEndpoint -from pyconnectwise.endpoints.manage.SystemSkillsInfoEndpoint import ( - SystemSkillsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemSkillsInfoEndpoint import SystemSkillsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Skill from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillsEndpoint( @@ -25,39 +19,30 @@ class SystemSkillsEndpoint( IPostable[Skill, ConnectWiseManageRequestParams], IPaginateable[Skill, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "skills", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "skills", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Skill]) IPostable.__init__(self, Skill) IPaginateable.__init__(self, Skill) - self.count = self._register_child_endpoint( - SystemSkillsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemSkillsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSkillsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemSkillsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSkillsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSkillsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSkillsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSkillsIdEndpoint: The initialized SystemSkillsIdEndpoint object. """ child = SystemSkillsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Skill]: """ Performs a GET request against the /system/skills endpoint and returns an initialized PaginatedResponse object. @@ -74,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Skill, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Skill, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Skill]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Skill]: """ Performs a GET request against the /system/skills endpoint. @@ -97,15 +71,9 @@ def get( Returns: list[Skill]: The parsed response data. """ - return self._parse_many( - Skill, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Skill, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Skill: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Skill: """ Performs a POST request against the /system/skills endpoint. @@ -115,6 +83,4 @@ def post( Returns: Skill: The parsed response data. """ - return self._parse_one( - Skill, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Skill, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillsIdEndpoint.py index 56bba0e12..1d97e0b19 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSkillsIdInfoEndpoint import ( - SystemSkillsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemSkillsIdInfoEndpoint import SystemSkillsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Skill from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillsIdEndpoint( ConnectWiseEndpoint, IGettable[Skill, ConnectWiseManageRequestParams], - IPuttable[Skill, ConnectWiseManageRequestParams], IPatchable[Skill, ConnectWiseManageRequestParams], + IPuttable[Skill, ConnectWiseManageRequestParams], IPaginateable[Skill, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Skill) - IPuttable.__init__(self, Skill) IPatchable.__init__(self, Skill) + IPuttable.__init__(self, Skill) IPaginateable.__init__(self, Skill) - self.info = self._register_child_endpoint( - SystemSkillsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemSkillsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Skill]: """ Performs a GET request against the /system/skills/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Skill, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Skill, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Skill: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/skills/{id} endpoint. + Performs a DELETE request against the /system/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Skill: The parsed response data. """ - return self._parse_one( - Skill, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Skill: """ - Performs a DELETE request against the /system/skills/{id} endpoint. + Performs a GET request against the /system/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Skill: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Skill, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Skill: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Skill: """ - Performs a PUT request against the /system/skills/{id} endpoint. + Performs a PATCH request against the /system/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: Skill: The parsed response data. """ - return self._parse_one( - Skill, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Skill, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Skill: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Skill: """ - Performs a PATCH request against the /system/skills/{id} endpoint. + Performs a PUT request against the /system/skills/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: Skill: The parsed response data. """ - return self._parse_one( - Skill, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Skill, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillsIdInfoEndpoint.py index 715b71b36..f22fce7cc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SkillInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemSkillsIdInfoEndpoint( IGettable[SkillInfo, ConnectWiseManageRequestParams], IPaginateable[SkillInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SkillInfo) IPaginateable.__init__(self, SkillInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SkillInfo]: """ Performs a GET request against the /system/skills/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SkillInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SkillInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SkillInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SkillInfo: """ Performs a GET request against the /system/skills/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: SkillInfo: The parsed response data. """ - return self._parse_one( - SkillInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(SkillInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillsInfoCountEndpoint.py index df8920926..67fbd10d7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemSkillsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/skills/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/skills/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSkillsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSkillsInfoEndpoint.py index 40889c869..7788fc77e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSkillsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSkillsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSkillsInfoCountEndpoint import ( - SystemSkillsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemSkillsInfoCountEndpoint import SystemSkillsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SkillInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSkillsInfoEndpoint( @@ -19,22 +16,15 @@ class SystemSkillsInfoEndpoint( IGettable[list[SkillInfo], ConnectWiseManageRequestParams], IPaginateable[SkillInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SkillInfo]) IPaginateable.__init__(self, SkillInfo) - self.count = self._register_child_endpoint( - SystemSkillsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSkillsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SkillInfo]: """ Performs a GET request against the /system/skills/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SkillInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SkillInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SkillInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SkillInfo]: """ Performs a GET request against the /system/skills/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[SkillInfo]: The parsed response data. """ - return self._parse_many( - SkillInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SkillInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsCountEndpoint.py index 2072c7e3b..f072200cd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsoconfigurationsCountEndpoint( @@ -16,18 +15,13 @@ class SystemSsoconfigurationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/ssoConfigurations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/ssoConfigurations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsEndpoint.py index 323bb787f..86a44fd43 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSsoconfigurationsCountEndpoint import ( - SystemSsoconfigurationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSsoconfigurationsIdEndpoint import ( - SystemSsoconfigurationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemSsoconfigurationsCountEndpoint import SystemSsoconfigurationsCountEndpoint +from pyconnectwise.endpoints.manage.SystemSsoconfigurationsIdEndpoint import SystemSsoconfigurationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SsoConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsoconfigurationsEndpoint( @@ -24,36 +18,29 @@ class SystemSsoconfigurationsEndpoint( IPostable[SsoConfiguration, ConnectWiseManageRequestParams], IPaginateable[SsoConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ssoConfigurations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ssoConfigurations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SsoConfiguration]) IPostable.__init__(self, SsoConfiguration) IPaginateable.__init__(self, SsoConfiguration) - self.count = self._register_child_endpoint( - SystemSsoconfigurationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSsoconfigurationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSsoconfigurationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSsoconfigurationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSsoconfigurationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSsoconfigurationsIdEndpoint: The initialized SystemSsoconfigurationsIdEndpoint object. """ child = SystemSsoconfigurationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SsoConfiguration]: """ Performs a GET request against the /system/ssoConfigurations endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SsoConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SsoConfiguration, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SsoConfiguration]: """ Performs a GET request against the /system/ssoConfigurations endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[SsoConfiguration]: The parsed response data. """ - return self._parse_many( - SsoConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SsoConfiguration, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SsoConfiguration: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SsoConfiguration: """ Performs a POST request against the /system/ssoConfigurations endpoint. @@ -112,7 +85,4 @@ def post( Returns: SsoConfiguration: The parsed response data. """ - return self._parse_one( - SsoConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SsoConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdEndpoint.py index b56e66248..717684da7 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemSsoconfigurationsIdRegistertokenEndpoint import ( SystemSsoconfigurationsIdRegistertokenEndpoint, @@ -5,35 +7,27 @@ from pyconnectwise.endpoints.manage.SystemSsoconfigurationsIdSubmitmembersEndpoint import ( SystemSsoconfigurationsIdSubmitmembersEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SsoConfiguration from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsoconfigurationsIdEndpoint( ConnectWiseEndpoint, IGettable[SsoConfiguration, ConnectWiseManageRequestParams], - IPuttable[SsoConfiguration, ConnectWiseManageRequestParams], IPatchable[SsoConfiguration, ConnectWiseManageRequestParams], + IPuttable[SsoConfiguration, ConnectWiseManageRequestParams], IPaginateable[SsoConfiguration, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SsoConfiguration) - IPuttable.__init__(self, SsoConfiguration) IPatchable.__init__(self, SsoConfiguration) + IPuttable.__init__(self, SsoConfiguration) IPaginateable.__init__(self, SsoConfiguration) self.registertoken = self._register_child_endpoint( @@ -44,10 +38,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SsoConfiguration]: """ Performs a GET request against the /system/ssoConfigurations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -65,40 +56,22 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SsoConfiguration, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SsoConfiguration, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SsoConfiguration: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/ssoConfigurations/{id} endpoint. + Performs a DELETE request against the /system/ssoConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SsoConfiguration: The parsed response data. """ - return self._parse_one( - SsoConfiguration, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SsoConfiguration: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SsoConfiguration: """ - Performs a PUT request against the /system/ssoConfigurations/{id} endpoint. + Performs a GET request against the /system/ssoConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,16 +79,9 @@ def put( Returns: SsoConfiguration: The parsed response data. """ - return self._parse_one( - SsoConfiguration, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(SsoConfiguration, super()._make_request("GET", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SsoConfiguration: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SsoConfiguration: """ Performs a PATCH request against the /system/ssoConfigurations/{id} endpoint. @@ -125,21 +91,16 @@ def patch( Returns: SsoConfiguration: The parsed response data. """ - return self._parse_one( - SsoConfiguration, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SsoConfiguration, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SsoConfiguration: """ - Performs a DELETE request against the /system/ssoConfigurations/{id} endpoint. + Performs a PUT request against the /system/ssoConfigurations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SsoConfiguration: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SsoConfiguration, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdRegistertokenEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdRegistertokenEndpoint.py index 2593d43bf..7d6ae530c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdRegistertokenEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdRegistertokenEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SsoConfiguration -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsoconfigurationsIdRegistertokenEndpoint( ConnectWiseEndpoint, IPostable[SsoConfiguration, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "registertoken", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "registertoken", parent_endpoint=parent_endpoint) IPostable.__init__(self, SsoConfiguration) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SsoConfiguration: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SsoConfiguration: """ Performs a POST request against the /system/ssoConfigurations/{id}/registertoken endpoint. @@ -32,7 +26,4 @@ def post( Returns: SsoConfiguration: The parsed response data. """ - return self._parse_one( - SsoConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SsoConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdSubmitmembersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdSubmitmembersEndpoint.py index 18250780a..d4da2050a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdSubmitmembersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsoconfigurationsIdSubmitmembersEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SsoConfiguration -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsoconfigurationsIdSubmitmembersEndpoint( ConnectWiseEndpoint, IPostable[SsoConfiguration, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "submitmembers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "submitmembers", parent_endpoint=parent_endpoint) IPostable.__init__(self, SsoConfiguration) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SsoConfiguration: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SsoConfiguration: """ Performs a POST request against the /system/ssoConfigurations/{id}/submitmembers endpoint. @@ -32,7 +26,4 @@ def post( Returns: SsoConfiguration: The parsed response data. """ - return self._parse_one( - SsoConfiguration, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SsoConfiguration, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsousersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsousersCountEndpoint.py index a4adc454a..dbbe8822e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsousersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsousersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsousersCountEndpoint( @@ -16,18 +15,13 @@ class SystemSsousersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/ssoUsers/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/ssoUsers/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsousersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsousersEndpoint.py index 8e7c91dd0..32c438059 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsousersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsousersEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSsousersCountEndpoint import ( - SystemSsousersCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSsousersIdEndpoint import ( - SystemSsousersIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemSsousersCountEndpoint import SystemSsousersCountEndpoint +from pyconnectwise.endpoints.manage.SystemSsousersIdEndpoint import SystemSsousersIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SsoUser from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsousersEndpoint( @@ -22,35 +17,28 @@ class SystemSsousersEndpoint( IGettable[list[SsoUser], ConnectWiseManageRequestParams], IPaginateable[SsoUser, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ssoUsers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ssoUsers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SsoUser]) IPaginateable.__init__(self, SsoUser) - self.count = self._register_child_endpoint( - SystemSsousersCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSsousersCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSsousersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSsousersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSsousersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSsousersIdEndpoint: The initialized SystemSsousersIdEndpoint object. """ child = SystemSsousersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SsoUser]: """ Performs a GET request against the /system/ssoUsers endpoint and returns an initialized PaginatedResponse object. @@ -67,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SsoUser, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SsoUser, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SsoUser]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SsoUser]: """ Performs a GET request against the /system/ssoUsers endpoint. @@ -90,6 +67,4 @@ def get( Returns: list[SsoUser]: The parsed response data. """ - return self._parse_many( - SsoUser, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SsoUser, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSsousersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSsousersIdEndpoint.py index 389fd38d0..328d8a3a6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSsousersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSsousersIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SsoUser from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSsousersIdEndpoint( @@ -16,18 +15,13 @@ class SystemSsousersIdEndpoint( IGettable[SsoUser, ConnectWiseManageRequestParams], IPaginateable[SsoUser, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SsoUser) IPaginateable.__init__(self, SsoUser) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SsoUser]: """ Performs a GET request against the /system/ssoUsers/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SsoUser, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SsoUser, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SsoUser: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SsoUser: """ Performs a GET request against the /system/ssoUsers/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: SsoUser: The parsed response data. """ - return self._parse_one( - SsoUser, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(SsoUser, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemStandardnotesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemStandardnotesCountEndpoint.py index 520ac7adf..0468bd5ec 100644 --- a/src/pyconnectwise/endpoints/manage/SystemStandardnotesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemStandardnotesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemStandardnotesCountEndpoint( @@ -16,18 +15,13 @@ class SystemStandardnotesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/standardNotes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/standardNotes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemStandardnotesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemStandardnotesEndpoint.py index c08f55918..066b3a28d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemStandardnotesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemStandardnotesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemStandardnotesCountEndpoint import ( - SystemStandardnotesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemStandardnotesIdEndpoint import ( - SystemStandardnotesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemStandardnotesCountEndpoint import SystemStandardnotesCountEndpoint +from pyconnectwise.endpoints.manage.SystemStandardnotesIdEndpoint import SystemStandardnotesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import StandardNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemStandardnotesEndpoint( @@ -24,36 +18,29 @@ class SystemStandardnotesEndpoint( IPostable[StandardNote, ConnectWiseManageRequestParams], IPaginateable[StandardNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "standardNotes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "standardNotes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[StandardNote]) IPostable.__init__(self, StandardNote) IPaginateable.__init__(self, StandardNote) - self.count = self._register_child_endpoint( - SystemStandardnotesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemStandardnotesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemStandardnotesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemStandardnotesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemStandardnotesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemStandardnotesIdEndpoint: The initialized SystemStandardnotesIdEndpoint object. """ child = SystemStandardnotesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StandardNote]: """ Performs a GET request against the /system/standardNotes endpoint and returns an initialized PaginatedResponse object. @@ -71,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - StandardNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), StandardNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[StandardNote]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[StandardNote]: """ Performs a GET request against the /system/standardNotes endpoint. @@ -93,15 +71,9 @@ def get( Returns: list[StandardNote]: The parsed response data. """ - return self._parse_many( - StandardNote, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(StandardNote, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> StandardNote: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> StandardNote: """ Performs a POST request against the /system/standardNotes endpoint. @@ -111,6 +83,4 @@ def post( Returns: StandardNote: The parsed response data. """ - return self._parse_one( - StandardNote, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(StandardNote, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemStandardnotesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemStandardnotesIdEndpoint.py index 2cb29ba88..a2bbf70eb 100644 --- a/src/pyconnectwise/endpoints/manage/SystemStandardnotesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemStandardnotesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import StandardNote from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemStandardnotesIdEndpoint( ConnectWiseEndpoint, IGettable[StandardNote, ConnectWiseManageRequestParams], - IPuttable[StandardNote, ConnectWiseManageRequestParams], IPatchable[StandardNote, ConnectWiseManageRequestParams], + IPuttable[StandardNote, ConnectWiseManageRequestParams], IPaginateable[StandardNote, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, StandardNote) - IPuttable.__init__(self, StandardNote) IPatchable.__init__(self, StandardNote) + IPuttable.__init__(self, StandardNote) IPaginateable.__init__(self, StandardNote) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[StandardNote]: """ Performs a GET request against the /system/standardNotes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,53 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - StandardNote, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), StandardNote, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> StandardNote: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/standardNotes/{id} endpoint. + Performs a DELETE request against the /system/standardNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - StandardNote: The parsed response data. """ - return self._parse_one( - StandardNote, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> StandardNote: """ - Performs a DELETE request against the /system/standardNotes/{id} endpoint. + Performs a GET request against the /system/standardNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + StandardNote: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(StandardNote, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> StandardNote: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> StandardNote: """ - Performs a PUT request against the /system/standardNotes/{id} endpoint. + Performs a PATCH request against the /system/standardNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -106,17 +78,11 @@ def put( Returns: StandardNote: The parsed response data. """ - return self._parse_one( - StandardNote, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(StandardNote, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> StandardNote: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> StandardNote: """ - Performs a PATCH request against the /system/standardNotes/{id} endpoint. + Performs a PUT request against the /system/standardNotes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -124,7 +90,4 @@ def patch( Returns: StandardNote: The parsed response data. """ - return self._parse_one( - StandardNote, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(StandardNote, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysCountEndpoint.py index cb9b137a6..c8508ddbc 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysCountEndpoint( @@ -16,18 +15,13 @@ class SystemSurveysCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/surveys/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/surveys/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysEndpoint.py index 96a2d9043..43910b691 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSurveysCountEndpoint import ( - SystemSurveysCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSurveysIdEndpoint import ( - SystemSurveysIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSurveysInfoEndpoint import ( - SystemSurveysInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemSurveysCountEndpoint import SystemSurveysCountEndpoint +from pyconnectwise.endpoints.manage.SystemSurveysIdEndpoint import SystemSurveysIdEndpoint +from pyconnectwise.endpoints.manage.SystemSurveysInfoEndpoint import SystemSurveysInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Survey from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysEndpoint( @@ -27,39 +19,30 @@ class SystemSurveysEndpoint( IPostable[Survey, ConnectWiseManageRequestParams], IPaginateable[Survey, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "surveys", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "surveys", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Survey]) IPostable.__init__(self, Survey) IPaginateable.__init__(self, Survey) - self.count = self._register_child_endpoint( - SystemSurveysCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemSurveysInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSurveysCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemSurveysInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSurveysIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSurveysIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSurveysIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSurveysIdEndpoint: The initialized SystemSurveysIdEndpoint object. """ child = SystemSurveysIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Survey]: """ Performs a GET request against the /system/surveys endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Survey, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Survey, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Survey]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Survey]: """ Performs a GET request against the /system/surveys endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[Survey]: The parsed response data. """ - return self._parse_many( - Survey, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Survey, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Survey: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Survey: """ Performs a POST request against the /system/surveys endpoint. @@ -117,6 +83,4 @@ def post( Returns: Survey: The parsed response data. """ - return self._parse_one( - Survey, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Survey, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdCopyEndpoint.py index a4b2e0f90..fe3c79857 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdCopyEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Survey -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class SystemSurveysIdCopyEndpoint( - ConnectWiseEndpoint, IPostable[Survey, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) +class SystemSurveysIdCopyEndpoint(ConnectWiseEndpoint, IPostable[Survey, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, Survey) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Survey: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Survey: """ Performs a POST request against the /system/surveys/{id}/copy endpoint. @@ -32,6 +24,4 @@ def post( Returns: Survey: The parsed response data. """ - return self._parse_one( - Survey, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Survey, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdEndpoint.py index 508b03396..2722060fb 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdEndpoint.py @@ -1,59 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSurveysIdCopyEndpoint import ( - SystemSurveysIdCopyEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSurveysIdInfoEndpoint import ( - SystemSurveysIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsEndpoint import ( - SystemSurveysIdQuestionsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemSurveysIdCopyEndpoint import SystemSurveysIdCopyEndpoint +from pyconnectwise.endpoints.manage.SystemSurveysIdInfoEndpoint import SystemSurveysIdInfoEndpoint +from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsEndpoint import SystemSurveysIdQuestionsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Survey from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysIdEndpoint( ConnectWiseEndpoint, IGettable[Survey, ConnectWiseManageRequestParams], - IPuttable[Survey, ConnectWiseManageRequestParams], IPatchable[Survey, ConnectWiseManageRequestParams], + IPuttable[Survey, ConnectWiseManageRequestParams], IPaginateable[Survey, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Survey) - IPuttable.__init__(self, Survey) IPatchable.__init__(self, Survey) + IPuttable.__init__(self, Survey) IPaginateable.__init__(self, Survey) - self.copy = self._register_child_endpoint( - SystemSurveysIdCopyEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemSurveysIdInfoEndpoint(client, parent_endpoint=self) - ) - self.questions = self._register_child_endpoint( - SystemSurveysIdQuestionsEndpoint(client, parent_endpoint=self) - ) + self.copy = self._register_child_endpoint(SystemSurveysIdCopyEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemSurveysIdInfoEndpoint(client, parent_endpoint=self)) + self.questions = self._register_child_endpoint(SystemSurveysIdQuestionsEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Survey]: """ Performs a GET request against the /system/surveys/{id} endpoint and returns an initialized PaginatedResponse object. @@ -70,54 +49,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Survey, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Survey, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Survey: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/surveys/{id} endpoint. + Performs a DELETE request against the /system/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Survey: The parsed response data. """ - return self._parse_one( - Survey, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Survey: """ - Performs a DELETE request against the /system/surveys/{id} endpoint. + Performs a GET request against the /system/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Survey: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Survey, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Survey: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Survey: """ - Performs a PUT request against the /system/surveys/{id} endpoint. + Performs a PATCH request against the /system/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +83,11 @@ def put( Returns: Survey: The parsed response data. """ - return self._parse_one( - Survey, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Survey, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Survey: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Survey: """ - Performs a PATCH request against the /system/surveys/{id} endpoint. + Performs a PUT request against the /system/surveys/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,6 +95,4 @@ def patch( Returns: Survey: The parsed response data. """ - return self._parse_one( - Survey, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Survey, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdInfoEndpoint.py index 3c15151f8..ad226e55f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SurveyInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemSurveysIdInfoEndpoint( IGettable[SurveyInfo, ConnectWiseManageRequestParams], IPaginateable[SurveyInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, SurveyInfo) IPaginateable.__init__(self, SurveyInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyInfo]: """ Performs a GET request against the /system/surveys/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SurveyInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyInfo: """ Performs a GET request against the /system/surveys/{id}/info endpoint. @@ -67,6 +50,4 @@ def get( Returns: SurveyInfo: The parsed response data. """ - return self._parse_one( - SurveyInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(SurveyInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsCountEndpoint.py index 3efaa9aef..ead5b1e73 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysIdQuestionsCountEndpoint( @@ -16,18 +15,13 @@ class SystemSurveysIdQuestionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/surveys/{id}/questions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/surveys/{id}/questions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsEndpoint.py index 6b504e95e..7f045ed3c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsCountEndpoint import ( - SystemSurveysIdQuestionsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsIdEndpoint import ( - SystemSurveysIdQuestionsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsCountEndpoint import SystemSurveysIdQuestionsCountEndpoint +from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsIdEndpoint import SystemSurveysIdQuestionsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SurveyQuestion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysIdQuestionsEndpoint( @@ -24,36 +18,29 @@ class SystemSurveysIdQuestionsEndpoint( IPostable[SurveyQuestion, ConnectWiseManageRequestParams], IPaginateable[SurveyQuestion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "questions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "questions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SurveyQuestion]) IPostable.__init__(self, SurveyQuestion) IPaginateable.__init__(self, SurveyQuestion) - self.count = self._register_child_endpoint( - SystemSurveysIdQuestionsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSurveysIdQuestionsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemSurveysIdQuestionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSurveysIdQuestionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSurveysIdQuestionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSurveysIdQuestionsIdEndpoint: The initialized SystemSurveysIdQuestionsIdEndpoint object. """ child = SystemSurveysIdQuestionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyQuestion]: """ Performs a GET request against the /system/surveys/{id}/questions endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyQuestion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyQuestion, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SurveyQuestion]: """ Performs a GET request against the /system/surveys/{id}/questions endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[SurveyQuestion]: The parsed response data. """ - return self._parse_many( - SurveyQuestion, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SurveyQuestion, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyQuestion: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyQuestion: """ Performs a POST request against the /system/surveys/{id}/questions endpoint. @@ -112,7 +85,4 @@ def post( Returns: SurveyQuestion: The parsed response data. """ - return self._parse_one( - SurveyQuestion, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SurveyQuestion, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdEndpoint.py index acebde658..41c9d5138 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdEndpoint.py @@ -1,36 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsIdValuesEndpoint import ( SystemSurveysIdQuestionsIdValuesEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SurveyQuestion from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysIdQuestionsIdEndpoint( ConnectWiseEndpoint, IGettable[SurveyQuestion, ConnectWiseManageRequestParams], - IPuttable[SurveyQuestion, ConnectWiseManageRequestParams], IPatchable[SurveyQuestion, ConnectWiseManageRequestParams], + IPuttable[SurveyQuestion, ConnectWiseManageRequestParams], IPaginateable[SurveyQuestion, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SurveyQuestion) - IPuttable.__init__(self, SurveyQuestion) IPatchable.__init__(self, SurveyQuestion) + IPuttable.__init__(self, SurveyQuestion) IPaginateable.__init__(self, SurveyQuestion) self.values = self._register_child_endpoint( @@ -38,10 +32,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyQuestion]: """ Performs a GET request against the /system/surveys/{id}/questions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +50,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyQuestion, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyQuestion, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyQuestion: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/surveys/{id}/questions/{id} endpoint. + Performs a DELETE request against the /system/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SurveyQuestion: The parsed response data. """ - return self._parse_one( - SurveyQuestion, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyQuestion: """ - Performs a DELETE request against the /system/surveys/{id}/questions/{id} endpoint. + Performs a GET request against the /system/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SurveyQuestion: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SurveyQuestion, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyQuestion: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> SurveyQuestion: """ - Performs a PUT request against the /system/surveys/{id}/questions/{id} endpoint. + Performs a PATCH request against the /system/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +85,11 @@ def put( Returns: SurveyQuestion: The parsed response data. """ - return self._parse_one( - SurveyQuestion, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(SurveyQuestion, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyQuestion: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SurveyQuestion: """ - Performs a PATCH request against the /system/surveys/{id}/questions/{id} endpoint. + Performs a PUT request against the /system/surveys/{id}/questions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +97,4 @@ def patch( Returns: SurveyQuestion: The parsed response data. """ - return self._parse_one( - SurveyQuestion, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SurveyQuestion, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesEndpoint.py index 84ab3889f..a720bb1df 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesEndpoint.py @@ -1,18 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemSurveysIdQuestionsIdValuesIdEndpoint import ( SystemSurveysIdQuestionsIdValuesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import SurveyQuestionValue from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysIdQuestionsIdValuesEndpoint( @@ -21,34 +19,27 @@ class SystemSurveysIdQuestionsIdValuesEndpoint( IPostable[SurveyQuestionValue, ConnectWiseManageRequestParams], IPaginateable[SurveyQuestionValue, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "values", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "values", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SurveyQuestionValue]) IPostable.__init__(self, SurveyQuestionValue) IPaginateable.__init__(self, SurveyQuestionValue) - def id(self, id: int) -> SystemSurveysIdQuestionsIdValuesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemSurveysIdQuestionsIdValuesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemSurveysIdQuestionsIdValuesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemSurveysIdQuestionsIdValuesIdEndpoint: The initialized SystemSurveysIdQuestionsIdValuesIdEndpoint object. """ - child = SystemSurveysIdQuestionsIdValuesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemSurveysIdQuestionsIdValuesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyQuestionValue]: """ Performs a GET request against the /system/surveys/{id}/questions/{id}/values endpoint and returns an initialized PaginatedResponse object. @@ -66,18 +57,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyQuestionValue, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyQuestionValue, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[SurveyQuestionValue]: """ Performs a GET request against the /system/surveys/{id}/questions/{id}/values endpoint. @@ -88,15 +72,10 @@ def get( Returns: list[SurveyQuestionValue]: The parsed response data. """ - return self._parse_many( - SurveyQuestionValue, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(SurveyQuestionValue, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> SurveyQuestionValue: """ Performs a POST request against the /system/surveys/{id}/questions/{id}/values endpoint. @@ -107,7 +86,4 @@ def post( Returns: SurveyQuestionValue: The parsed response data. """ - return self._parse_one( - SurveyQuestionValue, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SurveyQuestionValue, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesIdEndpoint.py index a27a42297..842fbb7dd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysIdQuestionsIdValuesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import SurveyQuestionValue from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysIdQuestionsIdValuesIdEndpoint( ConnectWiseEndpoint, IGettable[SurveyQuestionValue, ConnectWiseManageRequestParams], - IPuttable[SurveyQuestionValue, ConnectWiseManageRequestParams], IPatchable[SurveyQuestionValue, ConnectWiseManageRequestParams], + IPuttable[SurveyQuestionValue, ConnectWiseManageRequestParams], IPaginateable[SurveyQuestionValue, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, SurveyQuestionValue) - IPuttable.__init__(self, SurveyQuestionValue) IPatchable.__init__(self, SurveyQuestionValue) + IPuttable.__init__(self, SurveyQuestionValue) IPaginateable.__init__(self, SurveyQuestionValue) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyQuestionValue]: """ Performs a GET request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyQuestionValue, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), SurveyQuestionValue, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SurveyQuestionValue: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. + Performs a DELETE request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - SurveyQuestionValue: The parsed response data. """ - return self._parse_one( - SurveyQuestionValue, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> SurveyQuestionValue: """ - Performs a DELETE request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. + Performs a GET request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + SurveyQuestionValue: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(SurveyQuestionValue, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> SurveyQuestionValue: """ - Performs a PUT request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. + Performs a PATCH request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: SurveyQuestionValue: The parsed response data. """ - return self._parse_one( - SurveyQuestionValue, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(SurveyQuestionValue, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> SurveyQuestionValue: """ - Performs a PATCH request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. + Performs a PUT request against the /system/surveys/{id}/questions/{id}/values/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: SurveyQuestionValue: The parsed response data. """ - return self._parse_one( - SurveyQuestionValue, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(SurveyQuestionValue, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysInfoCountEndpoint.py index b5f220103..e37325de6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemSurveysInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/surveys/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/surveys/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemSurveysInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemSurveysInfoEndpoint.py index cab9183ad..151f7847a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemSurveysInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemSurveysInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemSurveysInfoCountEndpoint import ( - SystemSurveysInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemSurveysInfoCountEndpoint import SystemSurveysInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import SurveyInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemSurveysInfoEndpoint( @@ -19,22 +16,15 @@ class SystemSurveysInfoEndpoint( IGettable[list[SurveyInfo], ConnectWiseManageRequestParams], IPaginateable[SurveyInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[SurveyInfo]) IPaginateable.__init__(self, SurveyInfo) - self.count = self._register_child_endpoint( - SystemSurveysInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemSurveysInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[SurveyInfo]: """ Performs a GET request against the /system/surveys/info endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - SurveyInfo, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), SurveyInfo, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[SurveyInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[SurveyInfo]: """ Performs a GET request against the /system/surveys/info endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[SurveyInfo]: The parsed response data. """ - return self._parse_many( - SurveyInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(SurveyInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsCountEndpoint.py index af4966616..b2b3cc38d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTimezonesetupsCountEndpoint( @@ -16,18 +15,13 @@ class SystemTimezonesetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/timeZoneSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/timeZoneSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsEndpoint.py index 9cc20b9e8..b63a61938 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemTimezonesetupsCountEndpoint import ( - SystemTimezonesetupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemTimezonesetupsIdEndpoint import ( - SystemTimezonesetupsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemTimezonesetupsInfoEndpoint import ( - SystemTimezonesetupsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemTimezonesetupsCountEndpoint import SystemTimezonesetupsCountEndpoint +from pyconnectwise.endpoints.manage.SystemTimezonesetupsIdEndpoint import SystemTimezonesetupsIdEndpoint +from pyconnectwise.endpoints.manage.SystemTimezonesetupsInfoEndpoint import SystemTimezonesetupsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TimeZoneSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTimezonesetupsEndpoint( @@ -27,39 +19,30 @@ class SystemTimezonesetupsEndpoint( IPostable[TimeZoneSetup, ConnectWiseManageRequestParams], IPaginateable[TimeZoneSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "timeZoneSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "timeZoneSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeZoneSetup]) IPostable.__init__(self, TimeZoneSetup) IPaginateable.__init__(self, TimeZoneSetup) - self.count = self._register_child_endpoint( - SystemTimezonesetupsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemTimezonesetupsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemTimezonesetupsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemTimezonesetupsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemTimezonesetupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemTimezonesetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemTimezonesetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemTimezonesetupsIdEndpoint: The initialized SystemTimezonesetupsIdEndpoint object. """ child = SystemTimezonesetupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeZoneSetup]: """ Performs a GET request against the /system/timeZoneSetups endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeZoneSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeZoneSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimeZoneSetup]: """ Performs a GET request against the /system/timeZoneSetups endpoint. @@ -99,15 +75,9 @@ def get( Returns: list[TimeZoneSetup]: The parsed response data. """ - return self._parse_many( - TimeZoneSetup, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TimeZoneSetup, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeZoneSetup: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeZoneSetup: """ Performs a POST request against the /system/timeZoneSetups endpoint. @@ -117,7 +87,4 @@ def post( Returns: TimeZoneSetup: The parsed response data. """ - return self._parse_one( - TimeZoneSetup, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TimeZoneSetup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdEndpoint.py index a7d2261fc..f6a10f6c4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemTimezonesetupsIdInfoEndpoint import ( - SystemTimezonesetupsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemTimezonesetupsIdInfoEndpoint import SystemTimezonesetupsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TimeZoneSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTimezonesetupsIdEndpoint( ConnectWiseEndpoint, IGettable[TimeZoneSetup, ConnectWiseManageRequestParams], - IPuttable[TimeZoneSetup, ConnectWiseManageRequestParams], IPatchable[TimeZoneSetup, ConnectWiseManageRequestParams], + IPuttable[TimeZoneSetup, ConnectWiseManageRequestParams], IPaginateable[TimeZoneSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeZoneSetup) - IPuttable.__init__(self, TimeZoneSetup) IPatchable.__init__(self, TimeZoneSetup) + IPuttable.__init__(self, TimeZoneSetup) IPaginateable.__init__(self, TimeZoneSetup) - self.info = self._register_child_endpoint( - SystemTimezonesetupsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemTimezonesetupsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeZoneSetup]: """ Performs a GET request against the /system/timeZoneSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,39 +46,22 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeZoneSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeZoneSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeZoneSetup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/timeZoneSetups/{id} endpoint. + Performs a DELETE request against the /system/timeZoneSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TimeZoneSetup: The parsed response data. """ - return self._parse_one( - TimeZoneSetup, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeZoneSetup: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeZoneSetup: """ - Performs a PUT request against the /system/timeZoneSetups/{id} endpoint. + Performs a GET request against the /system/timeZoneSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -99,15 +69,9 @@ def put( Returns: TimeZoneSetup: The parsed response data. """ - return self._parse_one( - TimeZoneSetup, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TimeZoneSetup, super()._make_request("GET", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeZoneSetup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TimeZoneSetup: """ Performs a PATCH request against the /system/timeZoneSetups/{id} endpoint. @@ -117,21 +81,16 @@ def patch( Returns: TimeZoneSetup: The parsed response data. """ - return self._parse_one( - TimeZoneSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TimeZoneSetup, super()._make_request("PATCH", data=data, params=params).json()) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeZoneSetup: """ - Performs a DELETE request against the /system/timeZoneSetups/{id} endpoint. + Performs a PUT request against the /system/timeZoneSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TimeZoneSetup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TimeZoneSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdInfoEndpoint.py index 602723058..660db3870 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeZoneSetupInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTimezonesetupsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemTimezonesetupsIdInfoEndpoint( IGettable[TimeZoneSetupInfo, ConnectWiseManageRequestParams], IPaginateable[TimeZoneSetupInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeZoneSetupInfo) IPaginateable.__init__(self, TimeZoneSetupInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeZoneSetupInfo]: """ Performs a GET request against the /system/timeZoneSetups/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeZoneSetupInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeZoneSetupInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeZoneSetupInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeZoneSetupInfo: """ Performs a GET request against the /system/timeZoneSetups/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: TimeZoneSetupInfo: The parsed response data. """ - return self._parse_one( - TimeZoneSetupInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(TimeZoneSetupInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoCountEndpoint.py index e1b5abac3..8b8535cda 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTimezonesetupsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemTimezonesetupsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/timeZoneSetups/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/timeZoneSetups/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoEndpoint.py index 960004061..474d6ea5c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTimezonesetupsInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemTimezonesetupsInfoCountEndpoint import ( - SystemTimezonesetupsInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemTimezonesetupsInfoCountEndpoint import SystemTimezonesetupsInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeZoneSetupInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTimezonesetupsInfoEndpoint( @@ -19,22 +16,15 @@ class SystemTimezonesetupsInfoEndpoint( IGettable[list[TimeZoneSetupInfo], ConnectWiseManageRequestParams], IPaginateable[TimeZoneSetupInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeZoneSetupInfo]) IPaginateable.__init__(self, TimeZoneSetupInfo) - self.count = self._register_child_endpoint( - SystemTimezonesetupsInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemTimezonesetupsInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeZoneSetupInfo]: """ Performs a GET request against the /system/timeZoneSetups/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeZoneSetupInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeZoneSetupInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimeZoneSetupInfo]: """ Performs a GET request against the /system/timeZoneSetups/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[TimeZoneSetupInfo]: The parsed response data. """ - return self._parse_many( - TimeZoneSetupInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TimeZoneSetupInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesCountEndpoint.py index 657829e9b..ed404dec6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTodaypagecategoriesCountEndpoint( @@ -16,18 +15,13 @@ class SystemTodaypagecategoriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/todayPageCategories/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/todayPageCategories/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesEndpoint.py index 1ca9065f8..c2e910f4f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemTodaypagecategoriesCountEndpoint import ( - SystemTodaypagecategoriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemTodaypagecategoriesIdEndpoint import ( - SystemTodaypagecategoriesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemTodaypagecategoriesCountEndpoint import SystemTodaypagecategoriesCountEndpoint +from pyconnectwise.endpoints.manage.SystemTodaypagecategoriesIdEndpoint import SystemTodaypagecategoriesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TodayPageCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTodaypagecategoriesEndpoint( @@ -24,36 +18,29 @@ class SystemTodaypagecategoriesEndpoint( IPostable[TodayPageCategory, ConnectWiseManageRequestParams], IPaginateable[TodayPageCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "todayPageCategories", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "todayPageCategories", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TodayPageCategory]) IPostable.__init__(self, TodayPageCategory) IPaginateable.__init__(self, TodayPageCategory) - self.count = self._register_child_endpoint( - SystemTodaypagecategoriesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemTodaypagecategoriesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemTodaypagecategoriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemTodaypagecategoriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemTodaypagecategoriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemTodaypagecategoriesIdEndpoint: The initialized SystemTodaypagecategoriesIdEndpoint object. """ child = SystemTodaypagecategoriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TodayPageCategory]: """ Performs a GET request against the /system/todayPageCategories endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TodayPageCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TodayPageCategory, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TodayPageCategory]: """ Performs a GET request against the /system/todayPageCategories endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[TodayPageCategory]: The parsed response data. """ - return self._parse_many( - TodayPageCategory, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TodayPageCategory, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TodayPageCategory: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TodayPageCategory: """ Performs a POST request against the /system/todayPageCategories endpoint. @@ -112,7 +85,4 @@ def post( Returns: TodayPageCategory: The parsed response data. """ - return self._parse_one( - TodayPageCategory, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TodayPageCategory, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesIdEndpoint.py index f655fd1a2..bdbdf5bf2 100644 --- a/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemTodaypagecategoriesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TodayPageCategory from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemTodaypagecategoriesIdEndpoint( ConnectWiseEndpoint, IGettable[TodayPageCategory, ConnectWiseManageRequestParams], - IPuttable[TodayPageCategory, ConnectWiseManageRequestParams], IPatchable[TodayPageCategory, ConnectWiseManageRequestParams], + IPuttable[TodayPageCategory, ConnectWiseManageRequestParams], IPaginateable[TodayPageCategory, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TodayPageCategory) - IPuttable.__init__(self, TodayPageCategory) IPatchable.__init__(self, TodayPageCategory) + IPuttable.__init__(self, TodayPageCategory) IPaginateable.__init__(self, TodayPageCategory) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TodayPageCategory]: """ Performs a GET request against the /system/todayPageCategories/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TodayPageCategory, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TodayPageCategory, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TodayPageCategory: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/todayPageCategories/{id} endpoint. + Performs a DELETE request against the /system/todayPageCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TodayPageCategory: The parsed response data. """ - return self._parse_one( - TodayPageCategory, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TodayPageCategory: """ - Performs a DELETE request against the /system/todayPageCategories/{id} endpoint. + Performs a GET request against the /system/todayPageCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TodayPageCategory: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TodayPageCategory, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TodayPageCategory: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TodayPageCategory: """ - Performs a PUT request against the /system/todayPageCategories/{id} endpoint. + Performs a PATCH request against the /system/todayPageCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: TodayPageCategory: The parsed response data. """ - return self._parse_one( - TodayPageCategory, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TodayPageCategory, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TodayPageCategory: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TodayPageCategory: """ - Performs a PATCH request against the /system/todayPageCategories/{id} endpoint. + Performs a PUT request against the /system/todayPageCategories/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: TodayPageCategory: The parsed response data. """ - return self._parse_one( - TodayPageCategory, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TodayPageCategory, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsCountEndpoint.py index 7bd32c55d..fe813ea17 100644 --- a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemUserdefinedfieldsCountEndpoint( @@ -16,18 +15,13 @@ class SystemUserdefinedfieldsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/userDefinedFields/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/userDefinedFields/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsEndpoint.py index bb883b395..b061e8b75 100644 --- a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsCountEndpoint import ( - SystemUserdefinedfieldsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsIdEndpoint import ( - SystemUserdefinedfieldsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsInfoEndpoint import ( - SystemUserdefinedfieldsInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsCountEndpoint import SystemUserdefinedfieldsCountEndpoint +from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsIdEndpoint import SystemUserdefinedfieldsIdEndpoint +from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsInfoEndpoint import SystemUserdefinedfieldsInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import UserDefinedField from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemUserdefinedfieldsEndpoint( @@ -27,39 +19,30 @@ class SystemUserdefinedfieldsEndpoint( IPostable[UserDefinedField, ConnectWiseManageRequestParams], IPaginateable[UserDefinedField, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "userDefinedFields", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "userDefinedFields", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UserDefinedField]) IPostable.__init__(self, UserDefinedField) IPaginateable.__init__(self, UserDefinedField) - self.count = self._register_child_endpoint( - SystemUserdefinedfieldsCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemUserdefinedfieldsInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemUserdefinedfieldsCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemUserdefinedfieldsInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemUserdefinedfieldsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemUserdefinedfieldsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemUserdefinedfieldsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemUserdefinedfieldsIdEndpoint: The initialized SystemUserdefinedfieldsIdEndpoint object. """ child = SystemUserdefinedfieldsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UserDefinedField]: """ Performs a GET request against the /system/userDefinedFields endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UserDefinedField, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UserDefinedField, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UserDefinedField]: """ Performs a GET request against the /system/userDefinedFields endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[UserDefinedField]: The parsed response data. """ - return self._parse_many( - UserDefinedField, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(UserDefinedField, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UserDefinedField: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UserDefinedField: """ Performs a POST request against the /system/userDefinedFields endpoint. @@ -118,7 +87,4 @@ def post( Returns: UserDefinedField: The parsed response data. """ - return self._parse_one( - UserDefinedField, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(UserDefinedField, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdEndpoint.py index 28d8d785f..c41fe0286 100644 --- a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsIdInfoEndpoint import ( - SystemUserdefinedfieldsIdInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsIdInfoEndpoint import SystemUserdefinedfieldsIdInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import UserDefinedField from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemUserdefinedfieldsIdEndpoint( ConnectWiseEndpoint, IGettable[UserDefinedField, ConnectWiseManageRequestParams], - IPuttable[UserDefinedField, ConnectWiseManageRequestParams], IPatchable[UserDefinedField, ConnectWiseManageRequestParams], + IPuttable[UserDefinedField, ConnectWiseManageRequestParams], IPaginateable[UserDefinedField, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, UserDefinedField) - IPuttable.__init__(self, UserDefinedField) IPatchable.__init__(self, UserDefinedField) + IPuttable.__init__(self, UserDefinedField) IPaginateable.__init__(self, UserDefinedField) - self.info = self._register_child_endpoint( - SystemUserdefinedfieldsIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemUserdefinedfieldsIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UserDefinedField]: """ Performs a GET request against the /system/userDefinedFields/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UserDefinedField, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UserDefinedField, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UserDefinedField: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/userDefinedFields/{id} endpoint. + Performs a DELETE request against the /system/userDefinedFields/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - UserDefinedField: The parsed response data. """ - return self._parse_one( - UserDefinedField, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UserDefinedField: """ - Performs a DELETE request against the /system/userDefinedFields/{id} endpoint. + Performs a GET request against the /system/userDefinedFields/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + UserDefinedField: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(UserDefinedField, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> UserDefinedField: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> UserDefinedField: """ - Performs a PUT request against the /system/userDefinedFields/{id} endpoint. + Performs a PATCH request against the /system/userDefinedFields/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +81,11 @@ def put( Returns: UserDefinedField: The parsed response data. """ - return self._parse_one( - UserDefinedField, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(UserDefinedField, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> UserDefinedField: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> UserDefinedField: """ - Performs a PATCH request against the /system/userDefinedFields/{id} endpoint. + Performs a PUT request against the /system/userDefinedFields/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +93,4 @@ def patch( Returns: UserDefinedField: The parsed response data. """ - return self._parse_one( - UserDefinedField, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(UserDefinedField, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdInfoEndpoint.py index db50544ab..c72c58a16 100644 --- a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UserDefinedFieldInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemUserdefinedfieldsIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemUserdefinedfieldsIdInfoEndpoint( IGettable[UserDefinedFieldInfo, ConnectWiseManageRequestParams], IPaginateable[UserDefinedFieldInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, UserDefinedFieldInfo) IPaginateable.__init__(self, UserDefinedFieldInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UserDefinedFieldInfo]: """ Performs a GET request against the /system/userDefinedFields/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UserDefinedFieldInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UserDefinedFieldInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> UserDefinedFieldInfo: """ Performs a GET request against the /system/userDefinedFields/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: UserDefinedFieldInfo: The parsed response data. """ - return self._parse_one( - UserDefinedFieldInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(UserDefinedFieldInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoCountEndpoint.py index d33f6f048..5a210f9cb 100644 --- a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemUserdefinedfieldsInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemUserdefinedfieldsInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/userDefinedFields/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/userDefinedFields/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoEndpoint.py index 83c03a9e6..28ffe32f6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemUserdefinedfieldsInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemUserdefinedfieldsInfoCountEndpoint import ( SystemUserdefinedfieldsInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import UserDefinedFieldInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemUserdefinedfieldsInfoEndpoint( @@ -19,10 +18,8 @@ class SystemUserdefinedfieldsInfoEndpoint( IGettable[list[UserDefinedFieldInfo], ConnectWiseManageRequestParams], IPaginateable[UserDefinedFieldInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[UserDefinedFieldInfo]) IPaginateable.__init__(self, UserDefinedFieldInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[UserDefinedFieldInfo]: """ Performs a GET request against the /system/userDefinedFields/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - UserDefinedFieldInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), UserDefinedFieldInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[UserDefinedFieldInfo]: """ Performs a GET request against the /system/userDefinedFields/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[UserDefinedFieldInfo]: The parsed response data. """ - return self._parse_many( - UserDefinedFieldInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(UserDefinedFieldInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsEndpoint.py index 059d8dc97..246299b59 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsEndpoint.py @@ -1,24 +1,25 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemWorkflowactionsIdEndpoint import ( - SystemWorkflowactionsIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemWorkflowactionsIdEndpoint import SystemWorkflowactionsIdEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowactionsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workflowActions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workflowActions", parent_endpoint=parent_endpoint) - def id(self, id: int) -> SystemWorkflowactionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowactionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowactionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowactionsIdEndpoint: The initialized SystemWorkflowactionsIdEndpoint object. """ child = SystemWorkflowactionsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersCountEndpoint.py index 62bd976cc..df6c502c4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowactionsIdAutomateparametersCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowactionsIdAutomateparametersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflowActions/{id}/automateParameters/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflowActions/{id}/automateParameters/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersEndpoint.py index 4626ab140..968392479 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowactionsIdAutomateparametersCountEndpoint import ( SystemWorkflowactionsIdAutomateparametersCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemWorkflowactionsIdAutomateparametersIdEndpoint import ( SystemWorkflowactionsIdAutomateparametersIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WorkflowActionAutomateParameter from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowactionsIdAutomateparametersEndpoint( @@ -24,42 +22,31 @@ class SystemWorkflowactionsIdAutomateparametersEndpoint( IPostable[WorkflowActionAutomateParameter, ConnectWiseManageRequestParams], IPaginateable[WorkflowActionAutomateParameter, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "automateParameters", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "automateParameters", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowActionAutomateParameter]) IPostable.__init__(self, WorkflowActionAutomateParameter) IPaginateable.__init__(self, WorkflowActionAutomateParameter) self.count = self._register_child_endpoint( - SystemWorkflowactionsIdAutomateparametersCountEndpoint( - client, parent_endpoint=self - ) + SystemWorkflowactionsIdAutomateparametersCountEndpoint(client, parent_endpoint=self) ) - def id( - self, id: int # noqa: A002 - ) -> SystemWorkflowactionsIdAutomateparametersIdEndpoint: + def id(self, _id: int) -> SystemWorkflowactionsIdAutomateparametersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowactionsIdAutomateparametersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowactionsIdAutomateparametersIdEndpoint: The initialized SystemWorkflowactionsIdAutomateparametersIdEndpoint object. """ - child = SystemWorkflowactionsIdAutomateparametersIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowactionsIdAutomateparametersIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowActionAutomateParameter]: """ Performs a GET request against the /system/workflowActions/{id}/automateParameters endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowActionAutomateParameter, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowActionAutomateParameter, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowActionAutomateParameter]: """ Performs a GET request against the /system/workflowActions/{id}/automateParameters endpoint. @@ -100,14 +80,11 @@ def get( list[WorkflowActionAutomateParameter]: The parsed response data. """ return self._parse_many( - WorkflowActionAutomateParameter, - super()._make_request("GET", data=data, params=params).json(), + WorkflowActionAutomateParameter, super()._make_request("GET", data=data, params=params).json() ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowActionAutomateParameter: """ Performs a POST request against the /system/workflowActions/{id}/automateParameters endpoint. @@ -119,6 +96,5 @@ def post( WorkflowActionAutomateParameter: The parsed response data. """ return self._parse_one( - WorkflowActionAutomateParameter, - super()._make_request("POST", data=data, params=params).json(), + WorkflowActionAutomateParameter, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersIdEndpoint.py index 9d1a810ed..d5b664f16 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdAutomateparametersIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WorkflowActionAutomateParameter from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowactionsIdAutomateparametersIdEndpoint( ConnectWiseEndpoint, IGettable[WorkflowActionAutomateParameter, ConnectWiseManageRequestParams], - IPuttable[WorkflowActionAutomateParameter, ConnectWiseManageRequestParams], IPatchable[WorkflowActionAutomateParameter, ConnectWiseManageRequestParams], + IPuttable[WorkflowActionAutomateParameter, ConnectWiseManageRequestParams], IPaginateable[WorkflowActionAutomateParameter, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowActionAutomateParameter) - IPuttable.__init__(self, WorkflowActionAutomateParameter) IPatchable.__init__(self, WorkflowActionAutomateParameter) + IPuttable.__init__(self, WorkflowActionAutomateParameter) IPaginateable.__init__(self, WorkflowActionAutomateParameter) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowActionAutomateParameter]: """ Performs a GET request against the /system/workflowActions/{id}/automateParameters/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,40 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowActionAutomateParameter, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowActionAutomateParameter, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowActionAutomateParameter: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. + Performs a DELETE request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WorkflowActionAutomateParameter: The parsed response data. """ - return self._parse_one( - WorkflowActionAutomateParameter, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> WorkflowActionAutomateParameter: """ - Performs a DELETE request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. + Performs a GET request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WorkflowActionAutomateParameter: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one( + WorkflowActionAutomateParameter, super()._make_request("GET", data=data, params=params).json() + ) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowActionAutomateParameter: """ - Performs a PUT request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. + Performs a PATCH request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -108,17 +85,14 @@ def put( WorkflowActionAutomateParameter: The parsed response data. """ return self._parse_one( - WorkflowActionAutomateParameter, - super()._make_request("PUT", data=data, params=params).json(), + WorkflowActionAutomateParameter, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowActionAutomateParameter: """ - Performs a PATCH request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. + Performs a PUT request against the /system/workflowActions/{id}/automateParameters/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -127,6 +101,5 @@ def patch( WorkflowActionAutomateParameter: The parsed response data. """ return self._parse_one( - WorkflowActionAutomateParameter, - super()._make_request("PATCH", data=data, params=params).json(), + WorkflowActionAutomateParameter, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdEndpoint.py index 2823c41ff..10b92573d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowactionsIdEndpoint.py @@ -1,17 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowactionsIdAutomateparametersEndpoint import ( SystemWorkflowactionsIdAutomateparametersEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemWorkflowactionsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.automate_parameters = self._register_child_endpoint( - SystemWorkflowactionsIdAutomateparametersEndpoint( - client, parent_endpoint=self - ) + SystemWorkflowactionsIdAutomateparametersEndpoint(client, parent_endpoint=self) ) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsCountEndpoint.py index a312cacdb..3f02c55fd 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsEndpoint.py index e1da57dc8..e71ea8c4e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsEndpoint.py @@ -1,27 +1,19 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemWorkflowsCountEndpoint import ( - SystemWorkflowsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdEndpoint import ( - SystemWorkflowsIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesEndpoint import ( - SystemWorkflowsTabletypesEndpoint, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsCountEndpoint import SystemWorkflowsCountEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdEndpoint import SystemWorkflowsIdEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesEndpoint import SystemWorkflowsTabletypesEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsUserdefinedfieldsEndpoint import ( SystemWorkflowsUserdefinedfieldsEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import Workflow from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsEndpoint( @@ -30,42 +22,35 @@ class SystemWorkflowsEndpoint( IPostable[Workflow, ConnectWiseManageRequestParams], IPaginateable[Workflow, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workflows", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workflows", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Workflow]) IPostable.__init__(self, Workflow) IPaginateable.__init__(self, Workflow) + self.count = self._register_child_endpoint(SystemWorkflowsCountEndpoint(client, parent_endpoint=self)) self.table_types = self._register_child_endpoint( SystemWorkflowsTabletypesEndpoint(client, parent_endpoint=self) ) - self.count = self._register_child_endpoint( - SystemWorkflowsCountEndpoint(client, parent_endpoint=self) - ) self.userdefinedfields = self._register_child_endpoint( SystemWorkflowsUserdefinedfieldsEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemWorkflowsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsIdEndpoint: The initialized SystemWorkflowsIdEndpoint object. """ child = SystemWorkflowsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Workflow]: """ Performs a GET request against the /system/workflows endpoint and returns an initialized PaginatedResponse object. @@ -82,20 +67,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Workflow, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Workflow, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Workflow]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Workflow]: """ Performs a GET request against the /system/workflows endpoint. @@ -105,15 +79,9 @@ def get( Returns: list[Workflow]: The parsed response data. """ - return self._parse_many( - Workflow, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Workflow, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Workflow: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Workflow: """ Performs a POST request against the /system/workflows endpoint. @@ -123,6 +91,4 @@ def post( Returns: Workflow: The parsed response data. """ - return self._parse_one( - Workflow, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Workflow, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsCountEndpoint.py index 25a718064..ac52d208a 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdAttachmentsCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdAttachmentsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/{id}/attachments/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/{id}/attachments/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsEndpoint.py index b0a83568e..e2cfe42e4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsEndpoint.py @@ -1,20 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdAttachmentsCountEndpoint import ( SystemWorkflowsIdAttachmentsCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdAttachmentsIdEndpoint import ( - SystemWorkflowsIdAttachmentsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsIdAttachmentsIdEndpoint import SystemWorkflowsIdAttachmentsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowAttachment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdAttachmentsEndpoint( @@ -22,10 +19,8 @@ class SystemWorkflowsIdAttachmentsEndpoint( IGettable[list[WorkflowAttachment], ConnectWiseManageRequestParams], IPaginateable[WorkflowAttachment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "attachments", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "attachments", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowAttachment]) IPaginateable.__init__(self, WorkflowAttachment) @@ -33,26 +28,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemWorkflowsIdAttachmentsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemWorkflowsIdAttachmentsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsIdAttachmentsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsIdAttachmentsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsIdAttachmentsIdEndpoint: The initialized SystemWorkflowsIdAttachmentsIdEndpoint object. """ - child = SystemWorkflowsIdAttachmentsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowsIdAttachmentsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowAttachment]: """ Performs a GET request against the /system/workflows/{id}/attachments endpoint and returns an initialized PaginatedResponse object. @@ -70,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowAttachment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowAttachment, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowAttachment]: """ Performs a GET request against the /system/workflows/{id}/attachments endpoint. @@ -92,7 +75,4 @@ def get( Returns: list[WorkflowAttachment]: The parsed response data. """ - return self._parse_many( - WorkflowAttachment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowAttachment, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsIdEndpoint.py index a67415b4d..6fb2255df 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdAttachmentsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowAttachment from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdAttachmentsIdEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdAttachmentsIdEndpoint( IGettable[WorkflowAttachment, ConnectWiseManageRequestParams], IPaginateable[WorkflowAttachment, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowAttachment) IPaginateable.__init__(self, WorkflowAttachment) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowAttachment]: """ Performs a GET request against the /system/workflows/{id}/attachments/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowAttachment, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowAttachment, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowAttachment: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowAttachment: """ Performs a GET request against the /system/workflows/{id}/attachments/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: WorkflowAttachment: The parsed response data. """ - return self._parse_one( - WorkflowAttachment, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(WorkflowAttachment, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdCopyEndpoint.py index 8c4aad9d8..2bcb79353 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdCopyEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import Workflow -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class SystemWorkflowsIdCopyEndpoint( - ConnectWiseEndpoint, IPostable[Workflow, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) +class SystemWorkflowsIdCopyEndpoint(ConnectWiseEndpoint, IPostable[Workflow, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, Workflow) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Workflow: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Workflow: """ Performs a POST request against the /system/workflows/{id}/copy endpoint. @@ -32,6 +24,4 @@ def post( Returns: Workflow: The parsed response data. """ - return self._parse_one( - Workflow, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(Workflow, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEndpoint.py index 0a7d0a70f..1c4a01374 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEndpoint.py @@ -1,71 +1,46 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemWorkflowsIdAttachmentsEndpoint import ( - SystemWorkflowsIdAttachmentsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdCopyEndpoint import ( - SystemWorkflowsIdCopyEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsEndpoint import ( - SystemWorkflowsIdEventsEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesEndpoint import ( - SystemWorkflowsIdNotifytypesEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersEndpoint import ( - SystemWorkflowsIdTriggersEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsIdAttachmentsEndpoint import SystemWorkflowsIdAttachmentsEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdCopyEndpoint import SystemWorkflowsIdCopyEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsEndpoint import SystemWorkflowsIdEventsEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesEndpoint import SystemWorkflowsIdNotifytypesEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersEndpoint import SystemWorkflowsIdTriggersEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import Workflow from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEndpoint( ConnectWiseEndpoint, IGettable[Workflow, ConnectWiseManageRequestParams], - IPuttable[Workflow, ConnectWiseManageRequestParams], IPatchable[Workflow, ConnectWiseManageRequestParams], + IPuttable[Workflow, ConnectWiseManageRequestParams], IPaginateable[Workflow, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, Workflow) - IPuttable.__init__(self, Workflow) IPatchable.__init__(self, Workflow) + IPuttable.__init__(self, Workflow) IPaginateable.__init__(self, Workflow) - self.copy = self._register_child_endpoint( - SystemWorkflowsIdCopyEndpoint(client, parent_endpoint=self) - ) - self.notify_types = self._register_child_endpoint( - SystemWorkflowsIdNotifytypesEndpoint(client, parent_endpoint=self) - ) self.attachments = self._register_child_endpoint( SystemWorkflowsIdAttachmentsEndpoint(client, parent_endpoint=self) ) - self.events = self._register_child_endpoint( - SystemWorkflowsIdEventsEndpoint(client, parent_endpoint=self) - ) - self.triggers = self._register_child_endpoint( - SystemWorkflowsIdTriggersEndpoint(client, parent_endpoint=self) + self.copy = self._register_child_endpoint(SystemWorkflowsIdCopyEndpoint(client, parent_endpoint=self)) + self.events = self._register_child_endpoint(SystemWorkflowsIdEventsEndpoint(client, parent_endpoint=self)) + self.notify_types = self._register_child_endpoint( + SystemWorkflowsIdNotifytypesEndpoint(client, parent_endpoint=self) ) + self.triggers = self._register_child_endpoint(SystemWorkflowsIdTriggersEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Workflow]: """ Performs a GET request against the /system/workflows/{id} endpoint and returns an initialized PaginatedResponse object. @@ -82,54 +57,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Workflow, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Workflow, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Workflow: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/workflows/{id} endpoint. + Performs a DELETE request against the /system/workflows/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - Workflow: The parsed response data. """ - return self._parse_one( - Workflow, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Workflow: """ - Performs a DELETE request against the /system/workflows/{id} endpoint. + Performs a GET request against the /system/workflows/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + Workflow: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(Workflow, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Workflow: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> Workflow: """ - Performs a PUT request against the /system/workflows/{id} endpoint. + Performs a PATCH request against the /system/workflows/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,17 +91,11 @@ def put( Returns: Workflow: The parsed response data. """ - return self._parse_one( - Workflow, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(Workflow, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> Workflow: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Workflow: """ - Performs a PATCH request against the /system/workflows/{id} endpoint. + Performs a PUT request against the /system/workflows/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -155,6 +103,4 @@ def patch( Returns: Workflow: The parsed response data. """ - return self._parse_one( - Workflow, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(Workflow, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsCountEndpoint.py index 854aab12c..4d4432b98 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEventsCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdEventsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/{id}/events/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/{id}/events/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsEndpoint.py index 106985e26..713d3e94e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsCountEndpoint import ( - SystemWorkflowsIdEventsCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdEndpoint import ( - SystemWorkflowsIdEventsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsCountEndpoint import SystemWorkflowsIdEventsCountEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdEndpoint import SystemWorkflowsIdEventsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WorkflowEvent from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEventsEndpoint( @@ -24,36 +18,29 @@ class SystemWorkflowsIdEventsEndpoint( IPostable[WorkflowEvent, ConnectWiseManageRequestParams], IPaginateable[WorkflowEvent, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "events", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "events", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowEvent]) IPostable.__init__(self, WorkflowEvent) IPaginateable.__init__(self, WorkflowEvent) - self.count = self._register_child_endpoint( - SystemWorkflowsIdEventsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemWorkflowsIdEventsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemWorkflowsIdEventsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsIdEventsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsIdEventsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsIdEventsIdEndpoint: The initialized SystemWorkflowsIdEventsIdEndpoint object. """ child = SystemWorkflowsIdEventsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowEvent]: """ Performs a GET request against the /system/workflows/{id}/events endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowEvent, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowEvent, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowEvent]: """ Performs a GET request against the /system/workflows/{id}/events endpoint. @@ -93,15 +73,9 @@ def get( Returns: list[WorkflowEvent]: The parsed response data. """ - return self._parse_many( - WorkflowEvent, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(WorkflowEvent, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowEvent: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowEvent: """ Performs a POST request against the /system/workflows/{id}/events endpoint. @@ -111,7 +85,4 @@ def post( Returns: WorkflowEvent: The parsed response data. """ - return self._parse_one( - WorkflowEvent, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(WorkflowEvent, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsCountEndpoint.py index dd17bcaf3..3d6088534 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEventsIdActionsCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdEventsIdActionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/{id}/events/{id}/actions/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/{id}/events/{id}/actions/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsEndpoint.py index 3af72e42d..937f22e8b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdActionsCountEndpoint import ( SystemWorkflowsIdEventsIdActionsCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdActionsIdEndpoint import ( SystemWorkflowsIdEventsIdActionsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WorkflowAction from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEventsIdActionsEndpoint( @@ -24,10 +22,8 @@ class SystemWorkflowsIdEventsIdActionsEndpoint( IPostable[WorkflowAction, ConnectWiseManageRequestParams], IPaginateable[WorkflowAction, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "actions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "actions", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowAction]) IPostable.__init__(self, WorkflowAction) IPaginateable.__init__(self, WorkflowAction) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemWorkflowsIdEventsIdActionsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemWorkflowsIdEventsIdActionsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsIdEventsIdActionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsIdEventsIdActionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsIdEventsIdActionsIdEndpoint: The initialized SystemWorkflowsIdEventsIdActionsIdEndpoint object. """ - child = SystemWorkflowsIdEventsIdActionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowsIdEventsIdActionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowAction]: """ Performs a GET request against the /system/workflows/{id}/events/{id}/actions endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowAction, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowAction, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowAction]: """ Performs a GET request against the /system/workflows/{id}/events/{id}/actions endpoint. @@ -95,16 +79,9 @@ def get( Returns: list[WorkflowAction]: The parsed response data. """ - return self._parse_many( - WorkflowAction, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowAction, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowAction: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowAction: """ Performs a POST request against the /system/workflows/{id}/events/{id}/actions endpoint. @@ -114,7 +91,4 @@ def post( Returns: WorkflowAction: The parsed response data. """ - return self._parse_one( - WorkflowAction, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(WorkflowAction, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsIdEndpoint.py index b1747a1ef..361426f04 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdActionsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WorkflowAction from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEventsIdActionsIdEndpoint( ConnectWiseEndpoint, IGettable[WorkflowAction, ConnectWiseManageRequestParams], - IPuttable[WorkflowAction, ConnectWiseManageRequestParams], IPatchable[WorkflowAction, ConnectWiseManageRequestParams], + IPuttable[WorkflowAction, ConnectWiseManageRequestParams], IPaginateable[WorkflowAction, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowAction) - IPuttable.__init__(self, WorkflowAction) IPatchable.__init__(self, WorkflowAction) + IPuttable.__init__(self, WorkflowAction) IPaginateable.__init__(self, WorkflowAction) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowAction]: """ Performs a GET request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowAction, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowAction, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowAction: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. + Performs a DELETE request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WorkflowAction: The parsed response data. """ - return self._parse_one( - WorkflowAction, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowAction: """ - Performs a DELETE request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. + Performs a GET request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WorkflowAction: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(WorkflowAction, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowAction: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> WorkflowAction: """ - Performs a PUT request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. + Performs a PATCH request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: WorkflowAction: The parsed response data. """ - return self._parse_one( - WorkflowAction, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(WorkflowAction, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowAction: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowAction: """ - Performs a PATCH request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. + Performs a PUT request against the /system/workflows/{id}/events/{id}/actions/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: WorkflowAction: The parsed response data. """ - return self._parse_one( - WorkflowAction, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(WorkflowAction, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdCopyEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdCopyEndpoint.py index 394758a28..06760f989 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdCopyEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdCopyEndpoint.py @@ -1,28 +1,22 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import WorkflowEvent -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEventsIdCopyEndpoint( ConnectWiseEndpoint, IPostable[WorkflowEvent, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "copy", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "copy", parent_endpoint=parent_endpoint) IPostable.__init__(self, WorkflowEvent) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowEvent: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowEvent: """ Performs a POST request against the /system/workflows/{id}/events/{id}/copy endpoint. @@ -32,7 +26,4 @@ def post( Returns: WorkflowEvent: The parsed response data. """ - return self._parse_one( - WorkflowEvent, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(WorkflowEvent, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdEndpoint.py index 675a98112..eec4bc021 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdEndpoint.py @@ -1,59 +1,42 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdActionsEndpoint import ( SystemWorkflowsIdEventsIdActionsEndpoint, ) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdCopyEndpoint import ( - SystemWorkflowsIdEventsIdCopyEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdTestEndpoint import ( - SystemWorkflowsIdEventsIdTestEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdCopyEndpoint import SystemWorkflowsIdEventsIdCopyEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdEventsIdTestEndpoint import SystemWorkflowsIdEventsIdTestEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WorkflowEvent from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdEventsIdEndpoint( ConnectWiseEndpoint, IGettable[WorkflowEvent, ConnectWiseManageRequestParams], - IPuttable[WorkflowEvent, ConnectWiseManageRequestParams], IPatchable[WorkflowEvent, ConnectWiseManageRequestParams], + IPuttable[WorkflowEvent, ConnectWiseManageRequestParams], IPaginateable[WorkflowEvent, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowEvent) - IPuttable.__init__(self, WorkflowEvent) IPatchable.__init__(self, WorkflowEvent) + IPuttable.__init__(self, WorkflowEvent) IPaginateable.__init__(self, WorkflowEvent) - self.copy = self._register_child_endpoint( - SystemWorkflowsIdEventsIdCopyEndpoint(client, parent_endpoint=self) - ) - self.test = self._register_child_endpoint( - SystemWorkflowsIdEventsIdTestEndpoint(client, parent_endpoint=self) - ) self.actions = self._register_child_endpoint( SystemWorkflowsIdEventsIdActionsEndpoint(client, parent_endpoint=self) ) + self.copy = self._register_child_endpoint(SystemWorkflowsIdEventsIdCopyEndpoint(client, parent_endpoint=self)) + self.test = self._register_child_endpoint(SystemWorkflowsIdEventsIdTestEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowEvent]: """ Performs a GET request against the /system/workflows/{id}/events/{id} endpoint and returns an initialized PaginatedResponse object. @@ -71,53 +54,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowEvent, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowEvent, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowEvent: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /system/workflows/{id}/events/{id} endpoint. + Performs a DELETE request against the /system/workflows/{id}/events/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WorkflowEvent: The parsed response data. """ - return self._parse_one( - WorkflowEvent, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowEvent: """ - Performs a DELETE request against the /system/workflows/{id}/events/{id} endpoint. + Performs a GET request against the /system/workflows/{id}/events/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WorkflowEvent: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(WorkflowEvent, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowEvent: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> WorkflowEvent: """ - Performs a PUT request against the /system/workflows/{id}/events/{id} endpoint. + Performs a PATCH request against the /system/workflows/{id}/events/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +89,11 @@ def put( Returns: WorkflowEvent: The parsed response data. """ - return self._parse_one( - WorkflowEvent, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(WorkflowEvent, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowEvent: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowEvent: """ - Performs a PATCH request against the /system/workflows/{id}/events/{id} endpoint. + Performs a PUT request against the /system/workflows/{id}/events/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,7 +101,4 @@ def patch( Returns: WorkflowEvent: The parsed response data. """ - return self._parse_one( - WorkflowEvent, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(WorkflowEvent, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdTestEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdTestEndpoint.py index e95628104..5783d8796 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdTestEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdEventsIdTestEndpoint.py @@ -1,8 +1,11 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemWorkflowsIdEventsIdTestEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "test", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "test", parent_endpoint=parent_endpoint) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesCountEndpoint.py index 765cdff7d..ca560eac9 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdNotifytypesCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdNotifytypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesEndpoint.py index 14fad9b82..2f7e9f371 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesEndpoint.py @@ -1,23 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesCountEndpoint import ( SystemWorkflowsIdNotifytypesCountEndpoint, ) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesIdEndpoint import ( - SystemWorkflowsIdNotifytypesIdEndpoint, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesIdEndpoint import SystemWorkflowsIdNotifytypesIdEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesInfoEndpoint import ( SystemWorkflowsIdNotifytypesInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowNotifyType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdNotifytypesEndpoint( @@ -25,10 +22,8 @@ class SystemWorkflowsIdNotifytypesEndpoint( IGettable[list[WorkflowNotifyType], ConnectWiseManageRequestParams], IPaginateable[WorkflowNotifyType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "notifyTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "notifyTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowNotifyType]) IPaginateable.__init__(self, WorkflowNotifyType) @@ -39,26 +34,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 SystemWorkflowsIdNotifytypesInfoEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemWorkflowsIdNotifytypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsIdNotifytypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsIdNotifytypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsIdNotifytypesIdEndpoint: The initialized SystemWorkflowsIdNotifytypesIdEndpoint object. """ - child = SystemWorkflowsIdNotifytypesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowsIdNotifytypesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowNotifyType]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes endpoint and returns an initialized PaginatedResponse object. @@ -76,18 +66,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowNotifyType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowNotifyType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowNotifyType]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes endpoint. @@ -98,7 +81,4 @@ def get( Returns: list[WorkflowNotifyType]: The parsed response data. """ - return self._parse_many( - WorkflowNotifyType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowNotifyType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdEndpoint.py index 4781294f0..2d3da2247 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesIdInfoEndpoint import ( SystemWorkflowsIdNotifytypesIdInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowNotifyType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdNotifytypesIdEndpoint( @@ -19,10 +18,8 @@ class SystemWorkflowsIdNotifytypesIdEndpoint( IGettable[WorkflowNotifyType, ConnectWiseManageRequestParams], IPaginateable[WorkflowNotifyType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowNotifyType) IPaginateable.__init__(self, WorkflowNotifyType) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowNotifyType]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +46,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowNotifyType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowNotifyType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowNotifyType: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowNotifyType: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/{id} endpoint. @@ -74,7 +59,4 @@ def get( Returns: WorkflowNotifyType: The parsed response data. """ - return self._parse_one( - WorkflowNotifyType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(WorkflowNotifyType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdInfoEndpoint.py index 2140d53dd..93993860f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowNotifyTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdNotifytypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdNotifytypesIdInfoEndpoint( IGettable[WorkflowNotifyTypeInfo, ConnectWiseManageRequestParams], IPaginateable[WorkflowNotifyTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowNotifyTypeInfo) IPaginateable.__init__(self, WorkflowNotifyTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowNotifyTypeInfo]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowNotifyTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowNotifyTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowNotifyTypeInfo: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: WorkflowNotifyTypeInfo: The parsed response data. """ - return self._parse_one( - WorkflowNotifyTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(WorkflowNotifyTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoCountEndpoint.py index b0507919e..fda78dd8e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdNotifytypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdNotifytypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoEndpoint.py index 85c041194..a9d6434c4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdNotifytypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdNotifytypesInfoCountEndpoint import ( SystemWorkflowsIdNotifytypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowNotifyTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdNotifytypesInfoEndpoint( @@ -19,10 +18,8 @@ class SystemWorkflowsIdNotifytypesInfoEndpoint( IGettable[list[WorkflowNotifyTypeInfo], ConnectWiseManageRequestParams], IPaginateable[WorkflowNotifyTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowNotifyTypeInfo]) IPaginateable.__init__(self, WorkflowNotifyTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowNotifyTypeInfo]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowNotifyTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowNotifyTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowNotifyTypeInfo]: """ Performs a GET request against the /system/workflows/{id}/notifyTypes/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[WorkflowNotifyTypeInfo]: The parsed response data. """ - return self._parse_many( - WorkflowNotifyTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowNotifyTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersCountEndpoint.py index 270617a2a..5b63b91d3 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdTriggersCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdTriggersCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/{id}/triggers/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/{id}/triggers/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersEndpoint.py index 704ba7fbe..7b832f94d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersCountEndpoint import ( - SystemWorkflowsIdTriggersCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersIdEndpoint import ( - SystemWorkflowsIdTriggersIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersCountEndpoint import SystemWorkflowsIdTriggersCountEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersIdEndpoint import SystemWorkflowsIdTriggersIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowTrigger from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdTriggersEndpoint( @@ -22,35 +17,28 @@ class SystemWorkflowsIdTriggersEndpoint( IGettable[list[WorkflowTrigger], ConnectWiseManageRequestParams], IPaginateable[WorkflowTrigger, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "triggers", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "triggers", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowTrigger]) IPaginateable.__init__(self, WorkflowTrigger) - self.count = self._register_child_endpoint( - SystemWorkflowsIdTriggersCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemWorkflowsIdTriggersCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemWorkflowsIdTriggersIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsIdTriggersIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsIdTriggersIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsIdTriggersIdEndpoint: The initialized SystemWorkflowsIdTriggersIdEndpoint object. """ child = SystemWorkflowsIdTriggersIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowTrigger]: """ Performs a GET request against the /system/workflows/{id}/triggers endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowTrigger, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowTrigger, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowTrigger]: """ Performs a GET request against the /system/workflows/{id}/triggers endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[WorkflowTrigger]: The parsed response data. """ - return self._parse_many( - WorkflowTrigger, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowTrigger, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdEndpoint.py index fcb122b01..ce68f258d 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdEndpoint.py @@ -1,14 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersIdOptionsEndpoint import ( SystemWorkflowsIdTriggersIdOptionsEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemWorkflowsIdTriggersIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) self.options = self._register_child_endpoint( SystemWorkflowsIdTriggersIdOptionsEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsCountEndpoint.py index 9d969e35d..7e07ef48e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdTriggersIdOptionsCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsIdTriggersIdOptionsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/{id}/triggers/{id}/options/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/{id}/triggers/{id}/options/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsEndpoint.py index f50c0a1bd..28f9e1249 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsIdTriggersIdOptionsEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsIdTriggersIdOptionsCountEndpoint import ( SystemWorkflowsIdTriggersIdOptionsCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowTriggerOption from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsIdTriggersIdOptionsEndpoint( @@ -19,24 +18,17 @@ class SystemWorkflowsIdTriggersIdOptionsEndpoint( IGettable[list[WorkflowTriggerOption], ConnectWiseManageRequestParams], IPaginateable[WorkflowTriggerOption, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "options", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "options", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowTriggerOption]) IPaginateable.__init__(self, WorkflowTriggerOption) self.count = self._register_child_endpoint( - SystemWorkflowsIdTriggersIdOptionsCountEndpoint( - client, parent_endpoint=self - ) + SystemWorkflowsIdTriggersIdOptionsCountEndpoint(client, parent_endpoint=self) ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowTriggerOption]: """ Performs a GET request against the /system/workflows/{id}/triggers/{id}/options endpoint and returns an initialized PaginatedResponse object. @@ -54,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowTriggerOption, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowTriggerOption, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowTriggerOption]: """ Performs a GET request against the /system/workflows/{id}/triggers/{id}/options endpoint. @@ -76,7 +61,4 @@ def get( Returns: list[WorkflowTriggerOption]: The parsed response data. """ - return self._parse_many( - WorkflowTriggerOption, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowTriggerOption, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesCountEndpoint.py index b582118d2..00cb33931 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsTabletypesCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsTabletypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/tableTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/tableTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesEndpoint.py index 54a9c90d0..9be99c63f 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesEndpoint.py @@ -1,23 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesCountEndpoint import ( - SystemWorkflowsTabletypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesIdEndpoint import ( - SystemWorkflowsTabletypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesInfoEndpoint import ( - SystemWorkflowsTabletypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesCountEndpoint import SystemWorkflowsTabletypesCountEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesIdEndpoint import SystemWorkflowsTabletypesIdEndpoint +from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesInfoEndpoint import SystemWorkflowsTabletypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowTableType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsTabletypesEndpoint( @@ -25,38 +18,29 @@ class SystemWorkflowsTabletypesEndpoint( IGettable[list[WorkflowTableType], ConnectWiseManageRequestParams], IPaginateable[WorkflowTableType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "tableTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "tableTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowTableType]) IPaginateable.__init__(self, WorkflowTableType) - self.count = self._register_child_endpoint( - SystemWorkflowsTabletypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - SystemWorkflowsTabletypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(SystemWorkflowsTabletypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(SystemWorkflowsTabletypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> SystemWorkflowsTabletypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsTabletypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsTabletypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsTabletypesIdEndpoint: The initialized SystemWorkflowsTabletypesIdEndpoint object. """ child = SystemWorkflowsTabletypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowTableType]: """ Performs a GET request against the /system/workflows/tableTypes endpoint and returns an initialized PaginatedResponse object. @@ -74,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowTableType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowTableType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowTableType]: """ Performs a GET request against the /system/workflows/tableTypes endpoint. @@ -96,7 +73,4 @@ def get( Returns: list[WorkflowTableType]: The parsed response data. """ - return self._parse_many( - WorkflowTableType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowTableType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdEndpoint.py index 97626c1de..e4b97d5fa 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesIdInfoEndpoint import ( SystemWorkflowsTabletypesIdInfoEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowTableType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsTabletypesIdEndpoint( @@ -19,22 +18,15 @@ class SystemWorkflowsTabletypesIdEndpoint( IGettable[WorkflowTableType, ConnectWiseManageRequestParams], IPaginateable[WorkflowTableType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowTableType) IPaginateable.__init__(self, WorkflowTableType) - self.info = self._register_child_endpoint( - SystemWorkflowsTabletypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(SystemWorkflowsTabletypesIdInfoEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowTableType]: """ Performs a GET request against the /system/workflows/tableTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +44,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowTableType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowTableType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkflowTableType: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkflowTableType: """ Performs a GET request against the /system/workflows/tableTypes/{id} endpoint. @@ -74,7 +57,4 @@ def get( Returns: WorkflowTableType: The parsed response data. """ - return self._parse_one( - WorkflowTableType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(WorkflowTableType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdInfoEndpoint.py index aacf4f8da..b48a18d3b 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowTableTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsTabletypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsTabletypesIdInfoEndpoint( IGettable[WorkflowTableTypeInfo, ConnectWiseManageRequestParams], IPaginateable[WorkflowTableTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkflowTableTypeInfo) IPaginateable.__init__(self, WorkflowTableTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowTableTypeInfo]: """ Performs a GET request against the /system/workflows/tableTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowTableTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowTableTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowTableTypeInfo: """ Performs a GET request against the /system/workflows/tableTypes/{id}/info endpoint. @@ -67,7 +54,4 @@ def get( Returns: WorkflowTableTypeInfo: The parsed response data. """ - return self._parse_one( - WorkflowTableTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(WorkflowTableTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoCountEndpoint.py index cc6f4df43..578a60baf 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsTabletypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsTabletypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /system/workflows/tableTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /system/workflows/tableTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoEndpoint.py index 36811fcb1..787999a87 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsTabletypesInfoEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsTabletypesInfoCountEndpoint import ( SystemWorkflowsTabletypesInfoCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowTableTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsTabletypesInfoEndpoint( @@ -19,10 +18,8 @@ class SystemWorkflowsTabletypesInfoEndpoint( IGettable[list[WorkflowTableTypeInfo], ConnectWiseManageRequestParams], IPaginateable[WorkflowTableTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowTableTypeInfo]) IPaginateable.__init__(self, WorkflowTableTypeInfo) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowTableTypeInfo]: """ Performs a GET request against the /system/workflows/tableTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowTableTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowTableTypeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowTableTypeInfo]: """ Performs a GET request against the /system/workflows/tableTypes/info endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[WorkflowTableTypeInfo]: The parsed response data. """ - return self._parse_many( - WorkflowTableTypeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkflowTableTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsEndpoint.py index c3c6d77d8..0813bb6a4 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsEndpoint.py @@ -1,28 +1,27 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsUserdefinedfieldsActionsIdEndpoint import ( SystemWorkflowsUserdefinedfieldsActionsIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemWorkflowsUserdefinedfieldsActionsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "actions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "actions", parent_endpoint=parent_endpoint) - def id( - self, id: int # noqa: A002 - ) -> SystemWorkflowsUserdefinedfieldsActionsIdEndpoint: + def id(self, _id: int) -> SystemWorkflowsUserdefinedfieldsActionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsUserdefinedfieldsActionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsUserdefinedfieldsActionsIdEndpoint: The initialized SystemWorkflowsUserdefinedfieldsActionsIdEndpoint object. """ - child = SystemWorkflowsUserdefinedfieldsActionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowsUserdefinedfieldsActionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsIdEndpoint.py index ba9472846..1b24202c6 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsActionsIdEndpoint.py @@ -1,21 +1,17 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsUserdefinedfieldsActionsIdEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ Performs a DELETE request against the /system/workflows/userdefinedfields/actions/{id} endpoint. diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEndpoint.py index 6db2455e6..dcc195a1e 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsUserdefinedfieldsActionsEndpoint import ( SystemWorkflowsUserdefinedfieldsActionsEndpoint, @@ -9,33 +11,30 @@ SystemWorkflowsUserdefinedfieldsIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemWorkflowsUserdefinedfieldsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "userdefinedfields", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "userdefinedfields", parent_endpoint=parent_endpoint) self.actions = self._register_child_endpoint( - SystemWorkflowsUserdefinedfieldsActionsEndpoint( - client, parent_endpoint=self - ) + SystemWorkflowsUserdefinedfieldsActionsEndpoint(client, parent_endpoint=self) ) self.events = self._register_child_endpoint( SystemWorkflowsUserdefinedfieldsEventsEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> SystemWorkflowsUserdefinedfieldsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> SystemWorkflowsUserdefinedfieldsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsUserdefinedfieldsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsUserdefinedfieldsIdEndpoint: The initialized SystemWorkflowsUserdefinedfieldsIdEndpoint object. """ - child = SystemWorkflowsUserdefinedfieldsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowsUserdefinedfieldsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsEndpoint.py index 1f6664218..949b1ab66 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsEndpoint.py @@ -1,28 +1,27 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsUserdefinedfieldsEventsIdEndpoint import ( SystemWorkflowsUserdefinedfieldsEventsIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemWorkflowsUserdefinedfieldsEventsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "events", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "events", parent_endpoint=parent_endpoint) - def id( - self, id: int # noqa: A002 - ) -> SystemWorkflowsUserdefinedfieldsEventsIdEndpoint: + def id(self, _id: int) -> SystemWorkflowsUserdefinedfieldsEventsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsUserdefinedfieldsEventsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsUserdefinedfieldsEventsIdEndpoint: The initialized SystemWorkflowsUserdefinedfieldsEventsIdEndpoint object. """ - child = SystemWorkflowsUserdefinedfieldsEventsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowsUserdefinedfieldsEventsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint.py index a0e1c2dbc..779e7835c 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint.py @@ -1,28 +1,27 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint import ( SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint, ) +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "actions", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "actions", parent_endpoint=parent_endpoint) - def id( - self, id: int # noqa: A002 - ) -> SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint: + def id(self, _id: int) -> SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint: The initialized SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint object. """ - child = SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint.py index 10bb313aa..d212b1e48 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkflowActionUserDefinedField from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint( @@ -16,18 +15,13 @@ class SystemWorkflowsUserdefinedfieldsEventsIdActionsIdEndpoint( IGettable[list[WorkflowActionUserDefinedField], ConnectWiseManageRequestParams], IPaginateable[WorkflowActionUserDefinedField, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkflowActionUserDefinedField]) IPaginateable.__init__(self, WorkflowActionUserDefinedField) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkflowActionUserDefinedField]: """ Performs a GET request against the /system/workflows/userdefinedfields/events/{id}/actions/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkflowActionUserDefinedField, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkflowActionUserDefinedField, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkflowActionUserDefinedField]: """ Performs a GET request against the /system/workflows/userdefinedfields/events/{id}/actions/{id} endpoint. @@ -68,6 +55,5 @@ def get( list[WorkflowActionUserDefinedField]: The parsed response data. """ return self._parse_many( - WorkflowActionUserDefinedField, - super()._make_request("GET", data=data, params=params).json(), + WorkflowActionUserDefinedField, super()._make_request("GET", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdEndpoint.py index 74d47069d..02cc3f6fa 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsEventsIdEndpoint.py @@ -1,37 +1,30 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint import ( SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint, ) -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import WorkflowActionUserDefinedField -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsUserdefinedfieldsEventsIdEndpoint( - ConnectWiseEndpoint, - IPostable[WorkflowActionUserDefinedField, ConnectWiseManageRequestParams], + ConnectWiseEndpoint, IPostable[WorkflowActionUserDefinedField, ConnectWiseManageRequestParams] ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPostable.__init__(self, WorkflowActionUserDefinedField) self.actions = self._register_child_endpoint( - SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint( - client, parent_endpoint=self - ) + SystemWorkflowsUserdefinedfieldsEventsIdActionsEndpoint(client, parent_endpoint=self) ) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowActionUserDefinedField: """ Performs a POST request against the /system/workflows/userdefinedfields/events/{id} endpoint. @@ -43,6 +36,5 @@ def post( WorkflowActionUserDefinedField: The parsed response data. """ return self._parse_one( - WorkflowActionUserDefinedField, - super()._make_request("POST", data=data, params=params).json(), + WorkflowActionUserDefinedField, super()._make_request("POST", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsIdEndpoint.py index 9904ab59e..5834d7a50 100644 --- a/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/SystemWorkflowsUserdefinedfieldsIdEndpoint.py @@ -1,35 +1,29 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IPatchable, IPuttable from pyconnectwise.models.manage import WorkflowActionUserDefinedField -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class SystemWorkflowsUserdefinedfieldsIdEndpoint( ConnectWiseEndpoint, - IPuttable[WorkflowActionUserDefinedField, ConnectWiseManageRequestParams], IPatchable[WorkflowActionUserDefinedField, ConnectWiseManageRequestParams], + IPuttable[WorkflowActionUserDefinedField, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) - IPuttable.__init__(self, WorkflowActionUserDefinedField) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IPatchable.__init__(self, WorkflowActionUserDefinedField) + IPuttable.__init__(self, WorkflowActionUserDefinedField) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowActionUserDefinedField: """ - Performs a PUT request against the /system/workflows/userdefinedfields/{id} endpoint. + Performs a PATCH request against the /system/workflows/userdefinedfields/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -38,17 +32,14 @@ def put( WorkflowActionUserDefinedField: The parsed response data. """ return self._parse_one( - WorkflowActionUserDefinedField, - super()._make_request("PUT", data=data, params=params).json(), + WorkflowActionUserDefinedField, super()._make_request("PATCH", data=data, params=params).json() ) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> WorkflowActionUserDefinedField: """ - Performs a PATCH request against the /system/workflows/userdefinedfields/{id} endpoint. + Performs a PUT request against the /system/workflows/userdefinedfields/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -57,6 +48,5 @@ def patch( WorkflowActionUserDefinedField: The parsed response data. """ return self._parse_one( - WorkflowActionUserDefinedField, - super()._make_request("PATCH", data=data, params=params).json(), + WorkflowActionUserDefinedField, super()._make_request("PUT", data=data, params=params).json() ) diff --git a/src/pyconnectwise/endpoints/manage/TimeAccrualsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeAccrualsCountEndpoint.py index 645ed1c43..aca16c32c 100644 --- a/src/pyconnectwise/endpoints/manage/TimeAccrualsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeAccrualsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeAccrualsCountEndpoint( @@ -16,18 +15,13 @@ class TimeAccrualsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/accruals/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/accruals/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeAccrualsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeAccrualsEndpoint.py index 791e94259..0336ae019 100644 --- a/src/pyconnectwise/endpoints/manage/TimeAccrualsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeAccrualsEndpoint.py @@ -1,19 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeAccrualsCountEndpoint import ( - TimeAccrualsCountEndpoint, -) +from pyconnectwise.endpoints.manage.TimeAccrualsCountEndpoint import TimeAccrualsCountEndpoint from pyconnectwise.endpoints.manage.TimeAccrualsIdEndpoint import TimeAccrualsIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TimeAccrual from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeAccrualsEndpoint( @@ -22,36 +18,29 @@ class TimeAccrualsEndpoint( IPostable[TimeAccrual, ConnectWiseManageRequestParams], IPaginateable[TimeAccrual, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "accruals", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "accruals", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeAccrual]) IPostable.__init__(self, TimeAccrual) IPaginateable.__init__(self, TimeAccrual) - self.count = self._register_child_endpoint( - TimeAccrualsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeAccrualsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeAccrualsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeAccrualsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeAccrualsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeAccrualsIdEndpoint: The initialized TimeAccrualsIdEndpoint object. """ child = TimeAccrualsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeAccrual]: """ Performs a GET request against the /time/accruals endpoint and returns an initialized PaginatedResponse object. @@ -69,19 +58,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeAccrual, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeAccrual, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TimeAccrual]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TimeAccrual]: """ Performs a GET request against the /time/accruals endpoint. @@ -91,15 +71,9 @@ def get( Returns: list[TimeAccrual]: The parsed response data. """ - return self._parse_many( - TimeAccrual, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TimeAccrual, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeAccrual: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeAccrual: """ Performs a POST request against the /time/accruals endpoint. @@ -109,6 +83,4 @@ def post( Returns: TimeAccrual: The parsed response data. """ - return self._parse_one( - TimeAccrual, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TimeAccrual, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsCountEndpoint.py index c1d2cf061..662828bc0 100644 --- a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeAccrualsIdDetailsCountEndpoint( @@ -16,18 +15,13 @@ class TimeAccrualsIdDetailsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/accruals/{id}/details/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/accruals/{id}/details/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsEndpoint.py index f448b7858..880f1d07e 100644 --- a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeAccrualsIdDetailsCountEndpoint import ( - TimeAccrualsIdDetailsCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeAccrualsIdDetailsIdEndpoint import ( - TimeAccrualsIdDetailsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeAccrualsIdDetailsCountEndpoint import TimeAccrualsIdDetailsCountEndpoint +from pyconnectwise.endpoints.manage.TimeAccrualsIdDetailsIdEndpoint import TimeAccrualsIdDetailsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeAccrualDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeAccrualsIdDetailsEndpoint( @@ -22,35 +17,28 @@ class TimeAccrualsIdDetailsEndpoint( IGettable[list[TimeAccrualDetail], ConnectWiseManageRequestParams], IPaginateable[TimeAccrualDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "details", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "details", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeAccrualDetail]) IPaginateable.__init__(self, TimeAccrualDetail) - self.count = self._register_child_endpoint( - TimeAccrualsIdDetailsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeAccrualsIdDetailsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeAccrualsIdDetailsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeAccrualsIdDetailsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeAccrualsIdDetailsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeAccrualsIdDetailsIdEndpoint: The initialized TimeAccrualsIdDetailsIdEndpoint object. """ child = TimeAccrualsIdDetailsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeAccrualDetail]: """ Performs a GET request against the /time/accruals/{id}/details endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeAccrualDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeAccrualDetail, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimeAccrualDetail]: """ Performs a GET request against the /time/accruals/{id}/details endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[TimeAccrualDetail]: The parsed response data. """ - return self._parse_many( - TimeAccrualDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TimeAccrualDetail, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsIdEndpoint.py index f5a449909..83e4cfde6 100644 --- a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdDetailsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TimeAccrualDetail from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeAccrualsIdDetailsIdEndpoint( ConnectWiseEndpoint, IGettable[TimeAccrualDetail, ConnectWiseManageRequestParams], - IPuttable[TimeAccrualDetail, ConnectWiseManageRequestParams], IPatchable[TimeAccrualDetail, ConnectWiseManageRequestParams], + IPuttable[TimeAccrualDetail, ConnectWiseManageRequestParams], IPaginateable[TimeAccrualDetail, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeAccrualDetail) - IPuttable.__init__(self, TimeAccrualDetail) IPatchable.__init__(self, TimeAccrualDetail) + IPuttable.__init__(self, TimeAccrualDetail) IPaginateable.__init__(self, TimeAccrualDetail) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeAccrualDetail]: """ Performs a GET request against the /time/accruals/{id}/details/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeAccrualDetail, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeAccrualDetail, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeAccrualDetail: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/accruals/{id}/details/{id} endpoint. + Performs a DELETE request against the /time/accruals/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TimeAccrualDetail: The parsed response data. """ - return self._parse_one( - TimeAccrualDetail, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeAccrualDetail: """ - Performs a DELETE request against the /time/accruals/{id}/details/{id} endpoint. + Performs a GET request against the /time/accruals/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TimeAccrualDetail: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TimeAccrualDetail, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeAccrualDetail: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TimeAccrualDetail: """ - Performs a PUT request against the /time/accruals/{id}/details/{id} endpoint. + Performs a PATCH request against the /time/accruals/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: TimeAccrualDetail: The parsed response data. """ - return self._parse_one( - TimeAccrualDetail, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TimeAccrualDetail, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeAccrualDetail: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeAccrualDetail: """ - Performs a PATCH request against the /time/accruals/{id}/details/{id} endpoint. + Performs a PUT request against the /time/accruals/{id}/details/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: TimeAccrualDetail: The parsed response data. """ - return self._parse_one( - TimeAccrualDetail, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TimeAccrualDetail, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdEndpoint.py index 938ff77c0..ad7a71bdd 100644 --- a/src/pyconnectwise/endpoints/manage/TimeAccrualsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeAccrualsIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeAccrualsIdDetailsEndpoint import ( - TimeAccrualsIdDetailsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.TimeAccrualsIdDetailsEndpoint import TimeAccrualsIdDetailsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TimeAccrual from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeAccrualsIdEndpoint( ConnectWiseEndpoint, IGettable[TimeAccrual, ConnectWiseManageRequestParams], - IPuttable[TimeAccrual, ConnectWiseManageRequestParams], IPatchable[TimeAccrual, ConnectWiseManageRequestParams], + IPuttable[TimeAccrual, ConnectWiseManageRequestParams], IPaginateable[TimeAccrual, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeAccrual) - IPuttable.__init__(self, TimeAccrual) IPatchable.__init__(self, TimeAccrual) + IPuttable.__init__(self, TimeAccrual) IPaginateable.__init__(self, TimeAccrual) - self.details = self._register_child_endpoint( - TimeAccrualsIdDetailsEndpoint(client, parent_endpoint=self) - ) + self.details = self._register_child_endpoint(TimeAccrualsIdDetailsEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeAccrual]: """ Performs a GET request against the /time/accruals/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,53 +46,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeAccrual, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeAccrual, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeAccrual: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/accruals/{id} endpoint. + Performs a DELETE request against the /time/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TimeAccrual: The parsed response data. """ - return self._parse_one( - TimeAccrual, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeAccrual: """ - Performs a DELETE request against the /time/accruals/{id} endpoint. + Performs a GET request against the /time/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TimeAccrual: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TimeAccrual, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeAccrual: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TimeAccrual: """ - Performs a PUT request against the /time/accruals/{id} endpoint. + Performs a PATCH request against the /time/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +81,11 @@ def put( Returns: TimeAccrual: The parsed response data. """ - return self._parse_one( - TimeAccrual, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TimeAccrual, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeAccrual: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeAccrual: """ - Performs a PATCH request against the /time/accruals/{id} endpoint. + Performs a PUT request against the /time/accruals/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +93,4 @@ def patch( Returns: TimeAccrual: The parsed response data. """ - return self._parse_one( - TimeAccrual, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TimeAccrual, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesCountEndpoint.py index bd1e467c6..aec85056e 100644 --- a/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeActivitystopwatchesCountEndpoint( @@ -16,18 +15,13 @@ class TimeActivitystopwatchesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/activitystopwatches/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/activitystopwatches/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesEndpoint.py index 515d5100e..6f8b6e0f2 100644 --- a/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeActivitystopwatchesCountEndpoint import ( - TimeActivitystopwatchesCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeActivitystopwatchesIdEndpoint import ( - TimeActivitystopwatchesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeActivitystopwatchesCountEndpoint import TimeActivitystopwatchesCountEndpoint +from pyconnectwise.endpoints.manage.TimeActivitystopwatchesIdEndpoint import TimeActivitystopwatchesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ActivityStopwatch from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeActivitystopwatchesEndpoint( @@ -24,36 +18,29 @@ class TimeActivitystopwatchesEndpoint( IPostable[ActivityStopwatch, ConnectWiseManageRequestParams], IPaginateable[ActivityStopwatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "activitystopwatches", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "activitystopwatches", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ActivityStopwatch]) IPostable.__init__(self, ActivityStopwatch) IPaginateable.__init__(self, ActivityStopwatch) - self.count = self._register_child_endpoint( - TimeActivitystopwatchesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeActivitystopwatchesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeActivitystopwatchesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeActivitystopwatchesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeActivitystopwatchesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeActivitystopwatchesIdEndpoint: The initialized TimeActivitystopwatchesIdEndpoint object. """ child = TimeActivitystopwatchesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityStopwatch]: """ Performs a GET request against the /time/activitystopwatches endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityStopwatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityStopwatch, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ActivityStopwatch]: """ Performs a GET request against the /time/activitystopwatches endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[ActivityStopwatch]: The parsed response data. """ - return self._parse_many( - ActivityStopwatch, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ActivityStopwatch, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStopwatch: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityStopwatch: """ Performs a POST request against the /time/activitystopwatches endpoint. @@ -112,7 +85,4 @@ def post( Returns: ActivityStopwatch: The parsed response data. """ - return self._parse_one( - ActivityStopwatch, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ActivityStopwatch, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesIdEndpoint.py index 82e27a967..fe15b4e8a 100644 --- a/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeActivitystopwatchesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ActivityStopwatch from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeActivitystopwatchesIdEndpoint( ConnectWiseEndpoint, IGettable[ActivityStopwatch, ConnectWiseManageRequestParams], - IPuttable[ActivityStopwatch, ConnectWiseManageRequestParams], IPatchable[ActivityStopwatch, ConnectWiseManageRequestParams], + IPuttable[ActivityStopwatch, ConnectWiseManageRequestParams], IPaginateable[ActivityStopwatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ActivityStopwatch) - IPuttable.__init__(self, ActivityStopwatch) IPatchable.__init__(self, ActivityStopwatch) + IPuttable.__init__(self, ActivityStopwatch) IPaginateable.__init__(self, ActivityStopwatch) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ActivityStopwatch]: """ Performs a GET request against the /time/activitystopwatches/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ActivityStopwatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ActivityStopwatch, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStopwatch: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/activitystopwatches/{id} endpoint. + Performs a DELETE request against the /time/activitystopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ActivityStopwatch: The parsed response data. """ - return self._parse_one( - ActivityStopwatch, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityStopwatch: """ - Performs a DELETE request against the /time/activitystopwatches/{id} endpoint. + Performs a GET request against the /time/activitystopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ActivityStopwatch: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ActivityStopwatch, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStopwatch: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ActivityStopwatch: """ - Performs a PUT request against the /time/activitystopwatches/{id} endpoint. + Performs a PATCH request against the /time/activitystopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: ActivityStopwatch: The parsed response data. """ - return self._parse_one( - ActivityStopwatch, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ActivityStopwatch, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ActivityStopwatch: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ActivityStopwatch: """ - Performs a PATCH request against the /time/activitystopwatches/{id} endpoint. + Performs a PUT request against the /time/activitystopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: ActivityStopwatch: The parsed response data. """ - return self._parse_one( - ActivityStopwatch, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ActivityStopwatch, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesCountEndpoint.py index 2851fbf61..3f386d787 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesCountEndpoint( @@ -16,18 +15,13 @@ class TimeChargecodesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/chargeCodes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/chargeCodes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesEndpoint.py index 8aee1f8da..afdbde866 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeChargecodesCountEndpoint import ( - TimeChargecodesCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeChargecodesIdEndpoint import ( - TimeChargecodesIdEndpoint, -) -from pyconnectwise.endpoints.manage.TimeChargecodesInfoEndpoint import ( - TimeChargecodesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeChargecodesCountEndpoint import TimeChargecodesCountEndpoint +from pyconnectwise.endpoints.manage.TimeChargecodesIdEndpoint import TimeChargecodesIdEndpoint +from pyconnectwise.endpoints.manage.TimeChargecodesInfoEndpoint import TimeChargecodesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ChargeCode from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesEndpoint( @@ -27,39 +19,30 @@ class TimeChargecodesEndpoint( IPostable[ChargeCode, ConnectWiseManageRequestParams], IPaginateable[ChargeCode, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "chargeCodes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "chargeCodes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ChargeCode]) IPostable.__init__(self, ChargeCode) IPaginateable.__init__(self, ChargeCode) - self.count = self._register_child_endpoint( - TimeChargecodesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - TimeChargecodesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeChargecodesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(TimeChargecodesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeChargecodesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeChargecodesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeChargecodesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeChargecodesIdEndpoint: The initialized TimeChargecodesIdEndpoint object. """ child = TimeChargecodesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ChargeCode]: """ Performs a GET request against the /time/chargeCodes endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ChargeCode, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ChargeCode, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[ChargeCode]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[ChargeCode]: """ Performs a GET request against the /time/chargeCodes endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[ChargeCode]: The parsed response data. """ - return self._parse_many( - ChargeCode, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(ChargeCode, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ChargeCode: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ChargeCode: """ Performs a POST request against the /time/chargeCodes endpoint. @@ -117,6 +83,4 @@ def post( Returns: ChargeCode: The parsed response data. """ - return self._parse_one( - ChargeCode, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(ChargeCode, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdEndpoint.py index f98b96a3f..12a30ba9a 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdEndpoint.py @@ -1,59 +1,40 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeChargecodesIdExpensetypesEndpoint import ( - TimeChargecodesIdExpensetypesEndpoint, -) -from pyconnectwise.endpoints.manage.TimeChargecodesIdInfoEndpoint import ( - TimeChargecodesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.TimeChargecodesIdUsagesEndpoint import ( - TimeChargecodesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.TimeChargecodesIdExpensetypesEndpoint import TimeChargecodesIdExpensetypesEndpoint +from pyconnectwise.endpoints.manage.TimeChargecodesIdInfoEndpoint import TimeChargecodesIdInfoEndpoint +from pyconnectwise.endpoints.manage.TimeChargecodesIdUsagesEndpoint import TimeChargecodesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ChargeCode from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesIdEndpoint( ConnectWiseEndpoint, IGettable[ChargeCode, ConnectWiseManageRequestParams], - IPuttable[ChargeCode, ConnectWiseManageRequestParams], IPatchable[ChargeCode, ConnectWiseManageRequestParams], + IPuttable[ChargeCode, ConnectWiseManageRequestParams], IPaginateable[ChargeCode, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ChargeCode) - IPuttable.__init__(self, ChargeCode) IPatchable.__init__(self, ChargeCode) + IPuttable.__init__(self, ChargeCode) IPaginateable.__init__(self, ChargeCode) - self.usages = self._register_child_endpoint( - TimeChargecodesIdUsagesEndpoint(client, parent_endpoint=self) - ) self.expense_types = self._register_child_endpoint( TimeChargecodesIdExpensetypesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - TimeChargecodesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(TimeChargecodesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(TimeChargecodesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ChargeCode]: """ Performs a GET request against the /time/chargeCodes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -70,54 +51,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - ChargeCode, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), ChargeCode, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ChargeCode: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/chargeCodes/{id} endpoint. + Performs a DELETE request against the /time/chargeCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ChargeCode: The parsed response data. """ - return self._parse_one( - ChargeCode, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ChargeCode: """ - Performs a DELETE request against the /time/chargeCodes/{id} endpoint. + Performs a GET request against the /time/chargeCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ChargeCode: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ChargeCode, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ChargeCode: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ChargeCode: """ - Performs a PUT request against the /time/chargeCodes/{id} endpoint. + Performs a PATCH request against the /time/chargeCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +85,11 @@ def put( Returns: ChargeCode: The parsed response data. """ - return self._parse_one( - ChargeCode, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(ChargeCode, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ChargeCode: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ChargeCode: """ - Performs a PATCH request against the /time/chargeCodes/{id} endpoint. + Performs a PUT request against the /time/chargeCodes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,6 +97,4 @@ def patch( Returns: ChargeCode: The parsed response data. """ - return self._parse_one( - ChargeCode, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(ChargeCode, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesCountEndpoint.py index 895986f00..61abce712 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesIdExpensetypesCountEndpoint( @@ -16,18 +15,13 @@ class TimeChargecodesIdExpensetypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/chargeCodes/{id}/expenseTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/chargeCodes/{id}/expenseTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesEndpoint.py index e06442194..02eb53cbd 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.TimeChargecodesIdExpensetypesCountEndpoint import ( TimeChargecodesIdExpensetypesCountEndpoint, @@ -5,17 +7,13 @@ from pyconnectwise.endpoints.manage.TimeChargecodesIdExpensetypesIdEndpoint import ( TimeChargecodesIdExpensetypesIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ChargeCodeExpenseType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesIdExpensetypesEndpoint( @@ -24,10 +22,8 @@ class TimeChargecodesIdExpensetypesEndpoint( IPostable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], IPaginateable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "expenseTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "expenseTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ChargeCodeExpenseType]) IPostable.__init__(self, ChargeCodeExpenseType) IPaginateable.__init__(self, ChargeCodeExpenseType) @@ -36,26 +32,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 TimeChargecodesIdExpensetypesCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> TimeChargecodesIdExpensetypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeChargecodesIdExpensetypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeChargecodesIdExpensetypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeChargecodesIdExpensetypesIdEndpoint: The initialized TimeChargecodesIdExpensetypesIdEndpoint object. """ - child = TimeChargecodesIdExpensetypesIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = TimeChargecodesIdExpensetypesIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ChargeCodeExpenseType]: """ Performs a GET request against the /time/chargeCodes/{id}/expenseTypes endpoint and returns an initialized PaginatedResponse object. @@ -73,18 +64,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ChargeCodeExpenseType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ChargeCodeExpenseType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ChargeCodeExpenseType]: """ Performs a GET request against the /time/chargeCodes/{id}/expenseTypes endpoint. @@ -95,15 +79,10 @@ def get( Returns: list[ChargeCodeExpenseType]: The parsed response data. """ - return self._parse_many( - ChargeCodeExpenseType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ChargeCodeExpenseType, super()._make_request("GET", data=data, params=params).json()) def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ChargeCodeExpenseType: """ Performs a POST request against the /time/chargeCodes/{id}/expenseTypes endpoint. @@ -114,7 +93,4 @@ def post( Returns: ChargeCodeExpenseType: The parsed response data. """ - return self._parse_one( - ChargeCodeExpenseType, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ChargeCodeExpenseType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesIdEndpoint.py index 159f51700..269fa3727 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdExpensetypesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ChargeCodeExpenseType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesIdExpensetypesIdEndpoint( ConnectWiseEndpoint, IGettable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], - IPuttable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], IPatchable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], + IPuttable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], IPaginateable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ChargeCodeExpenseType) - IPuttable.__init__(self, ChargeCodeExpenseType) IPatchable.__init__(self, ChargeCodeExpenseType) + IPuttable.__init__(self, ChargeCodeExpenseType) IPaginateable.__init__(self, ChargeCodeExpenseType) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ChargeCodeExpenseType]: """ Performs a GET request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,38 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ChargeCodeExpenseType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ChargeCodeExpenseType, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ChargeCodeExpenseType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. + Performs a DELETE request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ChargeCodeExpenseType: The parsed response data. """ - return self._parse_one( - ChargeCodeExpenseType, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None + ) -> ChargeCodeExpenseType: """ - Performs a DELETE request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. + Performs a GET request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ChargeCodeExpenseType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ChargeCodeExpenseType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + def patch( + self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None ) -> ChargeCodeExpenseType: """ - Performs a PUT request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. + Performs a PATCH request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +82,13 @@ def put( Returns: ChargeCodeExpenseType: The parsed response data. """ - return self._parse_one( - ChargeCodeExpenseType, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ChargeCodeExpenseType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, + def put( + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> ChargeCodeExpenseType: """ - Performs a PATCH request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. + Performs a PUT request against the /time/chargeCodes/{id}/expenseTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +96,4 @@ def patch( Returns: ChargeCodeExpenseType: The parsed response data. """ - return self._parse_one( - ChargeCodeExpenseType, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ChargeCodeExpenseType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdInfoEndpoint.py index 688aef299..1f6178cb8 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ChargeCodeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesIdInfoEndpoint( @@ -16,18 +15,13 @@ class TimeChargecodesIdInfoEndpoint( IGettable[ChargeCodeInfo, ConnectWiseManageRequestParams], IPaginateable[ChargeCodeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, ChargeCodeInfo) IPaginateable.__init__(self, ChargeCodeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ChargeCodeInfo]: """ Performs a GET request against the /time/chargeCodes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ChargeCodeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ChargeCodeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ChargeCodeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ChargeCodeInfo: """ Performs a GET request against the /time/chargeCodes/{id}/info endpoint. @@ -67,7 +52,4 @@ def get( Returns: ChargeCodeInfo: The parsed response data. """ - return self._parse_one( - ChargeCodeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(ChargeCodeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesEndpoint.py index 06a1940da..6b7724a81 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeChargecodesIdUsagesListEndpoint import ( - TimeChargecodesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeChargecodesIdUsagesListEndpoint import TimeChargecodesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class TimeChargecodesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - TimeChargecodesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(TimeChargecodesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /time/chargeCodes/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /time/chargeCodes/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesListEndpoint.py index b921f8a9c..066e06e1c 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class TimeChargecodesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /time/chargeCodes/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /time/chargeCodes/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoCountEndpoint.py index 8d0464629..e3bde9ce6 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesInfoCountEndpoint( @@ -16,18 +15,13 @@ class TimeChargecodesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/chargeCodes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/chargeCodes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoEndpoint.py index bcdd7068c..10265307f 100644 --- a/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeChargecodesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeChargecodesInfoCountEndpoint import ( - TimeChargecodesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeChargecodesInfoCountEndpoint import TimeChargecodesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ChargeCodeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeChargecodesInfoEndpoint( @@ -19,22 +16,15 @@ class TimeChargecodesInfoEndpoint( IGettable[list[ChargeCodeInfo], ConnectWiseManageRequestParams], IPaginateable[ChargeCodeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ChargeCodeInfo]) IPaginateable.__init__(self, ChargeCodeInfo) - self.count = self._register_child_endpoint( - TimeChargecodesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeChargecodesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ChargeCodeInfo]: """ Performs a GET request against the /time/chargeCodes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +42,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ChargeCodeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ChargeCodeInfo, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ChargeCodeInfo]: """ Performs a GET request against the /time/chargeCodes/info endpoint. @@ -74,7 +57,4 @@ def get( Returns: list[ChargeCodeInfo]: The parsed response data. """ - return self._parse_many( - ChargeCodeInfo, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ChargeCodeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEndpoint.py index 150a408bc..43da3d965 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEndpoint.py @@ -1,63 +1,42 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.TimeAccrualsEndpoint import TimeAccrualsEndpoint -from pyconnectwise.endpoints.manage.TimeActivitystopwatchesEndpoint import ( - TimeActivitystopwatchesEndpoint, -) -from pyconnectwise.endpoints.manage.TimeChargecodesEndpoint import ( - TimeChargecodesEndpoint, -) +from pyconnectwise.endpoints.manage.TimeActivitystopwatchesEndpoint import TimeActivitystopwatchesEndpoint +from pyconnectwise.endpoints.manage.TimeChargecodesEndpoint import TimeChargecodesEndpoint from pyconnectwise.endpoints.manage.TimeEntriesEndpoint import TimeEntriesEndpoint from pyconnectwise.endpoints.manage.TimeInfoEndpoint import TimeInfoEndpoint -from pyconnectwise.endpoints.manage.TimeSchedulestopwatchesEndpoint import ( - TimeSchedulestopwatchesEndpoint, -) +from pyconnectwise.endpoints.manage.TimeSchedulestopwatchesEndpoint import TimeSchedulestopwatchesEndpoint from pyconnectwise.endpoints.manage.TimeSheetsEndpoint import TimeSheetsEndpoint -from pyconnectwise.endpoints.manage.TimeTicketstopwatchesEndpoint import ( - TimeTicketstopwatchesEndpoint, -) -from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsEndpoint import ( - TimeTimeperiodsetupsEndpoint, -) +from pyconnectwise.endpoints.manage.TimeTicketstopwatchesEndpoint import TimeTicketstopwatchesEndpoint +from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsEndpoint import TimeTimeperiodsetupsEndpoint from pyconnectwise.endpoints.manage.TimeWorkrolesEndpoint import TimeWorkrolesEndpoint from pyconnectwise.endpoints.manage.TimeWorktypesEndpoint import TimeWorktypesEndpoint +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + class TimeEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "time", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "time", parent_endpoint=parent_endpoint) - self.work_roles = self._register_child_endpoint( - TimeWorkrolesEndpoint(client, parent_endpoint=self) + self.accruals = self._register_child_endpoint(TimeAccrualsEndpoint(client, parent_endpoint=self)) + self.activitystopwatches = self._register_child_endpoint( + TimeActivitystopwatchesEndpoint(client, parent_endpoint=self) ) - self.info = self._register_child_endpoint( - TimeInfoEndpoint(client, parent_endpoint=self) + self.charge_codes = self._register_child_endpoint(TimeChargecodesEndpoint(client, parent_endpoint=self)) + self.entries = self._register_child_endpoint(TimeEntriesEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(TimeInfoEndpoint(client, parent_endpoint=self)) + self.schedulestopwatches = self._register_child_endpoint( + TimeSchedulestopwatchesEndpoint(client, parent_endpoint=self) ) + self.sheets = self._register_child_endpoint(TimeSheetsEndpoint(client, parent_endpoint=self)) self.ticketstopwatches = self._register_child_endpoint( TimeTicketstopwatchesEndpoint(client, parent_endpoint=self) ) - self.charge_codes = self._register_child_endpoint( - TimeChargecodesEndpoint(client, parent_endpoint=self) - ) - self.entries = self._register_child_endpoint( - TimeEntriesEndpoint(client, parent_endpoint=self) - ) - self.sheets = self._register_child_endpoint( - TimeSheetsEndpoint(client, parent_endpoint=self) - ) - self.schedulestopwatches = self._register_child_endpoint( - TimeSchedulestopwatchesEndpoint(client, parent_endpoint=self) - ) self.time_period_setups = self._register_child_endpoint( TimeTimeperiodsetupsEndpoint(client, parent_endpoint=self) ) - self.work_types = self._register_child_endpoint( - TimeWorktypesEndpoint(client, parent_endpoint=self) - ) - self.activitystopwatches = self._register_child_endpoint( - TimeActivitystopwatchesEndpoint(client, parent_endpoint=self) - ) - self.accruals = self._register_child_endpoint( - TimeAccrualsEndpoint(client, parent_endpoint=self) - ) + self.work_roles = self._register_child_endpoint(TimeWorkrolesEndpoint(client, parent_endpoint=self)) + self.work_types = self._register_child_endpoint(TimeWorktypesEndpoint(client, parent_endpoint=self)) diff --git a/src/pyconnectwise/endpoints/manage/TimeEntriesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEntriesCountEndpoint.py index 6a35d3e68..eae974275 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEntriesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEntriesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeEntriesCountEndpoint( @@ -16,18 +15,13 @@ class TimeEntriesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/entries/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/entries/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeEntriesDefaultsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEntriesDefaultsEndpoint.py index 31c057c3a..3d1530a98 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEntriesDefaultsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEntriesDefaultsEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import TimeEntry -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class TimeEntriesDefaultsEndpoint( - ConnectWiseEndpoint, IPostable[TimeEntry, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "defaults", parent_endpoint=parent_endpoint - ) +class TimeEntriesDefaultsEndpoint(ConnectWiseEndpoint, IPostable[TimeEntry, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "defaults", parent_endpoint=parent_endpoint) IPostable.__init__(self, TimeEntry) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeEntry: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeEntry: """ Performs a POST request against the /time/entries/defaults endpoint. @@ -32,6 +24,4 @@ def post( Returns: TimeEntry: The parsed response data. """ - return self._parse_one( - TimeEntry, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TimeEntry, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeEntriesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEntriesEndpoint.py index 9d79419ff..e7f566233 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEntriesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEntriesEndpoint.py @@ -1,22 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeEntriesCountEndpoint import ( - TimeEntriesCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeEntriesDefaultsEndpoint import ( - TimeEntriesDefaultsEndpoint, -) +from pyconnectwise.endpoints.manage.TimeEntriesCountEndpoint import TimeEntriesCountEndpoint +from pyconnectwise.endpoints.manage.TimeEntriesDefaultsEndpoint import TimeEntriesDefaultsEndpoint from pyconnectwise.endpoints.manage.TimeEntriesIdEndpoint import TimeEntriesIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TimeEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeEntriesEndpoint( @@ -25,39 +19,30 @@ class TimeEntriesEndpoint( IPostable[TimeEntry, ConnectWiseManageRequestParams], IPaginateable[TimeEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "entries", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "entries", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeEntry]) IPostable.__init__(self, TimeEntry) IPaginateable.__init__(self, TimeEntry) - self.count = self._register_child_endpoint( - TimeEntriesCountEndpoint(client, parent_endpoint=self) - ) - self.defaults = self._register_child_endpoint( - TimeEntriesDefaultsEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeEntriesCountEndpoint(client, parent_endpoint=self)) + self.defaults = self._register_child_endpoint(TimeEntriesDefaultsEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeEntriesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeEntriesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeEntriesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeEntriesIdEndpoint: The initialized TimeEntriesIdEndpoint object. """ child = TimeEntriesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeEntry]: """ Performs a GET request against the /time/entries endpoint and returns an initialized PaginatedResponse object. @@ -74,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TimeEntry, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TimeEntry, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TimeEntry]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TimeEntry]: """ Performs a GET request against the /time/entries endpoint. @@ -97,15 +71,9 @@ def get( Returns: list[TimeEntry]: The parsed response data. """ - return self._parse_many( - TimeEntry, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TimeEntry, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeEntry: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeEntry: """ Performs a POST request against the /time/entries endpoint. @@ -115,6 +83,4 @@ def post( Returns: TimeEntry: The parsed response data. """ - return self._parse_one( - TimeEntry, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(TimeEntry, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsCountEndpoint.py index ec75f6a54..11de8a08b 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeEntriesIdAuditsCountEndpoint( @@ -16,18 +15,13 @@ class TimeEntriesIdAuditsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/entries/{id}/audits/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/entries/{id}/audits/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsEndpoint.py index 763239142..74e77b3a7 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeEntriesIdAuditsCountEndpoint import ( - TimeEntriesIdAuditsCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeEntriesIdAuditsIdEndpoint import ( - TimeEntriesIdAuditsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeEntriesIdAuditsCountEndpoint import TimeEntriesIdAuditsCountEndpoint +from pyconnectwise.endpoints.manage.TimeEntriesIdAuditsIdEndpoint import TimeEntriesIdAuditsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeEntryAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeEntriesIdAuditsEndpoint( @@ -22,35 +17,28 @@ class TimeEntriesIdAuditsEndpoint( IGettable[list[TimeEntryAudit], ConnectWiseManageRequestParams], IPaginateable[TimeEntryAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "audits", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "audits", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeEntryAudit]) IPaginateable.__init__(self, TimeEntryAudit) - self.count = self._register_child_endpoint( - TimeEntriesIdAuditsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeEntriesIdAuditsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeEntriesIdAuditsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeEntriesIdAuditsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeEntriesIdAuditsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeEntriesIdAuditsIdEndpoint: The initialized TimeEntriesIdAuditsIdEndpoint object. """ child = TimeEntriesIdAuditsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeEntryAudit]: """ Performs a GET request against the /time/entries/{id}/audits endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeEntryAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeEntryAudit, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimeEntryAudit]: """ Performs a GET request against the /time/entries/{id}/audits endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[TimeEntryAudit]: The parsed response data. """ - return self._parse_many( - TimeEntryAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TimeEntryAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsIdEndpoint.py index 185b727e8..5e09acf12 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEntriesIdAuditsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeEntryAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeEntriesIdAuditsIdEndpoint( @@ -16,18 +15,13 @@ class TimeEntriesIdAuditsIdEndpoint( IGettable[TimeEntryAudit, ConnectWiseManageRequestParams], IPaginateable[TimeEntryAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeEntryAudit) IPaginateable.__init__(self, TimeEntryAudit) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeEntryAudit]: """ Performs a GET request against the /time/entries/{id}/audits/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeEntryAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeEntryAudit, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeEntryAudit: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeEntryAudit: """ Performs a GET request against the /time/entries/{id}/audits/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: TimeEntryAudit: The parsed response data. """ - return self._parse_one( - TimeEntryAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(TimeEntryAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeEntriesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeEntriesIdEndpoint.py index 1f34bc3a7..237923b7b 100644 --- a/src/pyconnectwise/endpoints/manage/TimeEntriesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeEntriesIdEndpoint.py @@ -1,47 +1,34 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeEntriesIdAuditsEndpoint import ( - TimeEntriesIdAuditsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.TimeEntriesIdAuditsEndpoint import TimeEntriesIdAuditsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TimeEntry from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeEntriesIdEndpoint( ConnectWiseEndpoint, IGettable[TimeEntry, ConnectWiseManageRequestParams], - IPuttable[TimeEntry, ConnectWiseManageRequestParams], IPatchable[TimeEntry, ConnectWiseManageRequestParams], + IPuttable[TimeEntry, ConnectWiseManageRequestParams], IPaginateable[TimeEntry, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeEntry) - IPuttable.__init__(self, TimeEntry) IPatchable.__init__(self, TimeEntry) + IPuttable.__init__(self, TimeEntry) IPaginateable.__init__(self, TimeEntry) - self.audits = self._register_child_endpoint( - TimeEntriesIdAuditsEndpoint(client, parent_endpoint=self) - ) + self.audits = self._register_child_endpoint(TimeEntriesIdAuditsEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeEntry]: """ Performs a GET request against the /time/entries/{id} endpoint and returns an initialized PaginatedResponse object. @@ -58,54 +45,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TimeEntry, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TimeEntry, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeEntry: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/entries/{id} endpoint. + Performs a DELETE request against the /time/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TimeEntry: The parsed response data. """ - return self._parse_one( - TimeEntry, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeEntry: """ - Performs a DELETE request against the /time/entries/{id} endpoint. + Performs a GET request against the /time/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TimeEntry: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TimeEntry, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeEntry: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TimeEntry: """ - Performs a PUT request against the /time/entries/{id} endpoint. + Performs a PATCH request against the /time/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -113,17 +79,11 @@ def put( Returns: TimeEntry: The parsed response data. """ - return self._parse_one( - TimeEntry, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(TimeEntry, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeEntry: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeEntry: """ - Performs a PATCH request against the /time/entries/{id} endpoint. + Performs a PUT request against the /time/entries/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -131,6 +91,4 @@ def patch( Returns: TimeEntry: The parsed response data. """ - return self._parse_one( - TimeEntry, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(TimeEntry, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesCountEndpoint.py index 4a4d6c307..573b8d1f4 100644 --- a/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeInfoChargecodeexpensetypesCountEndpoint( @@ -16,18 +15,13 @@ class TimeInfoChargecodeexpensetypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/info/chargeCodeExpenseTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/info/chargeCodeExpenseTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesEndpoint.py index 3d5311c5a..3dc9fad40 100644 --- a/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeInfoChargecodeexpensetypesEndpoint.py @@ -1,17 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.TimeInfoChargecodeexpensetypesCountEndpoint import ( TimeInfoChargecodeexpensetypesCountEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import ChargeCodeExpenseType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeInfoChargecodeexpensetypesEndpoint( @@ -19,10 +18,8 @@ class TimeInfoChargecodeexpensetypesEndpoint( IGettable[list[ChargeCodeExpenseType], ConnectWiseManageRequestParams], IPaginateable[ChargeCodeExpenseType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "chargeCodeExpenseTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "chargeCodeExpenseTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ChargeCodeExpenseType]) IPaginateable.__init__(self, ChargeCodeExpenseType) @@ -31,10 +28,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ChargeCodeExpenseType]: """ Performs a GET request against the /time/info/chargeCodeExpenseTypes endpoint and returns an initialized PaginatedResponse object. @@ -52,18 +46,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ChargeCodeExpenseType, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ChargeCodeExpenseType, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ChargeCodeExpenseType]: """ Performs a GET request against the /time/info/chargeCodeExpenseTypes endpoint. @@ -74,7 +61,4 @@ def get( Returns: list[ChargeCodeExpenseType]: The parsed response data. """ - return self._parse_many( - ChargeCodeExpenseType, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ChargeCodeExpenseType, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeInfoEndpoint.py index 37730bd51..ac560d607 100644 --- a/src/pyconnectwise/endpoints/manage/TimeInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeInfoEndpoint.py @@ -1,14 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeInfoChargecodeexpensetypesEndpoint import ( - TimeInfoChargecodeexpensetypesEndpoint, -) +from pyconnectwise.endpoints.manage.TimeInfoChargecodeexpensetypesEndpoint import TimeInfoChargecodeexpensetypesEndpoint + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeInfoEndpoint(ConnectWiseEndpoint): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) self.charge_code_expense_types = self._register_child_endpoint( TimeInfoChargecodeexpensetypesEndpoint(client, parent_endpoint=self) diff --git a/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesCountEndpoint.py index 1922fbbb7..2ee48c4b8 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSchedulestopwatchesCountEndpoint( @@ -16,18 +15,13 @@ class TimeSchedulestopwatchesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/schedulestopwatches/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/schedulestopwatches/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesEndpoint.py index ccd0eafe5..748695266 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeSchedulestopwatchesCountEndpoint import ( - TimeSchedulestopwatchesCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeSchedulestopwatchesIdEndpoint import ( - TimeSchedulestopwatchesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeSchedulestopwatchesCountEndpoint import TimeSchedulestopwatchesCountEndpoint +from pyconnectwise.endpoints.manage.TimeSchedulestopwatchesIdEndpoint import TimeSchedulestopwatchesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import ScheduleStopwatch from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSchedulestopwatchesEndpoint( @@ -24,36 +18,29 @@ class TimeSchedulestopwatchesEndpoint( IPostable[ScheduleStopwatch, ConnectWiseManageRequestParams], IPaginateable[ScheduleStopwatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "schedulestopwatches", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "schedulestopwatches", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[ScheduleStopwatch]) IPostable.__init__(self, ScheduleStopwatch) IPaginateable.__init__(self, ScheduleStopwatch) - self.count = self._register_child_endpoint( - TimeSchedulestopwatchesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeSchedulestopwatchesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeSchedulestopwatchesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeSchedulestopwatchesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeSchedulestopwatchesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeSchedulestopwatchesIdEndpoint: The initialized TimeSchedulestopwatchesIdEndpoint object. """ child = TimeSchedulestopwatchesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleStopwatch]: """ Performs a GET request against the /time/schedulestopwatches endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleStopwatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleStopwatch, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[ScheduleStopwatch]: """ Performs a GET request against the /time/schedulestopwatches endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[ScheduleStopwatch]: The parsed response data. """ - return self._parse_many( - ScheduleStopwatch, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(ScheduleStopwatch, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStopwatch: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStopwatch: """ Performs a POST request against the /time/schedulestopwatches endpoint. @@ -112,7 +85,4 @@ def post( Returns: ScheduleStopwatch: The parsed response data. """ - return self._parse_one( - ScheduleStopwatch, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(ScheduleStopwatch, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesIdEndpoint.py index 0b5049325..ae7b4c641 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSchedulestopwatchesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import ScheduleStopwatch from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSchedulestopwatchesIdEndpoint( ConnectWiseEndpoint, IGettable[ScheduleStopwatch, ConnectWiseManageRequestParams], - IPuttable[ScheduleStopwatch, ConnectWiseManageRequestParams], IPatchable[ScheduleStopwatch, ConnectWiseManageRequestParams], + IPuttable[ScheduleStopwatch, ConnectWiseManageRequestParams], IPaginateable[ScheduleStopwatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, ScheduleStopwatch) - IPuttable.__init__(self, ScheduleStopwatch) IPatchable.__init__(self, ScheduleStopwatch) + IPuttable.__init__(self, ScheduleStopwatch) IPaginateable.__init__(self, ScheduleStopwatch) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[ScheduleStopwatch]: """ Performs a GET request against the /time/schedulestopwatches/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - ScheduleStopwatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), ScheduleStopwatch, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStopwatch: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/schedulestopwatches/{id} endpoint. + Performs a DELETE request against the /time/schedulestopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - ScheduleStopwatch: The parsed response data. """ - return self._parse_one( - ScheduleStopwatch, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStopwatch: """ - Performs a DELETE request against the /time/schedulestopwatches/{id} endpoint. + Performs a GET request against the /time/schedulestopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + ScheduleStopwatch: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(ScheduleStopwatch, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStopwatch: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStopwatch: """ - Performs a PUT request against the /time/schedulestopwatches/{id} endpoint. + Performs a PATCH request against the /time/schedulestopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: ScheduleStopwatch: The parsed response data. """ - return self._parse_one( - ScheduleStopwatch, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(ScheduleStopwatch, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> ScheduleStopwatch: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> ScheduleStopwatch: """ - Performs a PATCH request against the /time/schedulestopwatches/{id} endpoint. + Performs a PUT request against the /time/schedulestopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: ScheduleStopwatch: The parsed response data. """ - return self._parse_one( - ScheduleStopwatch, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(ScheduleStopwatch, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsCountEndpoint.py index 4ad1214e8..d74247409 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSheetsCountEndpoint( @@ -16,18 +15,13 @@ class TimeSheetsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/sheets/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/sheets/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsEndpoint.py index 67fb9ca76..1a7932003 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsEndpoint.py @@ -1,18 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeSheetsCountEndpoint import ( - TimeSheetsCountEndpoint, -) +from pyconnectwise.endpoints.manage.TimeSheetsCountEndpoint import TimeSheetsCountEndpoint from pyconnectwise.endpoints.manage.TimeSheetsIdEndpoint import TimeSheetsIdEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeSheet from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSheetsEndpoint( @@ -20,35 +17,28 @@ class TimeSheetsEndpoint( IGettable[list[TimeSheet], ConnectWiseManageRequestParams], IPaginateable[TimeSheet, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "sheets", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "sheets", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeSheet]) IPaginateable.__init__(self, TimeSheet) - self.count = self._register_child_endpoint( - TimeSheetsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeSheetsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeSheetsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeSheetsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeSheetsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeSheetsIdEndpoint: The initialized TimeSheetsIdEndpoint object. """ child = TimeSheetsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeSheet]: """ Performs a GET request against the /time/sheets endpoint and returns an initialized PaginatedResponse object. @@ -65,20 +55,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TimeSheet, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TimeSheet, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TimeSheet]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TimeSheet]: """ Performs a GET request against the /time/sheets endpoint. @@ -88,6 +67,4 @@ def get( Returns: list[TimeSheet]: The parsed response data. """ - return self._parse_many( - TimeSheet, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TimeSheet, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdApproveEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdApproveEndpoint.py index 927ef1178..ec23ddaad 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdApproveEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdApproveEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class TimeSheetsIdApproveEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "approve", parent_endpoint=parent_endpoint - ) +class TimeSheetsIdApproveEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "approve", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /time/sheets/{id}/approve endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsCountEndpoint.py index f1e3eb45a..af45a6792 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSheetsIdAuditsCountEndpoint( @@ -16,18 +15,13 @@ class TimeSheetsIdAuditsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/sheets/{id}/audits/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/sheets/{id}/audits/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsEndpoint.py index e59ee646c..fc0b6c6f6 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsEndpoint.py @@ -1,20 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeSheetsIdAuditsCountEndpoint import ( - TimeSheetsIdAuditsCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeSheetsIdAuditsIdEndpoint import ( - TimeSheetsIdAuditsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeSheetsIdAuditsCountEndpoint import TimeSheetsIdAuditsCountEndpoint +from pyconnectwise.endpoints.manage.TimeSheetsIdAuditsIdEndpoint import TimeSheetsIdAuditsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeSheetAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSheetsIdAuditsEndpoint( @@ -22,35 +17,28 @@ class TimeSheetsIdAuditsEndpoint( IGettable[list[TimeSheetAudit], ConnectWiseManageRequestParams], IPaginateable[TimeSheetAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "audits", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "audits", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimeSheetAudit]) IPaginateable.__init__(self, TimeSheetAudit) - self.count = self._register_child_endpoint( - TimeSheetsIdAuditsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeSheetsIdAuditsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeSheetsIdAuditsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeSheetsIdAuditsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeSheetsIdAuditsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeSheetsIdAuditsIdEndpoint: The initialized TimeSheetsIdAuditsIdEndpoint object. """ child = TimeSheetsIdAuditsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeSheetAudit]: """ Performs a GET request against the /time/sheets/{id}/audits endpoint and returns an initialized PaginatedResponse object. @@ -68,18 +56,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeSheetAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeSheetAudit, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimeSheetAudit]: """ Performs a GET request against the /time/sheets/{id}/audits endpoint. @@ -90,7 +71,4 @@ def get( Returns: list[TimeSheetAudit]: The parsed response data. """ - return self._parse_many( - TimeSheetAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TimeSheetAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsIdEndpoint.py index df23e0ce1..30d2e267a 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdAuditsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeSheetAudit from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSheetsIdAuditsIdEndpoint( @@ -16,18 +15,13 @@ class TimeSheetsIdAuditsIdEndpoint( IGettable[TimeSheetAudit, ConnectWiseManageRequestParams], IPaginateable[TimeSheetAudit, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeSheetAudit) IPaginateable.__init__(self, TimeSheetAudit) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeSheetAudit]: """ Performs a GET request against the /time/sheets/{id}/audits/{id} endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimeSheetAudit, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimeSheetAudit, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeSheetAudit: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeSheetAudit: """ Performs a GET request against the /time/sheets/{id}/audits/{id} endpoint. @@ -67,7 +52,4 @@ def get( Returns: TimeSheetAudit: The parsed response data. """ - return self._parse_one( - TimeSheetAudit, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(TimeSheetAudit, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdEndpoint.py index 20e645a81..c4969ae58 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdEndpoint.py @@ -1,29 +1,18 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeSheetsIdApproveEndpoint import ( - TimeSheetsIdApproveEndpoint, -) -from pyconnectwise.endpoints.manage.TimeSheetsIdAuditsEndpoint import ( - TimeSheetsIdAuditsEndpoint, -) -from pyconnectwise.endpoints.manage.TimeSheetsIdRejectEndpoint import ( - TimeSheetsIdRejectEndpoint, -) -from pyconnectwise.endpoints.manage.TimeSheetsIdReverseEndpoint import ( - TimeSheetsIdReverseEndpoint, -) -from pyconnectwise.endpoints.manage.TimeSheetsIdSubmitEndpoint import ( - TimeSheetsIdSubmitEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeSheetsIdApproveEndpoint import TimeSheetsIdApproveEndpoint +from pyconnectwise.endpoints.manage.TimeSheetsIdAuditsEndpoint import TimeSheetsIdAuditsEndpoint +from pyconnectwise.endpoints.manage.TimeSheetsIdRejectEndpoint import TimeSheetsIdRejectEndpoint +from pyconnectwise.endpoints.manage.TimeSheetsIdReverseEndpoint import TimeSheetsIdReverseEndpoint +from pyconnectwise.endpoints.manage.TimeSheetsIdSubmitEndpoint import TimeSheetsIdSubmitEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimeSheet from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeSheetsIdEndpoint( @@ -31,34 +20,19 @@ class TimeSheetsIdEndpoint( IGettable[TimeSheet, ConnectWiseManageRequestParams], IPaginateable[TimeSheet, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimeSheet) IPaginateable.__init__(self, TimeSheet) - self.submit = self._register_child_endpoint( - TimeSheetsIdSubmitEndpoint(client, parent_endpoint=self) - ) - self.audits = self._register_child_endpoint( - TimeSheetsIdAuditsEndpoint(client, parent_endpoint=self) - ) - self.reject = self._register_child_endpoint( - TimeSheetsIdRejectEndpoint(client, parent_endpoint=self) - ) - self.approve = self._register_child_endpoint( - TimeSheetsIdApproveEndpoint(client, parent_endpoint=self) - ) - self.reverse = self._register_child_endpoint( - TimeSheetsIdReverseEndpoint(client, parent_endpoint=self) - ) + self.approve = self._register_child_endpoint(TimeSheetsIdApproveEndpoint(client, parent_endpoint=self)) + self.audits = self._register_child_endpoint(TimeSheetsIdAuditsEndpoint(client, parent_endpoint=self)) + self.reject = self._register_child_endpoint(TimeSheetsIdRejectEndpoint(client, parent_endpoint=self)) + self.reverse = self._register_child_endpoint(TimeSheetsIdReverseEndpoint(client, parent_endpoint=self)) + self.submit = self._register_child_endpoint(TimeSheetsIdSubmitEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimeSheet]: """ Performs a GET request against the /time/sheets/{id} endpoint and returns an initialized PaginatedResponse object. @@ -75,20 +49,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TimeSheet, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TimeSheet, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimeSheet: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimeSheet: """ Performs a GET request against the /time/sheets/{id} endpoint. @@ -98,20 +61,4 @@ def get( Returns: TimeSheet: The parsed response data. """ - return self._parse_one( - TimeSheet, super()._make_request("GET", data=data, params=params).json() - ) - - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: - """ - Performs a DELETE request against the /time/sheets/{id} endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TimeSheet, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdRejectEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdRejectEndpoint.py index 5dad79eee..836ce20a5 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdRejectEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdRejectEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class TimeSheetsIdRejectEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reject", parent_endpoint=parent_endpoint - ) +class TimeSheetsIdRejectEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reject", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /time/sheets/{id}/reject endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdReverseEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdReverseEndpoint.py index 36d7ab4b6..b0e3e8b41 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdReverseEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdReverseEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class TimeSheetsIdReverseEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "reverse", parent_endpoint=parent_endpoint - ) +class TimeSheetsIdReverseEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "reverse", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /time/sheets/{id}/reverse endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeSheetsIdSubmitEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeSheetsIdSubmitEndpoint.py index 4e4c4e229..ee1023650 100644 --- a/src/pyconnectwise/endpoints/manage/TimeSheetsIdSubmitEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeSheetsIdSubmitEndpoint.py @@ -1,28 +1,20 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IPostable, -) +from pyconnectwise.interfaces import IPostable from pyconnectwise.models.manage import SuccessResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient -class TimeSheetsIdSubmitEndpoint( - ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams] -): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "submit", parent_endpoint=parent_endpoint - ) +class TimeSheetsIdSubmitEndpoint(ConnectWiseEndpoint, IPostable[SuccessResponse, ConnectWiseManageRequestParams]): + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "submit", parent_endpoint=parent_endpoint) IPostable.__init__(self, SuccessResponse) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> SuccessResponse: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> SuccessResponse: """ Performs a POST request against the /time/sheets/{id}/submit endpoint. @@ -32,7 +24,4 @@ def post( Returns: SuccessResponse: The parsed response data. """ - return self._parse_one( - SuccessResponse, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(SuccessResponse, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesCountEndpoint.py index fcf07436b..ba315f3a7 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTicketstopwatchesCountEndpoint( @@ -16,18 +15,13 @@ class TimeTicketstopwatchesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/ticketstopwatches/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/ticketstopwatches/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesEndpoint.py index f2c6948b2..8a41a886f 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeTicketstopwatchesCountEndpoint import ( - TimeTicketstopwatchesCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeTicketstopwatchesIdEndpoint import ( - TimeTicketstopwatchesIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeTicketstopwatchesCountEndpoint import TimeTicketstopwatchesCountEndpoint +from pyconnectwise.endpoints.manage.TimeTicketstopwatchesIdEndpoint import TimeTicketstopwatchesIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TicketStopwatch from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTicketstopwatchesEndpoint( @@ -24,36 +18,29 @@ class TimeTicketstopwatchesEndpoint( IPostable[TicketStopwatch, ConnectWiseManageRequestParams], IPaginateable[TicketStopwatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "ticketstopwatches", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "ticketstopwatches", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TicketStopwatch]) IPostable.__init__(self, TicketStopwatch) IPaginateable.__init__(self, TicketStopwatch) - self.count = self._register_child_endpoint( - TimeTicketstopwatchesCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeTicketstopwatchesCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeTicketstopwatchesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeTicketstopwatchesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeTicketstopwatchesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeTicketstopwatchesIdEndpoint: The initialized TimeTicketstopwatchesIdEndpoint object. """ child = TimeTicketstopwatchesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketStopwatch]: """ Performs a GET request against the /time/ticketstopwatches endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TicketStopwatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TicketStopwatch, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TicketStopwatch]: """ Performs a GET request against the /time/ticketstopwatches endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[TicketStopwatch]: The parsed response data. """ - return self._parse_many( - TicketStopwatch, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TicketStopwatch, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketStopwatch: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketStopwatch: """ Performs a POST request against the /time/ticketstopwatches endpoint. @@ -112,7 +85,4 @@ def post( Returns: TicketStopwatch: The parsed response data. """ - return self._parse_one( - TicketStopwatch, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TicketStopwatch, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesIdEndpoint.py index 9a817faa0..5b20e8f87 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTicketstopwatchesIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TicketStopwatch from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTicketstopwatchesIdEndpoint( ConnectWiseEndpoint, IGettable[TicketStopwatch, ConnectWiseManageRequestParams], - IPuttable[TicketStopwatch, ConnectWiseManageRequestParams], IPatchable[TicketStopwatch, ConnectWiseManageRequestParams], + IPuttable[TicketStopwatch, ConnectWiseManageRequestParams], IPaginateable[TicketStopwatch, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TicketStopwatch) - IPuttable.__init__(self, TicketStopwatch) IPatchable.__init__(self, TicketStopwatch) + IPuttable.__init__(self, TicketStopwatch) IPaginateable.__init__(self, TicketStopwatch) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TicketStopwatch]: """ Performs a GET request against the /time/ticketstopwatches/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TicketStopwatch, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TicketStopwatch, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketStopwatch: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/ticketstopwatches/{id} endpoint. + Performs a DELETE request against the /time/ticketstopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TicketStopwatch: The parsed response data. """ - return self._parse_one( - TicketStopwatch, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketStopwatch: """ - Performs a DELETE request against the /time/ticketstopwatches/{id} endpoint. + Performs a GET request against the /time/ticketstopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TicketStopwatch: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TicketStopwatch, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketStopwatch: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TicketStopwatch: """ - Performs a PUT request against the /time/ticketstopwatches/{id} endpoint. + Performs a PATCH request against the /time/ticketstopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: TicketStopwatch: The parsed response data. """ - return self._parse_one( - TicketStopwatch, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TicketStopwatch, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TicketStopwatch: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TicketStopwatch: """ - Performs a PATCH request against the /time/ticketstopwatches/{id} endpoint. + Performs a PUT request against the /time/ticketstopwatches/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: TicketStopwatch: The parsed response data. """ - return self._parse_one( - TicketStopwatch, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TicketStopwatch, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsCountEndpoint.py index 764c46413..87682fd06 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTimeperiodsetupsCountEndpoint( @@ -16,18 +15,13 @@ class TimeTimeperiodsetupsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/timePeriodSetups/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/timePeriodSetups/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsDefaultEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsDefaultEndpoint.py index dd55ab32b..37960affc 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsDefaultEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsDefaultEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimePeriodSetupDefaults from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTimeperiodsetupsDefaultEndpoint( @@ -16,18 +15,13 @@ class TimeTimeperiodsetupsDefaultEndpoint( IGettable[TimePeriodSetupDefaults, ConnectWiseManageRequestParams], IPaginateable[TimePeriodSetupDefaults, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "default", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "default", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimePeriodSetupDefaults) IPaginateable.__init__(self, TimePeriodSetupDefaults) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimePeriodSetupDefaults]: """ Performs a GET request against the /time/timePeriodSetups/default endpoint and returns an initialized PaginatedResponse object. @@ -45,18 +39,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimePeriodSetupDefaults, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimePeriodSetupDefaults, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> TimePeriodSetupDefaults: """ Performs a GET request against the /time/timePeriodSetups/default endpoint. @@ -67,7 +54,4 @@ def get( Returns: TimePeriodSetupDefaults: The parsed response data. """ - return self._parse_one( - TimePeriodSetupDefaults, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_one(TimePeriodSetupDefaults, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsEndpoint.py index 0ec37bfd8..e6e73f522 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsCountEndpoint import ( - TimeTimeperiodsetupsCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsDefaultEndpoint import ( - TimeTimeperiodsetupsDefaultEndpoint, -) -from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsIdEndpoint import ( - TimeTimeperiodsetupsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsCountEndpoint import TimeTimeperiodsetupsCountEndpoint +from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsDefaultEndpoint import TimeTimeperiodsetupsDefaultEndpoint +from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsIdEndpoint import TimeTimeperiodsetupsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import TimePeriodSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTimeperiodsetupsEndpoint( @@ -27,39 +19,30 @@ class TimeTimeperiodsetupsEndpoint( IPostable[TimePeriodSetup, ConnectWiseManageRequestParams], IPaginateable[TimePeriodSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "timePeriodSetups", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "timePeriodSetups", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimePeriodSetup]) IPostable.__init__(self, TimePeriodSetup) IPaginateable.__init__(self, TimePeriodSetup) - self.default = self._register_child_endpoint( - TimeTimeperiodsetupsDefaultEndpoint(client, parent_endpoint=self) - ) - self.count = self._register_child_endpoint( - TimeTimeperiodsetupsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeTimeperiodsetupsCountEndpoint(client, parent_endpoint=self)) + self.default = self._register_child_endpoint(TimeTimeperiodsetupsDefaultEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeTimeperiodsetupsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeTimeperiodsetupsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeTimeperiodsetupsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeTimeperiodsetupsIdEndpoint: The initialized TimeTimeperiodsetupsIdEndpoint object. """ child = TimeTimeperiodsetupsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimePeriodSetup]: """ Performs a GET request against the /time/timePeriodSetups endpoint and returns an initialized PaginatedResponse object. @@ -77,18 +60,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimePeriodSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimePeriodSetup, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[TimePeriodSetup]: """ Performs a GET request against the /time/timePeriodSetups endpoint. @@ -99,16 +75,9 @@ def get( Returns: list[TimePeriodSetup]: The parsed response data. """ - return self._parse_many( - TimePeriodSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(TimePeriodSetup, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimePeriodSetup: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimePeriodSetup: """ Performs a POST request against the /time/timePeriodSetups endpoint. @@ -118,7 +87,4 @@ def post( Returns: TimePeriodSetup: The parsed response data. """ - return self._parse_one( - TimePeriodSetup, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(TimePeriodSetup, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdEndpoint.py index 389b49312..1c245bb8d 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdEndpoint.py @@ -1,36 +1,28 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsIdPeriodsEndpoint import ( - TimeTimeperiodsetupsIdPeriodsEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsIdPeriodsEndpoint import TimeTimeperiodsetupsIdPeriodsEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import TimePeriodSetup from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTimeperiodsetupsIdEndpoint( ConnectWiseEndpoint, IGettable[TimePeriodSetup, ConnectWiseManageRequestParams], - IPuttable[TimePeriodSetup, ConnectWiseManageRequestParams], IPatchable[TimePeriodSetup, ConnectWiseManageRequestParams], + IPuttable[TimePeriodSetup, ConnectWiseManageRequestParams], IPaginateable[TimePeriodSetup, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimePeriodSetup) - IPuttable.__init__(self, TimePeriodSetup) IPatchable.__init__(self, TimePeriodSetup) + IPuttable.__init__(self, TimePeriodSetup) IPaginateable.__init__(self, TimePeriodSetup) self.periods = self._register_child_endpoint( @@ -38,10 +30,7 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 ) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimePeriodSetup]: """ Performs a GET request against the /time/timePeriodSetups/{id} endpoint and returns an initialized PaginatedResponse object. @@ -59,54 +48,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - TimePeriodSetup, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), TimePeriodSetup, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimePeriodSetup: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/timePeriodSetups/{id} endpoint. + Performs a DELETE request against the /time/timePeriodSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - TimePeriodSetup: The parsed response data. """ - return self._parse_one( - TimePeriodSetup, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimePeriodSetup: """ - Performs a DELETE request against the /time/timePeriodSetups/{id} endpoint. + Performs a GET request against the /time/timePeriodSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + TimePeriodSetup: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(TimePeriodSetup, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimePeriodSetup: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> TimePeriodSetup: """ - Performs a PUT request against the /time/timePeriodSetups/{id} endpoint. + Performs a PATCH request against the /time/timePeriodSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -114,18 +83,11 @@ def put( Returns: TimePeriodSetup: The parsed response data. """ - return self._parse_one( - TimePeriodSetup, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(TimePeriodSetup, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimePeriodSetup: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimePeriodSetup: """ - Performs a PATCH request against the /time/timePeriodSetups/{id} endpoint. + Performs a PUT request against the /time/timePeriodSetups/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -133,7 +95,4 @@ def patch( Returns: TimePeriodSetup: The parsed response data. """ - return self._parse_one( - TimePeriodSetup, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(TimePeriodSetup, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsCountEndpoint.py index 1908827f9..6bbd3293e 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTimeperiodsetupsIdPeriodsCountEndpoint( @@ -16,18 +15,13 @@ class TimeTimeperiodsetupsIdPeriodsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/timePeriodSetups/{id}/periods/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/timePeriodSetups/{id}/periods/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsEndpoint.py index da0ab4597..0ae39b028 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsEndpoint.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsIdPeriodsCountEndpoint import ( TimeTimeperiodsetupsIdPeriodsCountEndpoint, @@ -5,16 +7,13 @@ from pyconnectwise.endpoints.manage.TimeTimeperiodsetupsIdPeriodsIdEndpoint import ( TimeTimeperiodsetupsIdPeriodsIdEndpoint, ) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimePeriod from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTimeperiodsetupsIdPeriodsEndpoint( @@ -22,10 +21,8 @@ class TimeTimeperiodsetupsIdPeriodsEndpoint( IGettable[list[TimePeriod], ConnectWiseManageRequestParams], IPaginateable[TimePeriod, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "periods", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "periods", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[TimePeriod]) IPaginateable.__init__(self, TimePeriod) @@ -33,26 +30,21 @@ def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 TimeTimeperiodsetupsIdPeriodsCountEndpoint(client, parent_endpoint=self) ) - def id(self, id: int) -> TimeTimeperiodsetupsIdPeriodsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeTimeperiodsetupsIdPeriodsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeTimeperiodsetupsIdPeriodsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeTimeperiodsetupsIdPeriodsIdEndpoint: The initialized TimeTimeperiodsetupsIdPeriodsIdEndpoint object. """ - child = TimeTimeperiodsetupsIdPeriodsIdEndpoint( - self.client, parent_endpoint=self - ) - child._id = id + child = TimeTimeperiodsetupsIdPeriodsIdEndpoint(self.client, parent_endpoint=self) + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimePeriod]: """ Performs a GET request against the /time/timePeriodSetups/{id}/periods endpoint and returns an initialized PaginatedResponse object. @@ -69,20 +61,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TimePeriod, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TimePeriod, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[TimePeriod]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[TimePeriod]: """ Performs a GET request against the /time/timePeriodSetups/{id}/periods endpoint. @@ -92,6 +73,4 @@ def get( Returns: list[TimePeriod]: The parsed response data. """ - return self._parse_many( - TimePeriod, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(TimePeriod, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsIdEndpoint.py index cea45055d..7eee0a38b 100644 --- a/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeTimeperiodsetupsIdPeriodsIdEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import TimePeriod from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeTimeperiodsetupsIdPeriodsIdEndpoint( @@ -16,18 +15,13 @@ class TimeTimeperiodsetupsIdPeriodsIdEndpoint( IGettable[TimePeriod, ConnectWiseManageRequestParams], IPaginateable[TimePeriod, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, TimePeriod) IPaginateable.__init__(self, TimePeriod) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[TimePeriod]: """ Performs a GET request against the /time/timePeriodSetups/{id}/periods/{id} endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - TimePeriod, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), TimePeriod, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> TimePeriod: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> TimePeriod: """ Performs a GET request against the /time/timePeriodSetups/{id}/periods/{id} endpoint. @@ -67,6 +50,4 @@ def get( Returns: TimePeriod: The parsed response data. """ - return self._parse_one( - TimePeriod, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(TimePeriod, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesCountEndpoint.py index 28a848287..9eedbc638 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesCountEndpoint( @@ -16,18 +15,13 @@ class TimeWorkrolesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/workRoles/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/workRoles/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesEndpoint.py index 4265861f0..3aa624a34 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorkrolesCountEndpoint import ( - TimeWorkrolesCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorkrolesIdEndpoint import ( - TimeWorkrolesIdEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorkrolesInfoEndpoint import ( - TimeWorkrolesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeWorkrolesCountEndpoint import TimeWorkrolesCountEndpoint +from pyconnectwise.endpoints.manage.TimeWorkrolesIdEndpoint import TimeWorkrolesIdEndpoint +from pyconnectwise.endpoints.manage.TimeWorkrolesInfoEndpoint import TimeWorkrolesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesEndpoint( @@ -27,39 +19,30 @@ class TimeWorkrolesEndpoint( IPostable[WorkRole, ConnectWiseManageRequestParams], IPaginateable[WorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workRoles", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workRoles", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkRole]) IPostable.__init__(self, WorkRole) IPaginateable.__init__(self, WorkRole) - self.count = self._register_child_endpoint( - TimeWorkrolesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - TimeWorkrolesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeWorkrolesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(TimeWorkrolesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeWorkrolesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeWorkrolesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeWorkrolesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeWorkrolesIdEndpoint: The initialized TimeWorkrolesIdEndpoint object. """ child = TimeWorkrolesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRole]: """ Performs a GET request against the /time/workRoles endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRole, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), WorkRole, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[WorkRole]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[WorkRole]: """ Performs a GET request against the /time/workRoles endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[WorkRole]: The parsed response data. """ - return self._parse_many( - WorkRole, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(WorkRole, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRole: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRole: """ Performs a POST request against the /time/workRoles endpoint. @@ -117,6 +83,4 @@ def post( Returns: WorkRole: The parsed response data. """ - return self._parse_one( - WorkRole, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(WorkRole, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdEndpoint.py index ce058af3d..ba5c0504b 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdEndpoint.py @@ -1,59 +1,38 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorkrolesIdInfoEndpoint import ( - TimeWorkrolesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorkrolesIdLocationsEndpoint import ( - TimeWorkrolesIdLocationsEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorkrolesIdUsagesEndpoint import ( - TimeWorkrolesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.TimeWorkrolesIdInfoEndpoint import TimeWorkrolesIdInfoEndpoint +from pyconnectwise.endpoints.manage.TimeWorkrolesIdLocationsEndpoint import TimeWorkrolesIdLocationsEndpoint +from pyconnectwise.endpoints.manage.TimeWorkrolesIdUsagesEndpoint import TimeWorkrolesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WorkRole from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesIdEndpoint( ConnectWiseEndpoint, IGettable[WorkRole, ConnectWiseManageRequestParams], - IPuttable[WorkRole, ConnectWiseManageRequestParams], IPatchable[WorkRole, ConnectWiseManageRequestParams], + IPuttable[WorkRole, ConnectWiseManageRequestParams], IPaginateable[WorkRole, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkRole) - IPuttable.__init__(self, WorkRole) IPatchable.__init__(self, WorkRole) + IPuttable.__init__(self, WorkRole) IPaginateable.__init__(self, WorkRole) - self.usages = self._register_child_endpoint( - TimeWorkrolesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.locations = self._register_child_endpoint( - TimeWorkrolesIdLocationsEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - TimeWorkrolesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(TimeWorkrolesIdInfoEndpoint(client, parent_endpoint=self)) + self.locations = self._register_child_endpoint(TimeWorkrolesIdLocationsEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(TimeWorkrolesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRole]: """ Performs a GET request against the /time/workRoles/{id} endpoint and returns an initialized PaginatedResponse object. @@ -70,54 +49,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRole, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), WorkRole, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRole: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/workRoles/{id} endpoint. + Performs a DELETE request against the /time/workRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WorkRole: The parsed response data. """ - return self._parse_one( - WorkRole, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRole: """ - Performs a DELETE request against the /time/workRoles/{id} endpoint. + Performs a GET request against the /time/workRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WorkRole: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(WorkRole, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRole: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> WorkRole: """ - Performs a PUT request against the /time/workRoles/{id} endpoint. + Performs a PATCH request against the /time/workRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -125,17 +83,11 @@ def put( Returns: WorkRole: The parsed response data. """ - return self._parse_one( - WorkRole, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(WorkRole, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRole: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRole: """ - Performs a PATCH request against the /time/workRoles/{id} endpoint. + Performs a PUT request against the /time/workRoles/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -143,6 +95,4 @@ def patch( Returns: WorkRole: The parsed response data. """ - return self._parse_one( - WorkRole, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(WorkRole, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdInfoEndpoint.py index 916cf10da..62e2c40c1 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesIdInfoEndpoint( @@ -16,18 +15,13 @@ class TimeWorkrolesIdInfoEndpoint( IGettable[WorkRoleInfo, ConnectWiseManageRequestParams], IPaginateable[WorkRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkRoleInfo) IPaginateable.__init__(self, WorkRoleInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRoleInfo]: """ Performs a GET request against the /time/workRoles/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkRoleInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleInfo: """ Performs a GET request against the /time/workRoles/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: WorkRoleInfo: The parsed response data. """ - return self._parse_one( - WorkRoleInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(WorkRoleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsCountEndpoint.py index 35310e8e2..bf632d2eb 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesIdLocationsCountEndpoint( @@ -16,18 +15,13 @@ class TimeWorkrolesIdLocationsCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/workRoles/{id}/locations/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/workRoles/{id}/locations/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsEndpoint.py index af04a2444..97051ad63 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsEndpoint.py @@ -1,21 +1,15 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorkrolesIdLocationsCountEndpoint import ( - TimeWorkrolesIdLocationsCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorkrolesIdLocationsIdEndpoint import ( - TimeWorkrolesIdLocationsIdEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeWorkrolesIdLocationsCountEndpoint import TimeWorkrolesIdLocationsCountEndpoint +from pyconnectwise.endpoints.manage.TimeWorkrolesIdLocationsIdEndpoint import TimeWorkrolesIdLocationsIdEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WorkRoleLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesIdLocationsEndpoint( @@ -24,36 +18,29 @@ class TimeWorkrolesIdLocationsEndpoint( IPostable[WorkRoleLocation, ConnectWiseManageRequestParams], IPaginateable[WorkRoleLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "locations", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "locations", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkRoleLocation]) IPostable.__init__(self, WorkRoleLocation) IPaginateable.__init__(self, WorkRoleLocation) - self.count = self._register_child_endpoint( - TimeWorkrolesIdLocationsCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeWorkrolesIdLocationsCountEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeWorkrolesIdLocationsIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeWorkrolesIdLocationsIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeWorkrolesIdLocationsIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeWorkrolesIdLocationsIdEndpoint: The initialized TimeWorkrolesIdLocationsIdEndpoint object. """ child = TimeWorkrolesIdLocationsIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRoleLocation]: """ Performs a GET request against the /time/workRoles/{id}/locations endpoint and returns an initialized PaginatedResponse object. @@ -71,18 +58,11 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRoleLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkRoleLocation, self, page, page_size, params ) def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, + self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None ) -> list[WorkRoleLocation]: """ Performs a GET request against the /time/workRoles/{id}/locations endpoint. @@ -93,16 +73,9 @@ def get( Returns: list[WorkRoleLocation]: The parsed response data. """ - return self._parse_many( - WorkRoleLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + return self._parse_many(WorkRoleLocation, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleLocation: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleLocation: """ Performs a POST request against the /time/workRoles/{id}/locations endpoint. @@ -112,7 +85,4 @@ def post( Returns: WorkRoleLocation: The parsed response data. """ - return self._parse_one( - WorkRoleLocation, - super()._make_request("POST", data=data, params=params).json(), - ) + return self._parse_one(WorkRoleLocation, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsIdEndpoint.py index f9dc20b65..51d7117bc 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdLocationsIdEndpoint.py @@ -1,40 +1,31 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WorkRoleLocation from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesIdLocationsIdEndpoint( ConnectWiseEndpoint, IGettable[WorkRoleLocation, ConnectWiseManageRequestParams], - IPuttable[WorkRoleLocation, ConnectWiseManageRequestParams], IPatchable[WorkRoleLocation, ConnectWiseManageRequestParams], + IPuttable[WorkRoleLocation, ConnectWiseManageRequestParams], IPaginateable[WorkRoleLocation, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkRoleLocation) - IPuttable.__init__(self, WorkRoleLocation) IPatchable.__init__(self, WorkRoleLocation) + IPuttable.__init__(self, WorkRoleLocation) IPaginateable.__init__(self, WorkRoleLocation) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRoleLocation]: """ Performs a GET request against the /time/workRoles/{id}/locations/{id} endpoint and returns an initialized PaginatedResponse object. @@ -52,54 +43,34 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRoleLocation, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkRoleLocation, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleLocation: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/workRoles/{id}/locations/{id} endpoint. + Performs a DELETE request against the /time/workRoles/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WorkRoleLocation: The parsed response data. """ - return self._parse_one( - WorkRoleLocation, - super()._make_request("GET", data=data, params=params).json(), - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleLocation: """ - Performs a DELETE request against the /time/workRoles/{id}/locations/{id} endpoint. + Performs a GET request against the /time/workRoles/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WorkRoleLocation: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(WorkRoleLocation, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleLocation: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleLocation: """ - Performs a PUT request against the /time/workRoles/{id}/locations/{id} endpoint. + Performs a PATCH request against the /time/workRoles/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -107,18 +78,11 @@ def put( Returns: WorkRoleLocation: The parsed response data. """ - return self._parse_one( - WorkRoleLocation, - super()._make_request("PUT", data=data, params=params).json(), - ) + return self._parse_one(WorkRoleLocation, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkRoleLocation: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkRoleLocation: """ - Performs a PATCH request against the /time/workRoles/{id}/locations/{id} endpoint. + Performs a PUT request against the /time/workRoles/{id}/locations/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -126,7 +90,4 @@ def patch( Returns: WorkRoleLocation: The parsed response data. """ - return self._parse_one( - WorkRoleLocation, - super()._make_request("PATCH", data=data, params=params).json(), - ) + return self._parse_one(WorkRoleLocation, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesEndpoint.py index b8802eba7..f38314eed 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorkrolesIdUsagesListEndpoint import ( - TimeWorkrolesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeWorkrolesIdUsagesListEndpoint import TimeWorkrolesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class TimeWorkrolesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - TimeWorkrolesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(TimeWorkrolesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /time/workRoles/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /time/workRoles/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesListEndpoint.py index 9099c3eff..5988a895c 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class TimeWorkrolesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /time/workRoles/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /time/workRoles/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoCountEndpoint.py index 5da40d47a..1d15befd8 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesInfoCountEndpoint( @@ -16,18 +15,13 @@ class TimeWorkrolesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/workRoles/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/workRoles/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoEndpoint.py index 4786b3ece..0e0b1e2ec 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorkrolesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorkrolesInfoCountEndpoint import ( - TimeWorkrolesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeWorkrolesInfoCountEndpoint import TimeWorkrolesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkRoleInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorkrolesInfoEndpoint( @@ -19,22 +16,15 @@ class TimeWorkrolesInfoEndpoint( IGettable[list[WorkRoleInfo], ConnectWiseManageRequestParams], IPaginateable[WorkRoleInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkRoleInfo]) IPaginateable.__init__(self, WorkRoleInfo) - self.count = self._register_child_endpoint( - TimeWorkrolesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeWorkrolesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkRoleInfo]: """ Performs a GET request against the /time/workRoles/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkRoleInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkRoleInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[WorkRoleInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[WorkRoleInfo]: """ Performs a GET request against the /time/workRoles/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[WorkRoleInfo]: The parsed response data. """ - return self._parse_many( - WorkRoleInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(WorkRoleInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesCountEndpoint.py index f35a4941e..dbcb4195a 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesCountEndpoint( @@ -16,18 +15,13 @@ class TimeWorktypesCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/workTypes/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/workTypes/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesEndpoint.py index f3258ab95..c1a3200b0 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesEndpoint.py @@ -1,24 +1,16 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorktypesCountEndpoint import ( - TimeWorktypesCountEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorktypesIdEndpoint import ( - TimeWorktypesIdEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorktypesInfoEndpoint import ( - TimeWorktypesInfoEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPostable, -) +from pyconnectwise.endpoints.manage.TimeWorktypesCountEndpoint import TimeWorktypesCountEndpoint +from pyconnectwise.endpoints.manage.TimeWorktypesIdEndpoint import TimeWorktypesIdEndpoint +from pyconnectwise.endpoints.manage.TimeWorktypesInfoEndpoint import TimeWorktypesInfoEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPostable from pyconnectwise.models.manage import WorkType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesEndpoint( @@ -27,39 +19,30 @@ class TimeWorktypesEndpoint( IPostable[WorkType, ConnectWiseManageRequestParams], IPaginateable[WorkType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "workTypes", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "workTypes", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkType]) IPostable.__init__(self, WorkType) IPaginateable.__init__(self, WorkType) - self.count = self._register_child_endpoint( - TimeWorktypesCountEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - TimeWorktypesInfoEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeWorktypesCountEndpoint(client, parent_endpoint=self)) + self.info = self._register_child_endpoint(TimeWorktypesInfoEndpoint(client, parent_endpoint=self)) - def id(self, id: int) -> TimeWorktypesIdEndpoint: # noqa: A002 + def id(self, _id: int) -> TimeWorktypesIdEndpoint: """ Sets the ID for this endpoint and returns an initialized TimeWorktypesIdEndpoint object to move down the chain. Parameters: - id (int): The ID to set. + _id (int): The ID to set. Returns: TimeWorktypesIdEndpoint: The initialized TimeWorktypesIdEndpoint object. """ child = TimeWorktypesIdEndpoint(self.client, parent_endpoint=self) - child._id = id + child._id = _id return child def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkType]: """ Performs a GET request against the /time/workTypes endpoint and returns an initialized PaginatedResponse object. @@ -76,20 +59,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - WorkType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), WorkType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[WorkType]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[WorkType]: """ Performs a GET request against the /time/workTypes endpoint. @@ -99,15 +71,9 @@ def get( Returns: list[WorkType]: The parsed response data. """ - return self._parse_many( - WorkType, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(WorkType, super()._make_request("GET", data=data, params=params).json()) - def post( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkType: + def post(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkType: """ Performs a POST request against the /time/workTypes endpoint. @@ -117,6 +83,4 @@ def post( Returns: WorkType: The parsed response data. """ - return self._parse_one( - WorkType, super()._make_request("POST", data=data, params=params).json() - ) + return self._parse_one(WorkType, super()._make_request("POST", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdEndpoint.py index 9fd729686..95fe41f55 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdEndpoint.py @@ -1,53 +1,36 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorktypesIdInfoEndpoint import ( - TimeWorktypesIdInfoEndpoint, -) -from pyconnectwise.endpoints.manage.TimeWorktypesIdUsagesEndpoint import ( - TimeWorktypesIdUsagesEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, - IPatchable, - IPuttable, -) +from pyconnectwise.endpoints.manage.TimeWorktypesIdInfoEndpoint import TimeWorktypesIdInfoEndpoint +from pyconnectwise.endpoints.manage.TimeWorktypesIdUsagesEndpoint import TimeWorktypesIdUsagesEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable, IPatchable, IPuttable from pyconnectwise.models.manage import WorkType from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, - PatchRequestData, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, PatchRequestData + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesIdEndpoint( ConnectWiseEndpoint, IGettable[WorkType, ConnectWiseManageRequestParams], - IPuttable[WorkType, ConnectWiseManageRequestParams], IPatchable[WorkType, ConnectWiseManageRequestParams], + IPuttable[WorkType, ConnectWiseManageRequestParams], IPaginateable[WorkType, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "{id}", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{id}", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkType) - IPuttable.__init__(self, WorkType) IPatchable.__init__(self, WorkType) + IPuttable.__init__(self, WorkType) IPaginateable.__init__(self, WorkType) - self.usages = self._register_child_endpoint( - TimeWorktypesIdUsagesEndpoint(client, parent_endpoint=self) - ) - self.info = self._register_child_endpoint( - TimeWorktypesIdInfoEndpoint(client, parent_endpoint=self) - ) + self.info = self._register_child_endpoint(TimeWorktypesIdInfoEndpoint(client, parent_endpoint=self)) + self.usages = self._register_child_endpoint(TimeWorktypesIdUsagesEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkType]: """ Performs a GET request against the /time/workTypes/{id} endpoint and returns an initialized PaginatedResponse object. @@ -64,54 +47,33 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - WorkType, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), WorkType, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkType: + def delete(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> None: """ - Performs a GET request against the /time/workTypes/{id} endpoint. + Performs a DELETE request against the /time/workTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - WorkType: The parsed response data. """ - return self._parse_one( - WorkType, super()._make_request("GET", data=data, params=params).json() - ) + super()._make_request("DELETE", data=data, params=params) - def delete( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> None: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkType: """ - Performs a DELETE request against the /time/workTypes/{id} endpoint. + Performs a GET request against the /time/workTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + WorkType: The parsed response data. """ - super()._make_request("DELETE", data=data, params=params) + return self._parse_one(WorkType, super()._make_request("GET", data=data, params=params).json()) - def put( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkType: + def patch(self, data: PatchRequestData, params: ConnectWiseManageRequestParams | None = None) -> WorkType: """ - Performs a PUT request against the /time/workTypes/{id} endpoint. + Performs a PATCH request against the /time/workTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -119,17 +81,11 @@ def put( Returns: WorkType: The parsed response data. """ - return self._parse_one( - WorkType, super()._make_request("PUT", data=data, params=params).json() - ) + return self._parse_one(WorkType, super()._make_request("PATCH", data=data, params=params).json()) - def patch( - self, - data: PatchRequestData, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkType: + def put(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkType: """ - Performs a PATCH request against the /time/workTypes/{id} endpoint. + Performs a PUT request against the /time/workTypes/{id} endpoint. Parameters: data (dict[str, Any]): The data to send in the request body. @@ -137,6 +93,4 @@ def patch( Returns: WorkType: The parsed response data. """ - return self._parse_one( - WorkType, super()._make_request("PATCH", data=data, params=params).json() - ) + return self._parse_one(WorkType, super()._make_request("PUT", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdInfoEndpoint.py index 92a9416b6..9b2673df0 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdInfoEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesIdInfoEndpoint( @@ -16,18 +15,13 @@ class TimeWorktypesIdInfoEndpoint( IGettable[WorkTypeInfo, ConnectWiseManageRequestParams], IPaginateable[WorkTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, WorkTypeInfo) IPaginateable.__init__(self, WorkTypeInfo) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkTypeInfo]: """ Performs a GET request against the /time/workTypes/{id}/info endpoint and returns an initialized PaginatedResponse object. @@ -45,19 +39,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> WorkTypeInfo: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> WorkTypeInfo: """ Performs a GET request against the /time/workTypes/{id}/info endpoint. @@ -67,6 +52,4 @@ def get( Returns: WorkTypeInfo: The parsed response data. """ - return self._parse_one( - WorkTypeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(WorkTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesEndpoint.py index fde2d90fe..4efbb1113 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorktypesIdUsagesListEndpoint import ( - TimeWorktypesIdUsagesListEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeWorktypesIdUsagesListEndpoint import TimeWorktypesIdUsagesListEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesIdUsagesEndpoint( @@ -19,22 +16,15 @@ class TimeWorktypesIdUsagesEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "usages", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "usages", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) - self.list = self._register_child_endpoint( - TimeWorktypesIdUsagesListEndpoint(client, parent_endpoint=self) - ) + self.list = self._register_child_endpoint(TimeWorktypesIdUsagesListEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /time/workTypes/{id}/usages endpoint and returns an initialized PaginatedResponse object. @@ -51,20 +41,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /time/workTypes/{id}/usages endpoint. @@ -74,6 +53,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesListEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesListEndpoint.py index 4ecdb5bbe..e5a55cd33 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesListEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesIdUsagesListEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Usage from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesIdUsagesListEndpoint( @@ -16,18 +15,13 @@ class TimeWorktypesIdUsagesListEndpoint( IGettable[list[Usage], ConnectWiseManageRequestParams], IPaginateable[Usage, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "list", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "list", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[Usage]) IPaginateable.__init__(self, Usage) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Usage]: """ Performs a GET request against the /time/workTypes/{id}/usages/list endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Usage, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Usage, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[Usage]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[Usage]: """ Performs a GET request against the /time/workTypes/{id}/usages/list endpoint. @@ -67,6 +50,4 @@ def get( Returns: list[Usage]: The parsed response data. """ - return self._parse_many( - Usage, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(Usage, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoCountEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoCountEndpoint.py index 892107a55..3e074f47b 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoCountEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoCountEndpoint.py @@ -1,14 +1,13 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import Count from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesInfoCountEndpoint( @@ -16,18 +15,13 @@ class TimeWorktypesInfoCountEndpoint( IGettable[Count, ConnectWiseManageRequestParams], IPaginateable[Count, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "count", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "count", parent_endpoint=parent_endpoint) IGettable.__init__(self, Count) IPaginateable.__init__(self, Count) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[Count]: """ Performs a GET request against the /time/workTypes/info/count endpoint and returns an initialized PaginatedResponse object. @@ -44,20 +38,9 @@ def paginated( params["pageSize"] = page_size else: params = {"page": page, "pageSize": page_size} - return PaginatedResponse( - super()._make_request("GET", params=params), - Count, - self, - page, - page_size, - params, - ) + return PaginatedResponse(super()._make_request("GET", params=params), Count, self, page, page_size, params) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> Count: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> Count: """ Performs a GET request against the /time/workTypes/info/count endpoint. @@ -67,6 +50,4 @@ def get( Returns: Count: The parsed response data. """ - return self._parse_one( - Count, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_one(Count, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoEndpoint.py b/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoEndpoint.py index c28177c16..2fb0bd03c 100644 --- a/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoEndpoint.py +++ b/src/pyconnectwise/endpoints/manage/TimeWorktypesInfoEndpoint.py @@ -1,17 +1,14 @@ +from typing import TYPE_CHECKING + from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.endpoints.manage.TimeWorktypesInfoCountEndpoint import ( - TimeWorktypesInfoCountEndpoint, -) -from pyconnectwise.interfaces import ( - IGettable, - IPaginateable, -) +from pyconnectwise.endpoints.manage.TimeWorktypesInfoCountEndpoint import TimeWorktypesInfoCountEndpoint +from pyconnectwise.interfaces import IGettable, IPaginateable from pyconnectwise.models.manage import WorkTypeInfo from pyconnectwise.responses.paginated_response import PaginatedResponse -from pyconnectwise.types import ( - JSON, - ConnectWiseManageRequestParams, -) +from pyconnectwise.types import JSON, ConnectWiseManageRequestParams + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient class TimeWorktypesInfoEndpoint( @@ -19,22 +16,15 @@ class TimeWorktypesInfoEndpoint( IGettable[list[WorkTypeInfo], ConnectWiseManageRequestParams], IPaginateable[WorkTypeInfo, ConnectWiseManageRequestParams], ): - def __init__(self, client, parent_endpoint=None) -> None: # noqa: ANN001 - ConnectWiseEndpoint.__init__( - self, client, "info", parent_endpoint=parent_endpoint - ) + def __init__(self, client: "ConnectWiseClient", parent_endpoint: ConnectWiseEndpoint = None) -> None: + ConnectWiseEndpoint.__init__(self, client, "info", parent_endpoint=parent_endpoint) IGettable.__init__(self, list[WorkTypeInfo]) IPaginateable.__init__(self, WorkTypeInfo) - self.count = self._register_child_endpoint( - TimeWorktypesInfoCountEndpoint(client, parent_endpoint=self) - ) + self.count = self._register_child_endpoint(TimeWorktypesInfoCountEndpoint(client, parent_endpoint=self)) def paginated( - self, - page: int, - page_size: int, - params: ConnectWiseManageRequestParams | None = None, + self, page: int, page_size: int, params: ConnectWiseManageRequestParams | None = None ) -> PaginatedResponse[WorkTypeInfo]: """ Performs a GET request against the /time/workTypes/info endpoint and returns an initialized PaginatedResponse object. @@ -52,19 +42,10 @@ def paginated( else: params = {"page": page, "pageSize": page_size} return PaginatedResponse( - super()._make_request("GET", params=params), - WorkTypeInfo, - self, - page, - page_size, - params, + super()._make_request("GET", params=params), WorkTypeInfo, self, page, page_size, params ) - def get( - self, - data: JSON | None = None, - params: ConnectWiseManageRequestParams | None = None, - ) -> list[WorkTypeInfo]: + def get(self, data: JSON | None = None, params: ConnectWiseManageRequestParams | None = None) -> list[WorkTypeInfo]: """ Performs a GET request against the /time/workTypes/info endpoint. @@ -74,6 +55,4 @@ def get( Returns: list[WorkTypeInfo]: The parsed response data. """ - return self._parse_many( - WorkTypeInfo, super()._make_request("GET", data=data, params=params).json() - ) + return self._parse_many(WorkTypeInfo, super()._make_request("GET", data=data, params=params).json()) diff --git a/src/pyconnectwise/exceptions.py b/src/pyconnectwise/exceptions.py index 9adfa974d..46e6ff1d7 100644 --- a/src/pyconnectwise/exceptions.py +++ b/src/pyconnectwise/exceptions.py @@ -7,12 +7,11 @@ class ConnectWiseException(Exception): # noqa: N818 _code_explanation: ClassVar[str] = "" # Ex: for 404 "Not Found" - _error_suggestion: ClassVar[ - str - ] = "" # Ex: for 404 "Check the URL you are using is correct" + _error_suggestion: ClassVar[str] = "" # Ex: for 404 "Check the URL you are using is correct" - def __init__(self, req_response: Response) -> None: + def __init__(self, req_response: Response, *, extra_message: str = "") -> None: self.response = req_response + self.extra_message = extra_message super().__init__(self.message()) def _get_sanitized_url(self) -> str: @@ -40,8 +39,8 @@ def details(self) -> str: def message(self) -> str: return ( f"A HTTP {self.response.status_code} ({self._code_explanation}) error has occurred while requesting" - f" {self._get_sanitized_url()}.\n{self.response.reason}\n{self._error_suggestion}" - ) + f" {self._get_sanitized_url()}.\n{self.response.reason}\n{self._error_suggestion}\n{self.extra_message}" + ).strip() # Remove extra whitespace (Ex: if extra_message == "") class MalformedRequestException(ConnectWiseException): @@ -64,24 +63,23 @@ class PermissionsFailedException(ConnectWiseException): class NotFoundException(ConnectWiseException): _code_explanation = "Not Found" - _error_suggestion = ( - "You may be attempting to access a resource that has been moved or deleted." - ) + _error_suggestion = "You may be attempting to access a resource that has been moved or deleted." class MethodNotAllowedException(ConnectWiseException): _code_explanation = "Method Not Allowed" - _error_suggestion = ( - "This resource does not support the HTTP method you are trying to use." - ) + _error_suggestion = "This resource does not support the HTTP method you are trying to use." class ConflictException(ConnectWiseException): _code_explanation = "Conflict" - _error_suggestion = ( - "This resource is possibly in use or conflicts with another record." - ) + _error_suggestion = "This resource is possibly in use or conflicts with another record." class ServerError(ConnectWiseException): _code_explanation = "Internal Server Error" + + +class ObjectExistsError(ConnectWiseException): + _code_explanation = "Object Exists" + _error_suggestion = "This resource already exists." diff --git a/src/pyconnectwise/interfaces.py b/src/pyconnectwise/interfaces.py index fbcbdc703..0450c3a42 100644 --- a/src/pyconnectwise/interfaces.py +++ b/src/pyconnectwise/interfaces.py @@ -1,12 +1,13 @@ from abc import ABC, abstractmethod +from typing import TYPE_CHECKING, Generic, TypeVar + +from pyconnectwise.responses.paginated_response import PaginatedResponse from pyconnectwise.types import ( - ConnectWiseManageRequestParams, - ConnectWiseAutomateRequestParams, JSON, + ConnectWiseAutomateRequestParams, + ConnectWiseManageRequestParams, PatchRequestData, ) -from typing import TypeVar, TYPE_CHECKING, Generic -from pyconnectwise.responses.paginated_response import PaginatedResponse if TYPE_CHECKING: from pydantic import BaseModel diff --git a/src/pyconnectwise/models/automate/__init__.py b/src/pyconnectwise/models/automate/__init__.py index 988638087..d6795674f 100644 --- a/src/pyconnectwise/models/automate/__init__.py +++ b/src/pyconnectwise/models/automate/__init__.py @@ -14,9 +14,7 @@ class LabTechQueryOptionOrderBy(ConnectWiseModel): name: str | None = Field(default=None, alias="Name") - type: Literal["Undefined", "Ascending", "Descending"] | None = Field( - default=None, alias="Type" - ) + type: Literal["Undefined", "Ascending", "Descending"] | None = Field(default=None, alias="Type") class LabTechQueryOptionExpand(ConnectWiseModel): @@ -24,9 +22,7 @@ class LabTechQueryOptionExpand(ConnectWiseModel): page: int | None = Field(default=None, alias="Page") page_size: int | None = Field(default=None, alias="PageSize") condition: str | None = Field(default=None, alias="Condition") - expands: dict[str, LabTechQueryOptionExpand] | None = Field( - default=None, alias="Expands" - ) + expands: dict[str, LabTechQueryOptionExpand] | None = Field(default=None, alias="Expands") order_by: LabTechQueryOptionOrderBy | None = Field(default=None, alias="OrderBy") included_fields: list[str] | None = Field(default=None, alias="IncludedFields") excluded_fields: list[str] | None = Field(default=None, alias="ExcludedFields") @@ -78,9 +74,7 @@ class AutomateAuthService(ConnectWiseModel): is_automatic: bool | None = Field(default=None, alias="IsAutomatic") service_guid: str | None = Field(default=None, alias="ServiceGuid") is_enabled: bool | None = Field(default=None, alias="IsEnabled") - is_local_login_enabled: bool | None = Field( - default=None, alias="IsLocalLoginEnabled" - ) + is_local_login_enabled: bool | None = Field(default=None, alias="IsLocalLoginEnabled") authentication_type: int | None = Field(default=None, alias="AuthenticationType") @@ -94,17 +88,11 @@ class AutomateTokenResult(ConnectWiseModel): access_token: str | None = Field(default=None, alias="AccessToken") token_type: str | None = Field(default=None, alias="TokenType") expiration_date: datetime | None = Field(default=None, alias="ExpirationDate") - absolute_expiration_date: datetime | None = Field( - default=None, alias="AbsoluteExpirationDate" - ) + absolute_expiration_date: datetime | None = Field(default=None, alias="AbsoluteExpirationDate") user_id: str | None = Field(default=None, alias="UserId") internal_user_name: str | None = Field(default=None, alias="InternalUserName") - is_two_factor_required: bool | None = Field( - default=None, alias="IsTwoFactorRequired" - ) - is_internal_two_factor_required: bool | None = Field( - default=None, alias="IsInternalTwoFactorRequired" - ) + is_two_factor_required: bool | None = Field(default=None, alias="IsTwoFactorRequired") + is_internal_two_factor_required: bool | None = Field(default=None, alias="IsInternalTwoFactorRequired") sso_access_token: str | None = Field(default=None, alias="SSOAccessToken") @@ -138,9 +126,7 @@ class LabTechPatchOperation(ConnectWiseModel): class AutomateApprovalPolicyStats(ConnectWiseModel): approval_policy_id: int | None = Field(default=None, alias="ApprovalPolicyId") approval_policy_name: str | None = Field(default=None, alias="ApprovalPolicyName") - pending_approval_count: int | None = Field( - default=None, alias="PendingApprovalCount" - ) + pending_approval_count: int | None = Field(default=None, alias="PendingApprovalCount") class AutomateContactAssociatedComputer(ConnectWiseModel): @@ -148,9 +134,7 @@ class AutomateContactAssociatedComputer(ConnectWiseModel): computer_name: str | None = Field(default=None, alias="ComputerName") has_primary_contact: bool | None = Field(default=None, alias="HasPrimaryContact") is_primary_contact: bool | None = Field(default=None, alias="IsPrimaryContact") - can_user_set_primary_status: bool | None = Field( - default=None, alias="CanUserSetPrimaryStatus" - ) + can_user_set_primary_status: bool | None = Field(default=None, alias="CanUserSetPrimaryStatus") client_name: str | None = Field(default=None, alias="ClientName") location_name: str | None = Field(default=None, alias="LocationName") @@ -162,9 +146,7 @@ class AutomateSetComputerPrimaryContactRequest(ConnectWiseModel): class LabTechUserAuthLinkStatus(ConnectWiseModel): service_id: int | None = Field(default=None, alias="ServiceId") is_sso_enabled: bool | None = Field(default=None, alias="IsSsoEnabled") - is_local_login_enabled: bool | None = Field( - default=None, alias="IsLocalLoginEnabled" - ) + is_local_login_enabled: bool | None = Field(default=None, alias="IsLocalLoginEnabled") is_eligible_for_sso: bool | None = Field(default=None, alias="IsEligibleForSso") is_account_linked: bool | None = Field(default=None, alias="IsAccountLinked") @@ -196,14 +178,14 @@ class LabTechAVTemplatePolicyData(ConnectWiseModel): class AutomateAiAssistSettingBatchRequest(ConnectWiseModel): - ai_assist_setting_guids: list[UUID] | None = Field( - default=None, alias="AiAssistSettingGuids" - ) + ai_assist_setting_guids: list[UUID] | None = Field(default=None, alias="AiAssistSettingGuids") class AutomateHotfixOperatingSystemCombination(ConnectWiseModel): hotfix_id: UUID | None = Field( - default=None, alias="HotfixId", example="00000000-0000-0000-0000-000000000000" + default=None, + alias="HotfixId", + examples=["00000000-0000-0000-0000-000000000000"], ) operating_system: str | None = Field(default=None, alias="OperatingSystem") @@ -211,7 +193,9 @@ class AutomateHotfixOperatingSystemCombination(ConnectWiseModel): class AutomateWindowsApprovalPolicyPatch(ConnectWiseModel): approval_action_id: int | None = Field(default=None, alias="ApprovalActionId") hotfix_id: UUID | None = Field( - default=None, alias="HotfixId", example="00000000-0000-0000-0000-000000000000" + default=None, + alias="HotfixId", + examples=["00000000-0000-0000-0000-000000000000"], ) operating_system: str | None = Field(default=None, alias="OperatingSystem") @@ -221,21 +205,17 @@ class AutomateApprovalPolicyThirdPartyPatchSetting(ConnectWiseModel): lt_product_key: UUID | None = Field( default=None, alias="LTProductKey", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) version: str | None = Field(default=None, alias="Version") class AutomateBinaryExtensionBatchRequest(ConnectWiseModel): - binary_extension_ids: list[int] | None = Field( - default=None, alias="BinaryExtensionIds" - ) + binary_extension_ids: list[int] | None = Field(default=None, alias="BinaryExtensionIds") class AutomateWebClientAccessBatchRequest(ConnectWiseModel): - request_type: Literal["Invite", "Reset"] | None = Field( - default=None, alias="RequestType" - ) + request_type: Literal["Invite", "Reset"] | None = Field(default=None, alias="RequestType") entity_type: Literal[ "System", "Computer", @@ -276,18 +256,14 @@ class AutomateResponseResult(ConnectWiseModel): class AutomateContactPermissionBatchRequest(ConnectWiseModel): - request_type: Literal["Add", "Remove"] | None = Field( - default=None, alias="RequestType" - ) + request_type: Literal["Add", "Remove"] | None = Field(default=None, alias="RequestType") contact_ids: list[int] | None = Field(default=None, alias="ContactIds") permissions: list[str] | None = Field(default=None, alias="Permissions") class AutomateContactPermissionBatchResult(ConnectWiseModel): contact_id: int | None = Field(default=None, alias="ContactId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateGeneratePasswordResetTokenBatchRequest(ConnectWiseModel): @@ -330,33 +306,27 @@ class AutomateExecuteResendInventoryCommandBatchRequest(ConnectWiseModel): class AutomateDeleteIpRestrictionsBatchRequest(ConnectWiseModel): - ip_restrictions_ids: list[UUID] | None = Field( - default=None, alias="IpRestrictionsIds" - ) + ip_restrictions_ids: list[UUID] | None = Field(default=None, alias="IpRestrictionsIds") class AutomateDeleteIpRestrictionsBatchResult(ConnectWiseModel): ip_restrictions_id: UUID | None = Field( default=None, alias="IpRestrictionsId", - example="00000000-0000-0000-0000-000000000000", - ) - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" + examples=["00000000-0000-0000-0000-000000000000"], ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateIpRestrictionRule(ConnectWiseModel): ip_address_guid: UUID | None = Field( default=None, alias="IpAddressGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) name: str | None = Field(default=None, alias="Name") ip_address: str | None = Field(default=None, alias="IpAddress") - windows_client_access: bool | None = Field( - default=None, alias="WindowsClientAccess" - ) + windows_client_access: bool | None = Field(default=None, alias="WindowsClientAccess") web_client_access: bool | None = Field(default=None, alias="WebClientAccess") created_by: str | None = Field(default=None, alias="CreatedBy") create_date: datetime | None = Field(default=None, alias="CreateDate") @@ -368,17 +338,13 @@ class AutomateAddIpRestrictionsBatchResult(ConnectWiseModel): ip_address_guid: UUID | None = Field( default=None, alias="IpAddressGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) name: str | None = Field(default=None, alias="Name") ip_address: str | None = Field(default=None, alias="IpAddress") - windows_client_access: bool | None = Field( - default=None, alias="WindowsClientAccess" - ) + windows_client_access: bool | None = Field(default=None, alias="WindowsClientAccess") web_client_access: bool | None = Field(default=None, alias="WebClientAccess") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateMaintenanceModeQueueBatchRequest(ConnectWiseModel): @@ -460,9 +426,7 @@ class AutomateExecuteProbeBatchRequest(ConnectWiseModel): class AutomateExecuteProbeCommandResult(ConnectWiseModel): probe_id: int | None = Field(default=None, alias="ProbeId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateDeleteRemoteMonitorsBatchRequest(ConnectWiseModel): @@ -472,23 +436,17 @@ class AutomateDeleteRemoteMonitorsBatchRequest(ConnectWiseModel): class AutomateDeleteRemoteMonitorBatchResult(ConnectWiseModel): remote_monitor_id: int | None = Field(default=None, alias="RemoteMonitorId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateScheduledScriptOfflineActionFlags(ConnectWiseModel): skips_offline_agents: bool | None = Field(default=None, alias="SkipsOfflineAgents") wakes_offline_agents: bool | None = Field(default=None, alias="WakesOfflineAgents") - only_runs_on_offline_agents: bool | None = Field( - default=None, alias="OnlyRunsOnOfflineAgents" - ) + only_runs_on_offline_agents: bool | None = Field(default=None, alias="OnlyRunsOnOfflineAgents") class AutomateScriptScheduleFrequency(ConnectWiseModel): - script_schedule_frequency_id: int | None = Field( - default=None, alias="ScriptScheduleFrequencyId" - ) + script_schedule_frequency_id: int | None = Field(default=None, alias="ScriptScheduleFrequencyId") name: str | None = Field(default=None, alias="Name") @@ -511,9 +469,7 @@ class AutomateMonthlyScheduleFrequency(ConnectWiseModel): class AutomateDistributionWindowType(ConnectWiseModel): - distribution_window_type_id: int | None = Field( - default=None, alias="DistributionWindowTypeId" - ) + distribution_window_type_id: int | None = Field(default=None, alias="DistributionWindowTypeId") name: str | None = Field(default=None, alias="Name") @@ -536,17 +492,13 @@ class AutomateWeeksOfMonthSettings(ConnectWiseModel): class AutomateDailyScriptRepeatFrequency(ConnectWiseModel): - daily_script_repeat_frequency_id: int | None = Field( - default=None, alias="DailyScriptRepeatFrequencyId" - ) + daily_script_repeat_frequency_id: int | None = Field(default=None, alias="DailyScriptRepeatFrequencyId") name: str | None = Field(default=None, alias="Name") class AutomateScheduleScriptBatchResult(ConnectWiseModel): entity_id: int | None = Field(default=None, alias="EntityId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateDeleteScriptBatchRequest(ConnectWiseModel): @@ -555,9 +507,7 @@ class AutomateDeleteScriptBatchRequest(ConnectWiseModel): class AutomateDeleteScriptBatchResult(ConnectWiseModel): script_id: int | None = Field(default=None, alias="ScriptId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateDeleteSearchesBatchRequest(ConnectWiseModel): @@ -567,9 +517,7 @@ class AutomateDeleteSearchesBatchRequest(ConnectWiseModel): class AutomateDeleteSearchesBatchResult(ConnectWiseModel): search_id: int | None = Field(default=None, alias="SearchId") search_name: str | None = Field(default=None, alias="SearchName") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateSendToSearchesBatchRequest(ConnectWiseModel): @@ -579,9 +527,7 @@ class AutomateSendToSearchesBatchRequest(ConnectWiseModel): class AutomateSendToBatchResult(ConnectWiseModel): search_id: int | None = Field(default=None, alias="SearchId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateSendToCommandBatchRequest(ConnectWiseModel): @@ -721,9 +667,7 @@ class AutomateExecuteRebootCommandBatchRequest(ConnectWiseModel): class AutomateExecuteComputerCommandResult(ConnectWiseModel): computer_id: int | None = Field(default=None, alias="ComputerId") command_id: int | None = Field(default=None, alias="CommandId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateExecuteToggleProbeCommandBatchRequest(ConnectWiseModel): @@ -786,9 +730,7 @@ class LabTechCacheControl(ConnectWiseModel): functions: datetime | None = Field(default=None, alias="Functions") redirectors: datetime | None = Field(default=None, alias="Redirectors") virus_scanners: datetime | None = Field(default=None, alias="VirusScanners") - control_center_config: datetime | None = Field( - default=None, alias="ControlCenterConfig" - ) + control_center_config: datetime | None = Field(default=None, alias="ControlCenterConfig") properties: datetime | None = Field(default=None, alias="Properties") config: datetime | None = Field(default=None, alias="Config") regions: datetime | None = Field(default=None, alias="Regions") @@ -799,9 +741,7 @@ class LabTechCacheControl(ConnectWiseModel): groups: datetime | None = Field(default=None, alias="Groups") agents: datetime | None = Field(default=None, alias="Agents") permissions: datetime | None = Field(default=None, alias="Permissions") - write_config_control: datetime | None = Field( - default=None, alias="WriteConfigControl" - ) + write_config_control: datetime | None = Field(default=None, alias="WriteConfigControl") alert_templates: datetime | None = Field(default=None, alias="AlertTemplates") role_definitions: datetime | None = Field(default=None, alias="RoleDefinitions") @@ -820,25 +760,17 @@ class LabTechComputerChassis(ConnectWiseModel): asset_tag: str | None = Field(default=None, alias="AssetTag") height_units: int | None = Field(default=None, alias="HeightUnits") system_boot_state: int | None = Field(default=None, alias="SystemBootState") - power_supply_boot_state: int | None = Field( - default=None, alias="PowerSupplyBootState" - ) + power_supply_boot_state: int | None = Field(default=None, alias="PowerSupplyBootState") thermal_boot_state: int | None = Field(default=None, alias="ThermalBootState") main_board_product: str | None = Field(default=None, alias="MainBoardProduct") - main_board_serial_number: str | None = Field( - default=None, alias="MainBoardSerialNumber" - ) + main_board_serial_number: str | None = Field(default=None, alias="MainBoardSerialNumber") main_board_version: str | None = Field(default=None, alias="MainBoardVersion") - main_board_manufacturer: str | None = Field( - default=None, alias="MainBoardManufacturer" - ) + main_board_manufacturer: str | None = Field(default=None, alias="MainBoardManufacturer") last_update: datetime | None = Field(default=None, alias="LastUpdate") class AutomateFilterByComputerPermissionsRequest(ConnectWiseModel): - computer_permissions: list[str] | None = Field( - default=None, alias="ComputerPermissions" - ) + computer_permissions: list[str] | None = Field(default=None, alias="ComputerPermissions") class LabTechRouter(ConnectWiseModel): @@ -853,9 +785,7 @@ class LabTechRouter(ConnectWiseModel): class LabTechMaintenanceWindowDefinition(ConnectWiseModel): - maintenance_window_definition_id: int | None = Field( - default=None, alias="MaintenanceWindowDefinitionId" - ) + maintenance_window_definition_id: int | None = Field(default=None, alias="MaintenanceWindowDefinitionId") name: str | None = Field(default=None, alias="Name") comment: str | None = Field(default=None, alias="Comment") @@ -872,9 +802,7 @@ class LabTechContactWebPermissions(ConnectWiseModel): reboot: bool | None = Field(default=None, alias="Reboot") shutdown: bool | None = Field(default=None, alias="Shutdown") wake_on_lan: bool | None = Field(default=None, alias="WakeOnLAN") - multi_factor_required: bool | None = Field( - default=None, alias="MultiFactorRequired" - ) + multi_factor_required: bool | None = Field(default=None, alias="MultiFactorRequired") class LabTechSchedule(ConnectWiseModel): @@ -962,9 +890,7 @@ class LabTechComputerPermissions(ConnectWiseModel): monitor_edit: bool | None = Field(default=None, alias="MonitorEdit") clear_alerts: bool | None = Field(default=None, alias="ClearAlerts") schedule_scripts: bool | None = Field(default=None, alias="ScheduleScripts") - delete_schedule_scripts: bool | None = Field( - default=None, alias="DeleteScheduleScripts" - ) + delete_schedule_scripts: bool | None = Field(default=None, alias="DeleteScheduleScripts") class LabTechNetworkDeviceType(AutomateAlertClient): @@ -986,25 +912,15 @@ class LabTechExternalSystemCredentials(ConnectWiseModel): class LabTechAgentDeploymentReadinessCheck(ConnectWiseModel): - agent_deployment_readiness_check_id: int | None = Field( - default=None, alias="AgentDeploymentReadinessCheckId" - ) + agent_deployment_readiness_check_id: int | None = Field(default=None, alias="AgentDeploymentReadinessCheckId") network_device_id: int | None = Field(default=None, alias="NetworkDeviceId") agent_deployment_readiness_check_status_id: int | None = Field( default=None, alias="AgentDeploymentReadinessCheckStatusId" ) - readiness_check_status: str | None = Field( - default=None, alias="ReadinessCheckStatus" - ) - deployment_attempt_count: int | None = Field( - default=None, alias="DeploymentAttemptCount" - ) - date_last_checked_for_readiness: datetime | None = Field( - default=None, alias="DateLastCheckedForReadiness" - ) - date_last_deployment_attempted: datetime | None = Field( - default=None, alias="DateLastDeploymentAttempted" - ) + readiness_check_status: str | None = Field(default=None, alias="ReadinessCheckStatus") + deployment_attempt_count: int | None = Field(default=None, alias="DeploymentAttemptCount") + date_last_checked_for_readiness: datetime | None = Field(default=None, alias="DateLastCheckedForReadiness") + date_last_deployment_attempted: datetime | None = Field(default=None, alias="DateLastDeploymentAttempted") class LabTechTicketStatus(AutomateAlertClient): @@ -1068,12 +984,8 @@ class LabTechUserPermissions(ConnectWiseModel): user_class_update: bool | None = Field(default=None, alias="UserClassUpdate") patch_manager_config: bool | None = Field(default=None, alias="PatchManagerConfig") reports_create: bool | None = Field(default=None, alias="ReportsCreate") - probe_template_execute: bool | None = Field( - default=None, alias="ProbeTemplateExecute" - ) - scheduled_scripts_update: bool | None = Field( - default=None, alias="ScheduledScriptsUpdate" - ) + probe_template_execute: bool | None = Field(default=None, alias="ProbeTemplateExecute") + scheduled_scripts_update: bool | None = Field(default=None, alias="ScheduledScriptsUpdate") clients_show_all: bool | None = Field(default=None, alias="ClientsShowAll") show_passwords: bool | None = Field(default=None, alias="ShowPasswords") locations_show_all: bool | None = Field(default=None, alias="LocationsShowAll") @@ -1081,49 +993,23 @@ class LabTechUserPermissions(ConnectWiseModel): computers_update: bool | None = Field(default=None, alias="ComputersUpdate") computers_delete: bool | None = Field(default=None, alias="ComputersDelete") computers_show_all: bool | None = Field(default=None, alias="ComputersShowAll") - computers_force_update: bool | None = Field( - default=None, alias="ComputersForceUpdate" - ) - network_device_update: bool | None = Field( - default=None, alias="NetworkDeviceUpdate" - ) - network_device_delete: bool | None = Field( - default=None, alias="NetworkDeviceDelete" - ) - network_device_show_all: bool | None = Field( - default=None, alias="NetworkDeviceShowAll" - ) - retired_assets_delete: bool | None = Field( - default=None, alias="RetiredAssetsDelete" - ) + computers_force_update: bool | None = Field(default=None, alias="ComputersForceUpdate") + network_device_update: bool | None = Field(default=None, alias="NetworkDeviceUpdate") + network_device_delete: bool | None = Field(default=None, alias="NetworkDeviceDelete") + network_device_show_all: bool | None = Field(default=None, alias="NetworkDeviceShowAll") + retired_assets_delete: bool | None = Field(default=None, alias="RetiredAssetsDelete") groups_create: bool | None = Field(default=None, alias="GroupsCreate") groups_delete: bool | None = Field(default=None, alias="GroupsDelete") groups_show_all: bool | None = Field(default=None, alias="GroupsShowAll") - groups_schedule_script: bool | None = Field( - default=None, alias="GroupsScheduleScript" - ) - group_monitors_update: bool | None = Field( - default=None, alias="GroupMonitorsUpdate" - ) + groups_schedule_script: bool | None = Field(default=None, alias="GroupsScheduleScript") + group_monitors_update: bool | None = Field(default=None, alias="GroupMonitorsUpdate") group_info_update: bool | None = Field(default=None, alias="GroupInfoUpdate") - group_managed_services: bool | None = Field( - default=None, alias="GroupManagedServices" - ) - remote_monitors_create: bool | None = Field( - default=None, alias="RemoteMonitorsCreate" - ) - remote_monitors_delete: bool | None = Field( - default=None, alias="RemoteMonitorsDelete" - ) - internal_monitors_create: bool | None = Field( - default=None, alias="InternalMonitorsCreate" - ) - internal_monitors_update: bool | None = Field( - default=None, alias="InternalMonitorsUpdate" - ) - internal_monitors_delete: bool | None = Field( - default=None, alias="InternalMonitorsDelete" - ) + group_managed_services: bool | None = Field(default=None, alias="GroupManagedServices") + remote_monitors_create: bool | None = Field(default=None, alias="RemoteMonitorsCreate") + remote_monitors_delete: bool | None = Field(default=None, alias="RemoteMonitorsDelete") + internal_monitors_create: bool | None = Field(default=None, alias="InternalMonitorsCreate") + internal_monitors_update: bool | None = Field(default=None, alias="InternalMonitorsUpdate") + internal_monitors_delete: bool | None = Field(default=None, alias="InternalMonitorsDelete") alerts_update: bool | None = Field(default=None, alias="AlertsUpdate") alerts_delete_all: bool | None = Field(default=None, alias="AlertsDeleteAll") tickets_read: bool | None = Field(default=None, alias="TicketsRead") @@ -1136,12 +1022,8 @@ class LabTechUserPermissions(ConnectWiseModel): patch_manager_read: bool | None = Field(default=None, alias="PatchManagerRead") patch_manager_update: bool | None = Field(default=None, alias="PatchManagerUpdate") language_pack_editor: bool | None = Field(default=None, alias="LanguagePackEditor") - managed_service_catalog: bool | None = Field( - default=None, alias="ManagedServiceCatalog" - ) - navigation_menu_update: bool | None = Field( - default=None, alias="NavigationMenuUpdate" - ) + managed_service_catalog: bool | None = Field(default=None, alias="ManagedServiceCatalog") + navigation_menu_update: bool | None = Field(default=None, alias="NavigationMenuUpdate") rss_feed_read: bool | None = Field(default=None, alias="RSSFeedRead") rss_feed_update: bool | None = Field(default=None, alias="RSSFeedUpdate") links_delete: bool | None = Field(default=None, alias="LinksDelete") @@ -1150,24 +1032,14 @@ class LabTechUserPermissions(ConnectWiseModel): database_execute: bool | None = Field(default=None, alias="DatabaseExecute") server_status: bool | None = Field(default=None, alias="ServerStatus") manage_audits: bool | None = Field(default=None, alias="ManageAudits") - manage_remote_commands: bool | None = Field( - default=None, alias="ManageRemoteCommands" - ) + manage_remote_commands: bool | None = Field(default=None, alias="ManageRemoteCommands") manage_service_logs: bool | None = Field(default=None, alias="ManageServiceLogs") manage_outdated: bool | None = Field(default=None, alias="ManageOutdated") - manage_offline_computers: bool | None = Field( - default=None, alias="ManageOfflineComputers" - ) - manage_schedule_client_scripts: bool | None = Field( - default=None, alias="ManageScheduleClientScripts" - ) + manage_offline_computers: bool | None = Field(default=None, alias="ManageOfflineComputers") + manage_schedule_client_scripts: bool | None = Field(default=None, alias="ManageScheduleClientScripts") dashboard_config: bool | None = Field(default=None, alias="DashboardConfig") - config_application_list: bool | None = Field( - default=None, alias="ConfigApplicationList" - ) - config_event_black_list: bool | None = Field( - default=None, alias="ConfigEventBlackList" - ) + config_application_list: bool | None = Field(default=None, alias="ConfigApplicationList") + config_event_black_list: bool | None = Field(default=None, alias="ConfigEventBlackList") quick_connect: bool | None = Field(default=None, alias="QuickConnect") permissions_update: bool | None = Field(default=None, alias="PermissionsUpdate") user_class_read: bool | None = Field(default=None, alias="UserClassRead") @@ -1267,9 +1139,7 @@ class LabTechComputerDriver(ConnectWiseModel): path_name: str | None = Field(default=None, alias="PathName") service_type: str | None = Field(default=None, alias="ServiceType") username: str | None = Field(default=None, alias="Username") - date_last_inventoried: datetime | None = Field( - default=None, alias="DateLastInventoried" - ) + date_last_inventoried: datetime | None = Field(default=None, alias="DateLastInventoried") run_levels: str | None = Field(default=None, alias="RunLevels") @@ -1283,16 +1153,12 @@ class LabTechComputerDrive(ConnectWiseModel): model: str | None = Field(default=None, alias="Model") smart_status: str | None = Field(default=None, alias="SmartStatus") is_missing: bool | None = Field(default=None, alias="IsMissing") - date_last_inventoried: datetime | None = Field( - default=None, alias="DateLastInventoried" - ) + date_last_inventoried: datetime | None = Field(default=None, alias="DateLastInventoried") volume_name: str | None = Field(default=None, alias="VolumeName") backup_flag: int | None = Field(default=None, alias="BackupFlag") is_solid_state: bool | None = Field(default=None, alias="IsSolidState") is_internal: bool | None = Field(default=None, alias="IsInternal") - maximum_history_days_available: int | None = Field( - default=None, alias="MaximumHistoryDaysAvailable" - ) + maximum_history_days_available: int | None = Field(default=None, alias="MaximumHistoryDaysAvailable") class LabTechSmartAttribute(ConnectWiseModel): @@ -1303,20 +1169,14 @@ class LabTechSmartAttribute(ConnectWiseModel): class LabTechComputerEffectivePatchingPolicy(ConnectWiseModel): approval_policy_count: int | None = Field(default=None, alias="ApprovalPolicyCount") - microsoft_update_policy_name: str | None = Field( - default=None, alias="MicrosoftUpdatePolicyName" - ) + microsoft_update_policy_name: str | None = Field(default=None, alias="MicrosoftUpdatePolicyName") computer_id: int | None = Field(default=None, alias="ComputerId") reboot_policy_name: str | None = Field(default=None, alias="RebootPolicyName") - third_party_update_policy_name: str | None = Field( - default=None, alias="ThirdPartyUpdatePolicyName" - ) + third_party_update_policy_name: str | None = Field(default=None, alias="ThirdPartyUpdatePolicyName") class AutomateMaintenanceModeQueueEntry(ConnectWiseModel): - maintenance_mode_queue_id: int | None = Field( - default=None, alias="MaintenanceModeQueueId" - ) + maintenance_mode_queue_id: int | None = Field(default=None, alias="MaintenanceModeQueueId") computer_id: int | None = Field(default=None, alias="ComputerId") start_date: datetime | None = Field(default=None, alias="StartDate") duration_in_minutes: int | None = Field(default=None, alias="DurationInMinutes") @@ -1361,24 +1221,18 @@ class LabTechComputerOperatingSystem(ConnectWiseModel): date_updated: datetime | None = Field(default=None, alias="DateUpdated") release_id: int | None = Field(default=None, alias="ReleaseId") edition: str | None = Field(default=None, alias="Edition") - branch_readiness_level: int | None = Field( - default=None, alias="BranchReadinessLevel" - ) + branch_readiness_level: int | None = Field(default=None, alias="BranchReadinessLevel") class LabTechComputerPatchingPolicy(ConnectWiseModel): approval_policy_count: int | None = Field(default=None, alias="ApprovalPolicyCount") group_id: int | None = Field(default=None, alias="GroupId") - microsoft_update_policy_name: str | None = Field( - default=None, alias="MicrosoftUpdatePolicyName" - ) + microsoft_update_policy_name: str | None = Field(default=None, alias="MicrosoftUpdatePolicyName") name: str | None = Field(default=None, alias="Name") override_id: int | None = Field(default=None, alias="OverrideId") priority: int | None = Field(default=None, alias="Priority") reboot_policy_name: str | None = Field(default=None, alias="RebootPolicyName") - third_party_update_policy_name: str | None = Field( - default=None, alias="ThirdPartyUpdatePolicyName" - ) + third_party_update_policy_name: str | None = Field(default=None, alias="ThirdPartyUpdatePolicyName") class LabTechComputerPrinter(ConnectWiseModel): @@ -1476,9 +1330,7 @@ class LabTechComputerScriptHistory(ConnectWiseModel): name: str | None = Field(default=None, alias="Name") user: str | None = Field(default=None, alias="User") status: Literal["Running", "Completed"] | None = Field(default=None, alias="Status") - state: Literal["Failure", "Information", "Success"] | None = Field( - default=None, alias="State" - ) + state: Literal["Failure", "Information", "Success"] | None = Field(default=None, alias="State") history_date: datetime | None = Field(default=None, alias="HistoryDate") diagnostic_message: str | None = Field(default=None, alias="DiagnosticMessage") @@ -1509,9 +1361,7 @@ class LabTechComputerSystemSlot(ConnectWiseModel): supports3_volts: bool | None = Field(default=None, alias="Supports3Volts") supports5_volts: bool | None = Field(default=None, alias="Supports5Volts") is_hot_pluggable: bool | None = Field(default=None, alias="IsHotPluggable") - supports_power_management: bool | None = Field( - default=None, alias="SupportsPowerManagement" - ) + supports_power_management: bool | None = Field(default=None, alias="SupportsPowerManagement") class LabTechPatchComplianceState(AutomateAlertClient): @@ -1570,23 +1420,17 @@ class AutomateLocation(ConnectWiseModel): class AutomateExtraFieldDisplayFormat(ConnectWiseModel): - extra_field_display_format_id: int | None = Field( - default=None, alias="ExtraFieldDisplayFormatId" - ) + extra_field_display_format_id: int | None = Field(default=None, alias="ExtraFieldDisplayFormatId") name: str | None = Field(default=None, alias="Name") class AutomateExtraFieldLocation(ConnectWiseModel): - extra_field_location_id: int | None = Field( - default=None, alias="ExtraFieldLocationId" - ) + extra_field_location_id: int | None = Field(default=None, alias="ExtraFieldLocationId") name: str | None = Field(default=None, alias="Name") class AutomateExtraFieldTitleFormat(ConnectWiseModel): - extra_field_title_format_id: int | None = Field( - default=None, alias="ExtraFieldTitleFormatId" - ) + extra_field_title_format_id: int | None = Field(default=None, alias="ExtraFieldTitleFormatId") name: str | None = Field(default=None, alias="Name") @@ -1597,9 +1441,7 @@ class AutomateTextFieldSettings(ConnectWiseModel): class AutomateDropdownSettings(ConnectWiseModel): - available_options: dict[str, str] | None = Field( - default=None, alias="AvailableOptions" - ) + available_options: dict[str, str] | None = Field(default=None, alias="AvailableOptions") selected_value: str | None = Field(default=None, alias="SelectedValue") default_value: str | None = Field(default=None, alias="DefaultValue") @@ -1615,9 +1457,7 @@ class AutomateExecuteDeviceCommandsRequest(ConnectWiseModel): class AutomateExecuteDeviceCommandResult(ConnectWiseModel): device_id: int | None = Field(default=None, alias="DeviceId") - result_details: AutomateResponseResult | None = Field( - default=None, alias="ResultDetails" - ) + result_details: AutomateResponseResult | None = Field(default=None, alias="ResultDetails") class AutomateComputerPatchingStats(ConnectWiseModel): @@ -1626,54 +1466,28 @@ class AutomateComputerPatchingStats(ConnectWiseModel): installed_patch_count: int | None = Field(default=None, alias="InstalledPatchCount") missing_patch_count: int | None = Field(default=None, alias="MissingPatchCount") failed_patch_count: int | None = Field(default=None, alias="FailedPatchCount") - compliant_software_count: int | None = Field( - default=None, alias="CompliantSoftwareCount" - ) - non_compliant_software_count: int | None = Field( - default=None, alias="NonCompliantSoftwareCount" - ) + compliant_software_count: int | None = Field(default=None, alias="CompliantSoftwareCount") + non_compliant_software_count: int | None = Field(default=None, alias="NonCompliantSoftwareCount") failed_software_count: int | None = Field(default=None, alias="FailedSoftwareCount") - incorrect_software_count: int | None = Field( - default=None, alias="IncorrectSoftwareCount" - ) + incorrect_software_count: int | None = Field(default=None, alias="IncorrectSoftwareCount") stage: str | None = Field(default=None, alias="Stage") no_patch_inventory: bool | None = Field(default=None, alias="NoPatchInventory") wsus_enabled: bool | None = Field(default=None, alias="WSUSEnabled") patch_job_running: bool | None = Field(default=None, alias="PatchJobRunning") - daytime_patching_enabled: bool | None = Field( - default=None, alias="DaytimePatchingEnabled" - ) + daytime_patching_enabled: bool | None = Field(default=None, alias="DaytimePatchingEnabled") wua_out_of_date: bool | None = Field(default=None, alias="WUAOutOfDate") - missing_baseline_patches: bool | None = Field( - default=None, alias="MissingBaselinePatches" - ) + missing_baseline_patches: bool | None = Field(default=None, alias="MissingBaselinePatches") wua_version: str | None = Field(default=None, alias="WUAVersion") - last_install_window: datetime | None = Field( - default=None, alias="LastInstallWindow" - ) - next_install_window: datetime | None = Field( - default=None, alias="NextInstallWindow" - ) - last_software_window: datetime | None = Field( - default=None, alias="LastSoftwareWindow" - ) - next_software_window: datetime | None = Field( - default=None, alias="NextSoftwareWindow" - ) + last_install_window: datetime | None = Field(default=None, alias="LastInstallWindow") + next_install_window: datetime | None = Field(default=None, alias="NextInstallWindow") + last_software_window: datetime | None = Field(default=None, alias="LastSoftwareWindow") + next_software_window: datetime | None = Field(default=None, alias="NextSoftwareWindow") last_patched_date: datetime | None = Field(default=None, alias="LastPatchedDate") - last_microsoft_patched_date: datetime | None = Field( - default=None, alias="LastMicrosoftPatchedDate" - ) - last_third_party_patched_date: datetime | None = Field( - default=None, alias="LastThirdPartyPatchedDate" - ) - last_patch_inventory: datetime | None = Field( - default=None, alias="LastPatchInventory" - ) + last_microsoft_patched_date: datetime | None = Field(default=None, alias="LastMicrosoftPatchedDate") + last_third_party_patched_date: datetime | None = Field(default=None, alias="LastThirdPartyPatchedDate") + last_patch_inventory: datetime | None = Field(default=None, alias="LastPatchInventory") is_microsoft_managed: bool | None = Field(default=None, alias="IsMicrosoftManaged") - is_third_party_managed: bool | None = Field( - default=None, alias="IsThirdPartyManaged" - ) + is_third_party_managed: bool | None = Field(default=None, alias="IsThirdPartyManaged") class AutomateExecuteDeviceScriptRequest(ConnectWiseModel): @@ -1688,9 +1502,7 @@ class AutomateExecuteDeviceScriptResult(AutomateExecuteDeviceCommandResult): class AutomateDevicesSummaryData(ConnectWiseModel): compliance_score: float | None = Field(default=None, alias="ComplianceScore") - devices_affecting_compliance_count: int | None = Field( - default=None, alias="DevicesAffectingComplianceCount" - ) + devices_affecting_compliance_count: int | None = Field(default=None, alias="DevicesAffectingComplianceCount") devices_affecting_pilot_stage_compliance_count: int | None = Field( default=None, alias="DevicesAffectingPilotStageComplianceCount" ) @@ -1700,51 +1512,27 @@ class AutomateDevicesSummaryData(ConnectWiseModel): devices_affecting_test_stage_compliance_count: int | None = Field( default=None, alias="DevicesAffectingTestStageComplianceCount" ) - devices_needing_attention_count: int | None = Field( - default=None, alias="DevicesNeedingAttentionCount" - ) + devices_needing_attention_count: int | None = Field(default=None, alias="DevicesNeedingAttentionCount") enabled_wsus_count: int | None = Field(default=None, alias="EnabledWsusCount") entity_id: int | None = Field(default=None, alias="EntityId") entity_name: str | None = Field(default=None, alias="EntityName") - in_daytime_patching_count: int | None = Field( - default=None, alias="InDaytimePatchingCount" - ) - last_patch_job_failed_count: int | None = Field( - default=None, alias="LastPatchJobFailedCount" - ) - missing_baseline_patches_count: int | None = Field( - default=None, alias="MissingBaselinePatchesCount" - ) - missing_patch_inventory_count: int | None = Field( - default=None, alias="MissingPatchInventoryCount" - ) + in_daytime_patching_count: int | None = Field(default=None, alias="InDaytimePatchingCount") + last_patch_job_failed_count: int | None = Field(default=None, alias="LastPatchJobFailedCount") + missing_baseline_patches_count: int | None = Field(default=None, alias="MissingBaselinePatchesCount") + missing_patch_inventory_count: int | None = Field(default=None, alias="MissingPatchInventoryCount") out_of_date_wua_count: int | None = Field(default=None, alias="OutOfDateWuaCount") pending_reboot_count: int | None = Field(default=None, alias="PendingRebootCount") pending_update_count: int | None = Field(default=None, alias="PendingUpdateCount") - pilot_stage_compliance_score: float | None = Field( - default=None, alias="PilotStageComplianceScore" - ) - production_stage_compliance_score: float | None = Field( - default=None, alias="ProductionStageComplianceScore" - ) - running_patch_installation_count: int | None = Field( - default=None, alias="RunningPatchInstallationCount" - ) - servers_affecting_compliance_count: int | None = Field( - default=None, alias="ServersAffectingComplianceCount" - ) - servers_compliance_score: float | None = Field( - default=None, alias="ServersComplianceScore" - ) - test_stage_compliance_score: float | None = Field( - default=None, alias="TestStageComplianceScore" - ) + pilot_stage_compliance_score: float | None = Field(default=None, alias="PilotStageComplianceScore") + production_stage_compliance_score: float | None = Field(default=None, alias="ProductionStageComplianceScore") + running_patch_installation_count: int | None = Field(default=None, alias="RunningPatchInstallationCount") + servers_affecting_compliance_count: int | None = Field(default=None, alias="ServersAffectingComplianceCount") + servers_compliance_score: float | None = Field(default=None, alias="ServersComplianceScore") + test_stage_compliance_score: float | None = Field(default=None, alias="TestStageComplianceScore") workstations_affecting_compliance_count: int | None = Field( default=None, alias="WorkstationsAffectingComplianceCount" ) - workstations_compliance_score: float | None = Field( - default=None, alias="WorkstationsComplianceScore" - ) + workstations_compliance_score: float | None = Field(default=None, alias="WorkstationsComplianceScore") class LabTechDocument(ConnectWiseModel): @@ -1760,9 +1548,7 @@ class LabTechDocument(ConnectWiseModel): class LabTechDriveStats(ConnectWiseModel): drive_id: int | None = Field(default=None, alias="DriveId") free_space_percentage: int | None = Field(default=None, alias="FreeSpacePercentage") - fragmented_space_percentage: int | None = Field( - default=None, alias="FragmentedSpacePercentage" - ) + fragmented_space_percentage: int | None = Field(default=None, alias="FragmentedSpacePercentage") event_date: datetime | None = Field(default=None, alias="EventDate") sample_count: int | None = Field(default=None, alias="SampleCount") week: int | None = Field(default=None, alias="Week") @@ -1790,13 +1576,11 @@ class AutomateUserClassUserPermissions(LabTechUserPermissions): class AutomateBinaryExtensionPermission(ConnectWiseModel): - extension_permission_id: int | None = Field( - default=None, alias="ExtensionPermissionId" - ) + extension_permission_id: int | None = Field(default=None, alias="ExtensionPermissionId") extension_guid: UUID | None = Field( default=None, alias="ExtensionGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) extension_name: str | None = Field(default=None, alias="ExtensionName") permission_id: int | None = Field(default=None, alias="PermissionId") @@ -1804,9 +1588,7 @@ class AutomateBinaryExtensionPermission(ConnectWiseModel): class AutomateWebExtensionPermission(ConnectWiseModel): - web_extension_permission_id: int | None = Field( - default=None, alias="WebExtensionPermissionId" - ) + web_extension_permission_id: int | None = Field(default=None, alias="WebExtensionPermissionId") web_extension_id: int | None = Field(default=None, alias="WebExtensionId") permission_key: str | None = Field(default=None, alias="PermissionKey") permission_name: str | None = Field(default=None, alias="PermissionName") @@ -1882,12 +1664,8 @@ class AutomateWindowsUpdateAgentMode(AutomateAlertClient): class AutomateWindows10UpdatePolicySettings(ConnectWiseModel): service_branch: str | None = Field(default=None, alias="ServiceBranch") - feature_update_deferment: int | None = Field( - default=None, alias="FeatureUpdateDeferment" - ) - quality_update_deferment: int | None = Field( - default=None, alias="QualityUpdateDeferment" - ) + feature_update_deferment: int | None = Field(default=None, alias="FeatureUpdateDeferment") + quality_update_deferment: int | None = Field(default=None, alias="QualityUpdateDeferment") class AutomateUpdatePolicyScheduleDay(AutomateAlertClient): @@ -1913,17 +1691,13 @@ class AutomatePolicyScheduleType(AutomateAlertClient): class AutomateDatesScheduleSettings(ConnectWiseModel): - monthly_occurrence: list[str] | None = Field( - default=None, alias="MonthlyOccurrence" - ) + monthly_occurrence: list[str] | None = Field(default=None, alias="MonthlyOccurrence") dates: list[int] | None = Field(default=None, alias="Dates") last_day_of_month: bool | None = Field(default=None, alias="LastDayOfMonth") class AutomateDaysScheduleSettings(ConnectWiseModel): - monthly_occurrence: list[str] | None = Field( - default=None, alias="MonthlyOccurrence" - ) + monthly_occurrence: list[str] | None = Field(default=None, alias="MonthlyOccurrence") weekly_occurrence: list[str] | None = Field(default=None, alias="WeeklyOccurrence") daily_occurrence: list[str] | None = Field(default=None, alias="DailyOccurrence") @@ -1931,12 +1705,12 @@ class AutomateDaysScheduleSettings(ConnectWiseModel): class AutomatePatchingPolicyScript(ConnectWiseModel): run_script: bool | None = Field(default=None, alias="RunScript") script_guid: UUID | None = Field( - default=None, alias="ScriptGuid", example="00000000-0000-0000-0000-000000000000" + default=None, + alias="ScriptGuid", + examples=["00000000-0000-0000-0000-000000000000"], ) script_name: str | None = Field(default=None, alias="ScriptName") - cancel_action_on_script_failure: bool | None = Field( - default=None, alias="CancelActionOnScriptFailure" - ) + cancel_action_on_script_failure: bool | None = Field(default=None, alias="CancelActionOnScriptFailure") class AutomateSearchTargetType(ConnectWiseModel): @@ -1949,30 +1723,18 @@ class AutomateGroupTreeItem(ConnectWiseModel): parent_id: int | None = Field(default=None, alias="ParentId") name: str | None = Field(default=None, alias="Name") full_name: str | None = Field(default=None, alias="FullName") - user_has_direct_access: bool | None = Field( - default=None, alias="UserHasDirectAccess" - ) + user_has_direct_access: bool | None = Field(default=None, alias="UserHasDirectAccess") is_limited_to_computer_auto_join_search: bool | None = Field( default=None, alias="IsLimitedToComputerAutoJoinSearch" ) is_limited_to_network_device_auto_join_search: bool | None = Field( default=None, alias="IsLimitedToNetworkDeviceAutoJoinSearch" ) - is_limited_to_contact_auto_join_search: bool | None = Field( - default=None, alias="IsLimitedToContactAutoJoinSearch" - ) - parent_groups: list[AutomateGroupTreeItem] | None = Field( - default=None, alias="ParentGroups" - ) - child_groups: list[AutomateGroupTreeItem] | None = Field( - default=None, alias="ChildGroups" - ) - direct_computer_membership_count: int | None = Field( - default=None, alias="DirectComputerMembershipCount" - ) - indirect_computer_membership_count: int | None = Field( - default=None, alias="IndirectComputerMembershipCount" - ) + is_limited_to_contact_auto_join_search: bool | None = Field(default=None, alias="IsLimitedToContactAutoJoinSearch") + parent_groups: list[AutomateGroupTreeItem] | None = Field(default=None, alias="ParentGroups") + child_groups: list[AutomateGroupTreeItem] | None = Field(default=None, alias="ChildGroups") + direct_computer_membership_count: int | None = Field(default=None, alias="DirectComputerMembershipCount") + indirect_computer_membership_count: int | None = Field(default=None, alias="IndirectComputerMembershipCount") class AutomateComputerSearchInformation(ConnectWiseModel): @@ -1991,9 +1753,7 @@ class AutomateGroupType(ConnectWiseModel): class AutomateRemoteAgentTemplate(ConnectWiseModel): - remote_agent_template_id: int | None = Field( - default=None, alias="RemoteAgentTemplateId" - ) + remote_agent_template_id: int | None = Field(default=None, alias="RemoteAgentTemplateId") name: str | None = Field(default=None, alias="Name") @@ -2004,22 +1764,12 @@ class AutomateTicketCategory(AutomateWindowsUpdateCategory): class AutomateMembershipConfiguration(ConnectWiseModel): membership_type: str | None = Field(default=None, alias="MembershipType") computer_search_name: str | None = Field(default=None, alias="ComputerSearchName") - is_limited_to_computer_search: bool | None = Field( - default=None, alias="IsLimitedToComputerSearch" - ) - network_device_search_name: str | None = Field( - default=None, alias="NetworkDeviceSearchName" - ) - is_limited_to_network_device_search: bool | None = Field( - default=None, alias="IsLimitedToNetworkDeviceSearch" - ) + is_limited_to_computer_search: bool | None = Field(default=None, alias="IsLimitedToComputerSearch") + network_device_search_name: str | None = Field(default=None, alias="NetworkDeviceSearchName") + is_limited_to_network_device_search: bool | None = Field(default=None, alias="IsLimitedToNetworkDeviceSearch") contact_search_name: str | None = Field(default=None, alias="ContactSearchName") - is_limited_to_contact_search: bool | None = Field( - default=None, alias="IsLimitedToContactSearch" - ) - includes_contact_associated_computers: bool | None = Field( - default=None, alias="IncludesContactAssociatedComputers" - ) + is_limited_to_contact_search: bool | None = Field(default=None, alias="IsLimitedToContactSearch") + includes_contact_associated_computers: bool | None = Field(default=None, alias="IncludesContactAssociatedComputers") class AutomateIpRestrictionStatus(ConnectWiseModel): @@ -2050,9 +1800,7 @@ class LabTechNetworkMapNode(ConnectWiseModel): device_friendly_name: str | None = Field(default=None, alias="DeviceFriendlyName") description: str | None = Field(default=None, alias="Description") device_type: str | None = Field(default=None, alias="DeviceType") - child_node_list: list[LabTechNetworkMapNode] | None = Field( - default=None, alias="ChildNodeList" - ) + child_node_list: list[LabTechNetworkMapNode] | None = Field(default=None, alias="ChildNodeList") device_mac_address: str | None = Field(default=None, alias="DeviceMacAddress") ip_address: str | None = Field(default=None, alias="IpAddress") status: str | None = Field(default=None, alias="Status") @@ -2067,9 +1815,7 @@ class LabTechNetworkMapNodeDetails(ConnectWiseModel): uptime: int | None = Field(default=None, alias="Uptime") ignore_device_scan: bool | None = Field(default=None, alias="IgnoreDeviceScan") asset_date: datetime | None = Field(default=None, alias="AssetDate") - date_last_inventoried: datetime | None = Field( - default=None, alias="DateLastInventoried" - ) + date_last_inventoried: datetime | None = Field(default=None, alias="DateLastInventoried") last_contact_date: datetime | None = Field(default=None, alias="LastContactDate") ip_address: str | None = Field(default=None, alias="IpAddress") device_mac_address: str | None = Field(default=None, alias="DeviceMacAddress") @@ -2096,9 +1842,7 @@ class LabTechScanFrequencyCategory(ConnectWiseModel): class LabTechStatusScanNetworkPortOption(ConnectWiseModel): - status_scan_network_port_option_id: int | None = Field( - default=None, alias="StatusScanNetworkPortOptionId" - ) + status_scan_network_port_option_id: int | None = Field(default=None, alias="StatusScanNetworkPortOptionId") description: str | None = Field(default=None, alias="Description") @@ -2124,19 +1868,11 @@ class LabTechProductKey(ConnectWiseModel): class AutomateManagementPackQuickSettingsRequest(ConnectWiseModel): - is_core_services_enabled: bool | None = Field( - default=None, alias="IsCoreServicesEnabled" - ) + is_core_services_enabled: bool | None = Field(default=None, alias="IsCoreServicesEnabled") is_database_enabled: bool | None = Field(default=None, alias="IsDatabaseEnabled") - is_messaging_services_enabled: bool | None = Field( - default=None, alias="IsMessagingServicesEnabled" - ) - is_network_ports_enabled: bool | None = Field( - default=None, alias="IsNetworkPortsEnabled" - ) - is_websites_and_proxies_enabled: bool | None = Field( - default=None, alias="IsWebsitesAndProxiesEnabled" - ) + is_messaging_services_enabled: bool | None = Field(default=None, alias="IsMessagingServicesEnabled") + is_network_ports_enabled: bool | None = Field(default=None, alias="IsNetworkPortsEnabled") + is_websites_and_proxies_enabled: bool | None = Field(default=None, alias="IsWebsitesAndProxiesEnabled") alert_level: str | None = Field(default=None, alias="AlertLevel") @@ -2155,19 +1891,13 @@ class AutomateCommandMenuItemBase(ConnectWiseModel): class AutomateWindowsUpdateAgentSettings(ConnectWiseModel): - use_windows_update_agent_mode: bool | None = Field( - default=None, alias="UseWindowsUpdateAgentMode" - ) + use_windows_update_agent_mode: bool | None = Field(default=None, alias="UseWindowsUpdateAgentMode") mode: str | None = Field(default=None, alias="Mode") - disable_user_interface: bool | None = Field( - default=None, alias="DisableUserInterface" - ) + disable_user_interface: bool | None = Field(default=None, alias="DisableUserInterface") class AutomateMicrosoftUpdatePolicyOptions(ConnectWiseModel): - install_missing_baseline_patches: bool | None = Field( - default=None, alias="InstallMissingBaselinePatches" - ) + install_missing_baseline_patches: bool | None = Field(default=None, alias="InstallMissingBaselinePatches") class AutomatePatchTuesdayScheduleSettings(ConnectWiseModel): @@ -2175,12 +1905,8 @@ class AutomatePatchTuesdayScheduleSettings(ConnectWiseModel): class AutomateDaytimePatchingOptions(ConnectWiseModel): - allow_daytime_patching: bool | None = Field( - default=None, alias="AllowDaytimePatching" - ) - require_minimum_uptime: bool | None = Field( - default=None, alias="RequireMinimumUptime" - ) + allow_daytime_patching: bool | None = Field(default=None, alias="AllowDaytimePatching") + require_minimum_uptime: bool | None = Field(default=None, alias="RequireMinimumUptime") minimum_uptime: str | None = Field(default=None, alias="MinimumUptime") update_only: bool | None = Field(default=None, alias="UpdateOnly") prompt_interval: str | None = Field(default=None, alias="PromptInterval") @@ -2258,9 +1984,7 @@ class LabTechMonitorComparerSettingsResultFormat(AutomateAlertClient): class LabTechMonitorPluginOwner(ConnectWiseModel): control_guid: str | None = Field(default=None, alias="ControlGUID") plugin_name: str | None = Field(default=None, alias="PluginName") - alteration_instructions: str | None = Field( - default=None, alias="AlterationInstructions" - ) + alteration_instructions: str | None = Field(default=None, alias="AlterationInstructions") class LabTechScriptFolder(ConnectWiseModel): @@ -2268,12 +1992,8 @@ class LabTechScriptFolder(ConnectWiseModel): parent_id: str | None = Field(default=None, alias="ParentId") name: str | None = Field(default=None, alias="Name") guid: str | None = Field(default=None, alias="GUID") - sub_folders: list[LabTechScriptFolder] | None = Field( - default=None, alias="SubFolders" - ) - parent_folder: LabTechScriptFolder | None = Field( - default=None, alias="ParentFolder" - ) + sub_folders: list[LabTechScriptFolder] | None = Field(default=None, alias="SubFolders") + parent_folder: LabTechScriptFolder | None = Field(default=None, alias="ParentFolder") class LabTechMonitorRoutineParametersFormat(AutomateAlertClient): @@ -2290,9 +2010,7 @@ class LabTechUnformattedMonitorRoutineParameters(ConnectWiseModel): class LabTechInternalDatabaseQueryParameters(ConnectWiseModel): field_to_check: str | None = Field(default=None, alias="FieldToCheck") table_or_view_to_query: str | None = Field(default=None, alias="TableOrViewToQuery") - additional_conditions: str | None = Field( - default=None, alias="AdditionalConditions" - ) + additional_conditions: str | None = Field(default=None, alias="AdditionalConditions") identity_field: str | None = Field(default=None, alias="IdentityField") @@ -2324,12 +2042,8 @@ class LabTechFileOrDirectoryQueryParameters(ConnectWiseModel): class LabTechGetExecutableResultParameters(ConnectWiseModel): - fully_qualified_executable_string: str | None = Field( - default=None, alias="FullyQualifiedExecutableString" - ) - result_transform_regular_expression: str | None = Field( - default=None, alias="ResultTransformRegularExpression" - ) + fully_qualified_executable_string: str | None = Field(default=None, alias="FullyQualifiedExecutableString") + result_transform_regular_expression: str | None = Field(default=None, alias="ResultTransformRegularExpression") class LabTechMonitorComparerValueFormat(AutomateAlertClient): @@ -2403,24 +2117,12 @@ class LabTechMonitorDataCollectionSettings(ConnectWiseModel): class AutomateMonitorCount(ConnectWiseModel): - internal_monitor_total_count: int | None = Field( - default=None, alias="InternalMonitorTotalCount" - ) - internal_monitor_total_disable_count: int | None = Field( - default=None, alias="InternalMonitorTotalDisableCount" - ) - internal_monitor_total_detected_count: int | None = Field( - default=None, alias="InternalMonitorTotalDetectedCount" - ) - remote_monitor_total_count: int | None = Field( - default=None, alias="RemoteMonitorTotalCount" - ) - remote_monitor_total_failure_count: int | None = Field( - default=None, alias="RemoteMonitorTotalFailureCount" - ) - remote_monitor_total_warning_count: int | None = Field( - default=None, alias="RemoteMonitorTotalWarningCount" - ) + internal_monitor_total_count: int | None = Field(default=None, alias="InternalMonitorTotalCount") + internal_monitor_total_disable_count: int | None = Field(default=None, alias="InternalMonitorTotalDisableCount") + internal_monitor_total_detected_count: int | None = Field(default=None, alias="InternalMonitorTotalDetectedCount") + remote_monitor_total_count: int | None = Field(default=None, alias="RemoteMonitorTotalCount") + remote_monitor_total_failure_count: int | None = Field(default=None, alias="RemoteMonitorTotalFailureCount") + remote_monitor_total_warning_count: int | None = Field(default=None, alias="RemoteMonitorTotalWarningCount") class LabTechMonitorStatistic(ConnectWiseModel): @@ -2437,30 +2139,18 @@ class LabTechMonitorStatistic(ConnectWiseModel): class AutomateNonCompliantSummaryData(ConnectWiseModel): low_severity_count: int | None = Field(default=None, alias="LowSeverityCount") - moderate_severity_count: int | None = Field( - default=None, alias="ModerateSeverityCount" - ) - important_severity_count: int | None = Field( - default=None, alias="ImportantSeverityCount" - ) - critical_severity_count: int | None = Field( - default=None, alias="CriticalSeverityCount" - ) - unspecified_severity_count: int | None = Field( - default=None, alias="UnspecifiedSeverityCount" - ) + moderate_severity_count: int | None = Field(default=None, alias="ModerateSeverityCount") + important_severity_count: int | None = Field(default=None, alias="ImportantSeverityCount") + critical_severity_count: int | None = Field(default=None, alias="CriticalSeverityCount") + unspecified_severity_count: int | None = Field(default=None, alias="UnspecifiedSeverityCount") low_cvss_count: int | None = Field(default=None, alias="LowCvssCount") medium_cvss_count: int | None = Field(default=None, alias="MediumCvssCount") high_cvss_count: int | None = Field(default=None, alias="HighCvssCount") - total_non_compliant_count: int | None = Field( - default=None, alias="TotalNonCompliantCount" - ) + total_non_compliant_count: int | None = Field(default=None, alias="TotalNonCompliantCount") class AutomatePasswordResetConfigurationResponse(ConnectWiseModel): - can_generate_password_reset_token: bool | None = Field( - default=None, alias="CanGeneratePasswordResetToken" - ) + can_generate_password_reset_token: bool | None = Field(default=None, alias="CanGeneratePasswordResetToken") class AutomatePasswordResetTokenRequest(ConnectWiseModel): @@ -2483,35 +2173,21 @@ class LabTechPatchActionArgs(ConnectWiseModel): class AutomatePatchActionInformation(ConnectWiseModel): computer_id: int | None = Field(default=None, alias="ComputerId") - product_key_id_list: list[str] | None = Field( - default=None, alias="ProductKeyIdList" - ) + product_key_id_list: list[str] | None = Field(default=None, alias="ProductKeyIdList") class LabTechPatchesSummaryData(ConnectWiseModel): entity_id: int | None = Field(default=None, alias="EntityId") entity_name: str | None = Field(default=None, alias="EntityName") - test_stage_failed_patches_count: int | None = Field( - default=None, alias="TestStageFailedPatchesCount" - ) - test_stage_not_attempted_patches_count: int | None = Field( - default=None, alias="TestStageNotAttemptedPatchesCount" - ) - test_stage_installed_patches_count: int | None = Field( - default=None, alias="TestStageInstalledPatchesCount" - ) - pilot_stage_failed_patches_count: int | None = Field( - default=None, alias="PilotStageFailedPatchesCount" - ) + test_stage_failed_patches_count: int | None = Field(default=None, alias="TestStageFailedPatchesCount") + test_stage_not_attempted_patches_count: int | None = Field(default=None, alias="TestStageNotAttemptedPatchesCount") + test_stage_installed_patches_count: int | None = Field(default=None, alias="TestStageInstalledPatchesCount") + pilot_stage_failed_patches_count: int | None = Field(default=None, alias="PilotStageFailedPatchesCount") pilot_stage_not_attempted_patches_count: int | None = Field( default=None, alias="PilotStageNotAttemptedPatchesCount" ) - pilot_stage_installed_patches_count: int | None = Field( - default=None, alias="PilotStageInstalledPatchesCount" - ) - production_stage_failed_patches_count: int | None = Field( - default=None, alias="ProductionStageFailedPatchesCount" - ) + pilot_stage_installed_patches_count: int | None = Field(default=None, alias="PilotStageInstalledPatchesCount") + production_stage_failed_patches_count: int | None = Field(default=None, alias="ProductionStageFailedPatchesCount") production_stage_not_attempted_patches_count: int | None = Field( default=None, alias="ProductionStageNotAttemptedPatchesCount" ) @@ -2521,24 +2197,12 @@ class LabTechPatchesSummaryData(ConnectWiseModel): class LabTechPatchInformation(ConnectWiseModel): - web_server_patch_version: str | None = Field( - default=None, alias="WebServerPatchVersion" - ) - db_agent_server_patch_version: str | None = Field( - default=None, alias="DBAgentServerPatchVersion" - ) - control_center_patch_version: str | None = Field( - default=None, alias="ControlCenterPatchVersion" - ) - remote_agent_patch_version: str | None = Field( - default=None, alias="RemoteAgentPatchVersion" - ) - linux_agent_patch_version: str | None = Field( - default=None, alias="LinuxAgentPatchVersion" - ) - mac_agent_patch_version: str | None = Field( - default=None, alias="MacAgentPatchVersion" - ) + web_server_patch_version: str | None = Field(default=None, alias="WebServerPatchVersion") + db_agent_server_patch_version: str | None = Field(default=None, alias="DBAgentServerPatchVersion") + control_center_patch_version: str | None = Field(default=None, alias="ControlCenterPatchVersion") + remote_agent_patch_version: str | None = Field(default=None, alias="RemoteAgentPatchVersion") + linux_agent_patch_version: str | None = Field(default=None, alias="LinuxAgentPatchVersion") + mac_agent_patch_version: str | None = Field(default=None, alias="MacAgentPatchVersion") last_patched_date: datetime | None = Field(default=None, alias="LastPatchedDate") @@ -2555,33 +2219,23 @@ class AutomateProbeCommandStatus(AutomateAlertClient): class AutomateProbeCommandHistoryEntry(ConnectWiseModel): - probe_command_history_id: int | None = Field( - default=None, alias="ProbeCommandHistoryId" - ) + probe_command_history_id: int | None = Field(default=None, alias="ProbeCommandHistoryId") probe_id: int | None = Field(default=None, alias="ProbeId") date_executed: datetime | None = Field(default=None, alias="DateExecuted") status: AutomateProbeCommandStatus | None = Field(default=None, alias="Status") - probe_remote_command: AutomateProbeRemoteCommand | None = Field( - default=None, alias="ProbeRemoteCommand" - ) + probe_remote_command: AutomateProbeRemoteCommand | None = Field(default=None, alias="ProbeRemoteCommand") output: str | None = Field(default=None, alias="Output") user: str | None = Field(default=None, alias="User") date_finished: datetime | None = Field(default=None, alias="DateFinished") class LabTechProbeConfigurationCredentials(ConnectWiseModel): - probe_configuration_credentials_id: int | None = Field( - default=None, alias="ProbeConfigurationCredentialsId" - ) - probe_configuration_id: int | None = Field( - default=None, alias="ProbeConfigurationId" - ) + probe_configuration_credentials_id: int | None = Field(default=None, alias="ProbeConfigurationCredentialsId") + probe_configuration_id: int | None = Field(default=None, alias="ProbeConfigurationId") credential_id: int | None = Field(default=None, alias="CredentialId") attempt_sequence: int | None = Field(default=None, alias="AttemptSequence") credentials_alias: str | None = Field(default=None, alias="CredentialsAlias") - credential_details: LabTechExternalSystemCredentials | None = Field( - default=None, alias="CredentialDetails" - ) + credential_details: LabTechExternalSystemCredentials | None = Field(default=None, alias="CredentialDetails") class LabTechSnmpSettings(ConnectWiseModel): @@ -2590,27 +2244,19 @@ class LabTechSnmpSettings(ConnectWiseModel): class LabTechSyslogServerSettings(ConnectWiseModel): - syslog_server_listening_port: int | None = Field( - default=None, alias="SyslogServerListeningPort" - ) - syslog_server_ip_filter: str | None = Field( - default=None, alias="SyslogServerIpFilter" - ) + syslog_server_listening_port: int | None = Field(default=None, alias="SyslogServerListeningPort") + syslog_server_ip_filter: str | None = Field(default=None, alias="SyslogServerIpFilter") class LabTechTftpServerSettings(ConnectWiseModel): tftp_server_ip_filter: str | None = Field(default=None, alias="TftpServerIpFilter") - tftp_server_listening_port: int | None = Field( - default=None, alias="TftpServerListeningPort" - ) + tftp_server_listening_port: int | None = Field(default=None, alias="TftpServerListeningPort") allow_tftp_uploads: bool | None = Field(default=None, alias="AllowTftpUploads") class LabTechProbeSubnet(ConnectWiseModel): probe_subnet_id: int | None = Field(default=None, alias="ProbeSubnetId") - probe_configuration_id: int | None = Field( - default=None, alias="ProbeConfigurationId" - ) + probe_configuration_id: int | None = Field(default=None, alias="ProbeConfigurationId") network: str | None = Field(default=None, alias="Network") subnet_mask: str | None = Field(default=None, alias="SubnetMask") label: str | None = Field(default=None, alias="Label") @@ -2623,51 +2269,31 @@ class LabTechProbeExcludedIpAddressRange(ConnectWiseModel): class LabTechProbeSnmpAuthentication(ConnectWiseModel): - snmp_authentication_id: int | None = Field( - default=None, alias="SnmpAuthenticationId" - ) - probe_snmp_configuration_id: int | None = Field( - default=None, alias="ProbeSnmpConfigurationId" - ) - authentication_secret: str | None = Field( - default=None, alias="AuthenticationSecret" - ) + snmp_authentication_id: int | None = Field(default=None, alias="SnmpAuthenticationId") + probe_snmp_configuration_id: int | None = Field(default=None, alias="ProbeSnmpConfigurationId") + authentication_secret: str | None = Field(default=None, alias="AuthenticationSecret") hash_method: LabTechHashMethod | None = Field(default=None, alias="HashMethod") class LabTechProbeSnmpEncryption(ConnectWiseModel): snmp_encryption_id: int | None = Field(default=None, alias="SnmpEncryptionId") - probe_snmp_configuration_id: int | None = Field( - default=None, alias="ProbeSnmpConfigurationId" - ) + probe_snmp_configuration_id: int | None = Field(default=None, alias="ProbeSnmpConfigurationId") encryption_password: str | None = Field(default=None, alias="EncryptionPassword") - encryption_method: LabTechEncryptionMethod | None = Field( - default=None, alias="EncryptionMethod" - ) + encryption_method: LabTechEncryptionMethod | None = Field(default=None, alias="EncryptionMethod") class LabTechNetMapPluginStatus(ConnectWiseModel): computer_id: int | None = Field(default=None, alias="ComputerId") - is_net_map_plugin_enabled: bool | None = Field( - default=None, alias="IsNetMapPluginEnabled" - ) + is_net_map_plugin_enabled: bool | None = Field(default=None, alias="IsNetMapPluginEnabled") class LabTechProbeDiscoveryScanStatus(ConnectWiseModel): - probe_discovery_scan_status_id: int | None = Field( - default=None, alias="ProbeDiscoveryScanStatusId" - ) + probe_discovery_scan_status_id: int | None = Field(default=None, alias="ProbeDiscoveryScanStatusId") location_id: int | None = Field(default=None, alias="LocationId") probe_id: int | None = Field(default=None, alias="ProbeId") - is_discovery_scan_running: bool | None = Field( - default=None, alias="IsDiscoveryScanRunning" - ) - discovery_scan_start: datetime | None = Field( - default=None, alias="DiscoveryScanStart" - ) - last_discovery_scan: datetime | None = Field( - default=None, alias="LastDiscoveryScan" - ) + is_discovery_scan_running: bool | None = Field(default=None, alias="IsDiscoveryScanRunning") + discovery_scan_start: datetime | None = Field(default=None, alias="DiscoveryScanStart") + last_discovery_scan: datetime | None = Field(default=None, alias="LastDiscoveryScan") class LabTechProbeEvent(ConnectWiseModel): @@ -2682,15 +2308,9 @@ class LabTechProbeSummary(ConnectWiseModel): total_devices: int | None = Field(default=None, alias="TotalDevices") offline_devices: int | None = Field(default=None, alias="OfflineDevices") missing_agents: int | None = Field(default=None, alias="MissingAgents") - last_discovery_scan: datetime | None = Field( - default=None, alias="LastDiscoveryScan" - ) - agent_deployment_enabled: bool | None = Field( - default=None, alias="AgentDeploymentEnabled" - ) - has_max_tile_permissions: bool | None = Field( - default=None, alias="HasMaxTilePermissions" - ) + last_discovery_scan: datetime | None = Field(default=None, alias="LastDiscoveryScan") + agent_deployment_enabled: bool | None = Field(default=None, alias="AgentDeploymentEnabled") + has_max_tile_permissions: bool | None = Field(default=None, alias="HasMaxTilePermissions") is_generation_two: bool | None = Field(default=None, alias="IsGenerationTwo") @@ -2698,18 +2318,10 @@ class AutomateDisableServerPatchRebootWorkstationSettings(ConnectWiseModel): prompt_message: str | None = Field(default=None, alias="PromptMessage") prompt_interval: str | None = Field(default=None, alias="PromptInterval") reboot_deadline: str | None = Field(default=None, alias="RebootDeadline") - reboot_deadline_prompt_message: str | None = Field( - default=None, alias="RebootDeadlinePromptMessage" - ) - reboot_deadline_prompt_duration: str | None = Field( - default=None, alias="RebootDeadlinePromptDuration" - ) - send_wake_on_lan_packet: bool | None = Field( - default=None, alias="SendWakeOnLanPacket" - ) - reboot_if_no_user_logged_in: bool | None = Field( - default=None, alias="RebootIfNoUserLoggedIn" - ) + reboot_deadline_prompt_message: str | None = Field(default=None, alias="RebootDeadlinePromptMessage") + reboot_deadline_prompt_duration: str | None = Field(default=None, alias="RebootDeadlinePromptDuration") + send_wake_on_lan_packet: bool | None = Field(default=None, alias="SendWakeOnLanPacket") + reboot_if_no_user_logged_in: bool | None = Field(default=None, alias="RebootIfNoUserLoggedIn") class AutomatePostPatchInstallTriggerSettings(ConnectWiseModel): @@ -2721,19 +2333,13 @@ class AutomatePostPatchInstallTriggerSettings(ConnectWiseModel): class AutomateRebootPolicyPromptSettings(ConnectWiseModel): use_prompt: bool | None = Field(default=None, alias="UsePrompt") - requires_confirmation: bool | None = Field( - default=None, alias="RequiresConfirmation" - ) - reboot_if_no_user_logged_on: bool | None = Field( - default=None, alias="RebootIfNoUserLoggedOn" - ) + requires_confirmation: bool | None = Field(default=None, alias="RequiresConfirmation") + reboot_if_no_user_logged_on: bool | None = Field(default=None, alias="RebootIfNoUserLoggedOn") class AutomateRebootPolicyMaintenanceModeOptions(ConnectWiseModel): set_window: bool | None = Field(default=None, alias="SetWindow") - window_ignore_types: list[str] | None = Field( - default=None, alias="WindowIgnoreTypes" - ) + window_ignore_types: list[str] | None = Field(default=None, alias="WindowIgnoreTypes") window_duration: str | None = Field(default=None, alias="WindowDuration") @@ -2742,15 +2348,11 @@ class AutomateReportCategory(AutomateWindowsUpdateCategory): class AutomateRecordedActionType(ConnectWiseModel): - recorded_action_type_id: int | None = Field( - default=None, alias="RecordedActionTypeId" - ) + recorded_action_type_id: int | None = Field(default=None, alias="RecordedActionTypeId") class AutomateRecordedActionSource(ConnectWiseModel): - recorded_action_source_id: int | None = Field( - default=None, alias="RecordedActionSourceId" - ) + recorded_action_source_id: int | None = Field(default=None, alias="RecordedActionSourceId") class AutomateInstallerRequest(ConnectWiseModel): @@ -2787,9 +2389,7 @@ class AutomateUserClassAccess(ConnectWiseModel): class AutomateScriptFolder(ConnectWiseModel): script_folder_id: int | None = Field(default=None, alias="ScriptFolderId") name: str | None = Field(default=None, alias="Name") - child_folders: list[AutomateScriptFolder] | None = Field( - default=None, alias="ChildFolders" - ) + child_folders: list[AutomateScriptFolder] | None = Field(default=None, alias="ChildFolders") class AutomateScriptTarget(ConnectWiseModel): @@ -2799,9 +2399,7 @@ class AutomateScriptTarget(ConnectWiseModel): class AutomateScriptOptions(ConnectWiseModel): is_isolated_script: bool | None = Field(default=None, alias="IsIsolatedScript") - is_maintenance_script: bool | None = Field( - default=None, alias="IsMaintenanceScript" - ) + is_maintenance_script: bool | None = Field(default=None, alias="IsMaintenanceScript") is_function_script: bool | None = Field(default=None, alias="IsFunctionScript") is_offline_script: bool | None = Field(default=None, alias="IsOfflineScript") is_system_script: bool | None = Field(default=None, alias="IsSystemScript") @@ -2818,9 +2416,7 @@ class AutomateTicketEntryCategory(ConnectWiseModel): class AutomateCloseTicketTrigger(ConnectWiseModel): - close_ticket_trigger_type_id: int | None = Field( - default=None, alias="CloseTicketTriggerTypeId" - ) + close_ticket_trigger_type_id: int | None = Field(default=None, alias="CloseTicketTriggerTypeId") name: str | None = Field(default=None, alias="Name") @@ -2830,9 +2426,7 @@ class AutomateTimeEntryCategory(ConnectWiseModel): class AutomateStopTimerTrigger(ConnectWiseModel): - stop_timer_trigger_type_id: int | None = Field( - default=None, alias="StopTimerTriggerTypeId" - ) + stop_timer_trigger_type_id: int | None = Field(default=None, alias="StopTimerTriggerTypeId") name: str | None = Field(default=None, alias="Name") @@ -2855,28 +2449,18 @@ class LabTechScheduledScript(ConnectWiseModel): include_subgroups: bool | None = Field(default=None, alias="IncludeSubgroups") search_id: int | None = Field(default=None, alias="SearchId") disabled: bool | None = Field(default=None, alias="Disabled") - effective_start_date: datetime | None = Field( - default=None, alias="EffectiveStartDate" - ) + effective_start_date: datetime | None = Field(default=None, alias="EffectiveStartDate") effective_end_date: datetime | None = Field(default=None, alias="EffectiveEndDate") - effective_occurrences: int | None = Field( - default=None, alias="EffectiveOccurrences" - ) - distribution_window_type: int | None = Field( - default=None, alias="DistributionWindowType" - ) - distribution_window_amount: int | None = Field( - default=None, alias="DistributionWindowAmount" - ) + effective_occurrences: int | None = Field(default=None, alias="EffectiveOccurrences") + distribution_window_type: int | None = Field(default=None, alias="DistributionWindowType") + distribution_window_amount: int | None = Field(default=None, alias="DistributionWindowAmount") next_run: datetime | None = Field(default=None, alias="NextRun") next_schedule: datetime | None = Field(default=None, alias="NextSchedule") schedule_type: int | None = Field(default=None, alias="ScheduleType") exclude_time_start: str | None = Field(default=None, alias="ExcludeTimeStart") exclude_time_end: str | None = Field(default=None, alias="ExcludeTimeEnd") interval: int | None = Field(default=None, alias="Interval") - schedule_week_of_month: int | None = Field( - default=None, alias="ScheduleWeekOfMonth" - ) + schedule_week_of_month: int | None = Field(default=None, alias="ScheduleWeekOfMonth") schedule_day_of_week: int | None = Field(default=None, alias="ScheduleDayOfWeek") repeat_type: int | None = Field(default=None, alias="RepeatType") repeat_amount: int | None = Field(default=None, alias="RepeatAmount") @@ -2895,9 +2479,7 @@ class LabTechScheduledScript(ConnectWiseModel): class AutomateScheduleTargetType(ConnectWiseModel): - schedule_target_type_id: int | None = Field( - default=None, alias="ScheduleTargetTypeId" - ) + schedule_target_type_id: int | None = Field(default=None, alias="ScheduleTargetTypeId") name: str | None = Field(default=None, alias="Name") @@ -2908,9 +2490,7 @@ class AutomateNetworkDevice(ConnectWiseModel): class AutomateTemplateSettings(ConnectWiseModel): - remote_agent_template: AutomateRemoteAgentTemplate | None = Field( - default=None, alias="RemoteAgentTemplate" - ) + remote_agent_template: AutomateRemoteAgentTemplate | None = Field(default=None, alias="RemoteAgentTemplate") priority: int | None = Field(default=None, alias="Priority") @@ -2932,9 +2512,7 @@ class AutomateMaintenanceWindowSettings(AutomateMaintenanceWindow): class AutomateContactSource(ConnectWiseModel): - contact_source_type_id: int | None = Field( - default=None, alias="ContactSourceTypeId" - ) + contact_source_type_id: int | None = Field(default=None, alias="ContactSourceTypeId") name: str | None = Field(default=None, alias="Name") @@ -2945,9 +2523,7 @@ class AutomateSearchSettings(ConnectWiseModel): class AutomateContactSearchSettings(ConnectWiseModel): - should_include_associated_computers: bool | None = Field( - default=None, alias="ShouldIncludeAssociatedComputers" - ) + should_include_associated_computers: bool | None = Field(default=None, alias="ShouldIncludeAssociatedComputers") auto_join_search_id: int | None = Field(default=None, alias="AutoJoinSearchId") name: str | None = Field(default=None, alias="Name") is_limited_to_search: bool | None = Field(default=None, alias="IsLimitedToSearch") @@ -3041,9 +2617,9 @@ class AutomateFilterCriteria(ConnectWiseModel): class LabTechSensorCheck(ConnectWiseModel): id: str | None = Field(default=None, alias="Id") name: str | None = Field(default=None, alias="Name") - sensor_check_type: Literal[ - "SystemAverages", "SystemCounts", "Trends", "PerDayCounts" - ] | None = Field(default=None, alias="SensorCheckType") + sensor_check_type: Literal["SystemAverages", "SystemCounts", "Trends", "PerDayCounts"] | None = Field( + default=None, alias="SensorCheckType" + ) class AutomateServerInformation(ConnectWiseModel): @@ -3066,9 +2642,7 @@ class AutomateImplicitClientUpgradeRequest(ConnectWiseModel): class AutomateRegisterSsoRequest(ConnectWiseModel): registration_token: str | None = Field(default=None, alias="RegistrationToken") - enabled_user_folders: list[int] | None = Field( - default=None, alias="EnabledUserFolders" - ) + enabled_user_folders: list[int] | None = Field(default=None, alias="EnabledUserFolders") class AutomateUnregisterSsoRequest(ConnectWiseModel): @@ -3077,32 +2651,24 @@ class AutomateUnregisterSsoRequest(ConnectWiseModel): class LabTechDriveStatistics(ConnectWiseModel): drive_id: int | None = Field(default=None, alias="DriveId") - percentage_used_difference: float | None = Field( - default=None, alias="PercentageUsedDifference" - ) + percentage_used_difference: float | None = Field(default=None, alias="PercentageUsedDifference") class AutomateAgentStatistics(ConnectWiseModel): - total_agents_purchased: int | None = Field( - default=None, alias="TotalAgentsPurchased" - ) + total_agents_purchased: int | None = Field(default=None, alias="TotalAgentsPurchased") total_agents_deployed: int | None = Field(default=None, alias="TotalAgentsDeployed") class AutomateScriptAutomationTimeResult(ConnectWiseModel): successful_scripts: int | None = Field(default=None, alias="SuccessfulScripts") - automation_time_minutes: int | None = Field( - default=None, alias="AutomationTimeMinutes" - ) + automation_time_minutes: int | None = Field(default=None, alias="AutomationTimeMinutes") automation_value: int | None = Field(default=None, alias="AutomationValue") class AutomateScriptAutomationTimeUserResult(ConnectWiseModel): name: str | None = Field(default=None, alias="Name") successful_scripts: int | None = Field(default=None, alias="SuccessfulScripts") - automation_time_minutes: int | None = Field( - default=None, alias="AutomationTimeMinutes" - ) + automation_time_minutes: int | None = Field(default=None, alias="AutomationTimeMinutes") automation_value: int | None = Field(default=None, alias="AutomationValue") @@ -3131,9 +2697,7 @@ class AutomateIndividualScriptStatisticsResponse(ConnectWiseModel): last_run_target: str | None = Field(default=None, alias="LastRunTarget") last_run_date: datetime | None = Field(default=None, alias="LastRunDate") total_value: int | None = Field(default=None, alias="TotalValue") - last_history_date_available: datetime | None = Field( - default=None, alias="LastHistoryDateAvailable" - ) + last_history_date_available: datetime | None = Field(default=None, alias="LastHistoryDateAvailable") last_run_status: str | None = Field(default=None, alias="LastRunStatus") @@ -3150,9 +2714,7 @@ class AutomateWorkflowStatus(ConnectWiseModel): class AutomateWorkflowMetadata(ConnectWiseModel): - system_workflow_progress_metadata_id: int | None = Field( - default=None, alias="SystemWorkflowProgressMetadataId" - ) + system_workflow_progress_metadata_id: int | None = Field(default=None, alias="SystemWorkflowProgressMetadataId") metadata_key: str | None = Field(default=None, alias="MetadataKey") metadata_value: str | None = Field(default=None, alias="MetadataValue") @@ -3165,30 +2727,20 @@ class LabTechTemplateAvailableProperty(ConnectWiseModel): class AutomateThirdPartyPatchesSummaryData(ConnectWiseModel): - third_party_compliance_score: float | None = Field( - default=None, alias="ThirdPartyComplianceScore" - ) - third_party_server_compliance_score: float | None = Field( - default=None, alias="ThirdPartyServerComplianceScore" - ) + third_party_compliance_score: float | None = Field(default=None, alias="ThirdPartyComplianceScore") + third_party_server_compliance_score: float | None = Field(default=None, alias="ThirdPartyServerComplianceScore") third_party_workstation_compliance_score: float | None = Field( default=None, alias="ThirdPartyWorkstationComplianceScore" ) - devices_affecting_compliance_count: int | None = Field( - default=None, alias="DevicesAffectingComplianceCount" - ) - servers_affecting_compliance_count: int | None = Field( - default=None, alias="ServersAffectingComplianceCount" - ) + devices_affecting_compliance_count: int | None = Field(default=None, alias="DevicesAffectingComplianceCount") + servers_affecting_compliance_count: int | None = Field(default=None, alias="ServersAffectingComplianceCount") workstations_affecting_compliance_count: int | None = Field( default=None, alias="WorkstationsAffectingComplianceCount" ) approved_count: int | None = Field(default=None, alias="ApprovedCount") compliant_count: int | None = Field(default=None, alias="CompliantCount") failed_count: int | None = Field(default=None, alias="FailedCount") - incorrect_version_count: int | None = Field( - default=None, alias="IncorrectVersionCount" - ) + incorrect_version_count: int | None = Field(default=None, alias="IncorrectVersionCount") non_compliant_count: int | None = Field(default=None, alias="NonCompliantCount") not_attempted_count: int | None = Field(default=None, alias="NotAttemptedCount") @@ -3197,20 +2749,18 @@ class AutomateThirdPartyPatchVersion(ConnectWiseModel): lt_product_key: UUID | None = Field( default=None, alias="LTProductKey", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) versions: list[str] | None = Field(default=None, alias="Versions") class AutomateUserBinaryExtensionPermission(ConnectWiseModel): has_permission: bool | None = Field(default=None, alias="HasPermission") - extension_permission_id: int | None = Field( - default=None, alias="ExtensionPermissionId" - ) + extension_permission_id: int | None = Field(default=None, alias="ExtensionPermissionId") extension_guid: UUID | None = Field( default=None, alias="ExtensionGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) extension_name: str | None = Field(default=None, alias="ExtensionName") permission_id: int | None = Field(default=None, alias="PermissionId") @@ -3219,9 +2769,7 @@ class AutomateUserBinaryExtensionPermission(ConnectWiseModel): class AutomateUserExtensionClaimType(ConnectWiseModel): has_claim: bool | None = Field(default=None, alias="HasClaim") - extension_claim_type_id: int | None = Field( - default=None, alias="ExtensionClaimTypeId" - ) + extension_claim_type_id: int | None = Field(default=None, alias="ExtensionClaimTypeId") web_extension_id: int | None = Field(default=None, alias="WebExtensionId") display_name: str | None = Field(default=None, alias="DisplayName") claim_key: str | None = Field(default=None, alias="ClaimKey") @@ -3277,9 +2825,7 @@ class AutomateUserAvatar(ConnectWiseModel): class AutomateExtensionClaimViewModel(ConnectWiseModel): - extension_claim_type_id: int | None = Field( - default=None, alias="ExtensionClaimTypeId" - ) + extension_claim_type_id: int | None = Field(default=None, alias="ExtensionClaimTypeId") display_name: str | None = Field(default=None, alias="DisplayName") description: str | None = Field(default=None, alias="Description") is_assigned: bool | None = Field(default=None, alias="IsAssigned") @@ -3294,9 +2840,7 @@ class AutomateAssignedWebExtension(ConnectWiseModel): class LabTechUserFavorite(ConnectWiseModel): id: int | None = Field(default=None, alias="Id") user_id: int | None = Field(default=None, alias="UserId") - additional_identifier: str | None = Field( - default=None, alias="AdditionalIdentifier" - ) + additional_identifier: str | None = Field(default=None, alias="AdditionalIdentifier") order: int | None = Field(default=None, alias="Order") item_guid: str | None = Field(default=None, alias="ItemGUID") @@ -3335,50 +2879,30 @@ class AutomateUserLockoutInfo(ConnectWiseModel): is_locked: bool | None = Field(default=None, alias="IsLocked") failed_login_count: int | None = Field(default=None, alias="FailedLoginCount") last_fail_date_utc: datetime | None = Field(default=None, alias="LastFailDateUtc") - lock_out_expiration_date_utc: datetime | None = Field( - default=None, alias="LockOutExpirationDateUtc" - ) + lock_out_expiration_date_utc: datetime | None = Field(default=None, alias="LockOutExpirationDateUtc") class AutomateGroupPermissionSettings(ConnectWiseModel): is_inherited: bool | None = Field(default=None, alias="IsInherited") - computer_permission_settings: dict[str, list[str]] | None = Field( - default=None, alias="ComputerPermissionSettings" - ) + computer_permission_settings: dict[str, list[str]] | None = Field(default=None, alias="ComputerPermissionSettings") class AutomateMonitorAlertPolicy(ConnectWiseModel): - effective_policy_type_id: int | None = Field( - default=None, alias="EffectivePolicyTypeId" - ) - effective_policy_type_name: str | None = Field( - default=None, alias="EffectivePolicyTypeName" - ) - is_alert_template_overridden: bool | None = Field( - default=None, alias="IsAlertTemplateOverridden" - ) + effective_policy_type_id: int | None = Field(default=None, alias="EffectivePolicyTypeId") + effective_policy_type_name: str | None = Field(default=None, alias="EffectivePolicyTypeName") + is_alert_template_overridden: bool | None = Field(default=None, alias="IsAlertTemplateOverridden") alert_template_id: int | None = Field(default=None, alias="AlertTemplateId") alert_template_name: str | None = Field(default=None, alias="AlertTemplateName") - alert_template_description: str | None = Field( - default=None, alias="AlertTemplateDescription" - ) - is_ticket_category_overridden: bool | None = Field( - default=None, alias="IsTicketCategoryOverridden" - ) + alert_template_description: str | None = Field(default=None, alias="AlertTemplateDescription") + is_ticket_category_overridden: bool | None = Field(default=None, alias="IsTicketCategoryOverridden") ticket_category_id: int | None = Field(default=None, alias="TicketCategoryId") ticket_category_name: str | None = Field(default=None, alias="TicketCategoryName") - inheritance_source_name: str | None = Field( - default=None, alias="InheritanceSourceName" - ) + inheritance_source_name: str | None = Field(default=None, alias="InheritanceSourceName") class AutomateAlertingOverride(ConnectWiseModel): - alert_template: AutomateAlertTemplate | None = Field( - default=None, alias="AlertTemplate" - ) - ticket_category: AutomateTicketCategory | None = Field( - default=None, alias="TicketCategory" - ) + alert_template: AutomateAlertTemplate | None = Field(default=None, alias="AlertTemplate") + ticket_category: AutomateTicketCategory | None = Field(default=None, alias="TicketCategory") class AutomateTargetType(AutomateRunningScriptTargetType): @@ -3466,9 +2990,7 @@ class AutomateEventLogSettings(ConnectWiseModel): class AutomateExecutableSettings(ConnectWiseModel): - executable_invocation: str | None = Field( - default=None, alias="ExecutableInvocation" - ) + executable_invocation: str | None = Field(default=None, alias="ExecutableInvocation") class AutomateWmiSettings(ConnectWiseModel): @@ -3484,12 +3006,8 @@ class AutomateBandwidthSettings(ConnectWiseModel): snmp_v3_user_name: str | None = Field(default=None, alias="SnmpV3UserName") snmp_v3_auth_password: str | None = Field(default=None, alias="SnmpV3AuthPassword") snmp_v3_auth_method_id: int | None = Field(default=None, alias="SnmpV3AuthMethodId") - snmp_v3_encryption_password: str | None = Field( - default=None, alias="SnmpV3EncryptionPassword" - ) - snmp_v3_encryption_method_id: int | None = Field( - default=None, alias="SnmpV3EncryptionMethodId" - ) + snmp_v3_encryption_password: str | None = Field(default=None, alias="SnmpV3EncryptionPassword") + snmp_v3_encryption_method_id: int | None = Field(default=None, alias="SnmpV3EncryptionMethodId") class AutomateSensorSettings(ConnectWiseModel): @@ -3508,40 +3026,24 @@ class AutomateSubmittableScriptFolder(ConnectWiseModel): class AutomateScriptSettingsViewModel(ConnectWiseModel): - user_classes: list[AutomateUserClass] | None = Field( - default=None, alias="UserClasses" - ) - ticket_categories: list[AutomateTicketEntryCategory] | None = Field( - default=None, alias="TicketCategories" - ) - close_ticket_triggers: list[AutomateCloseTicketTrigger] | None = Field( - default=None, alias="CloseTicketTriggers" - ) + user_classes: list[AutomateUserClass] | None = Field(default=None, alias="UserClasses") + ticket_categories: list[AutomateTicketEntryCategory] | None = Field(default=None, alias="TicketCategories") + close_ticket_triggers: list[AutomateCloseTicketTrigger] | None = Field(default=None, alias="CloseTicketTriggers") users: list[AutomateTimeEntryTechnician] | None = Field(default=None, alias="Users") - stop_timer_triggers: list[AutomateStopTimerTrigger] | None = Field( - default=None, alias="StopTimerTriggers" - ) - ticket_time_categories: list[AutomateTimeEntryCategory] | None = Field( - default=None, alias="TicketTimeCategories" - ) + stop_timer_triggers: list[AutomateStopTimerTrigger] | None = Field(default=None, alias="StopTimerTriggers") + ticket_time_categories: list[AutomateTimeEntryCategory] | None = Field(default=None, alias="TicketTimeCategories") class AutomateScriptStepsViewModel(ConnectWiseModel): - disallowed_script_function_ids: list[int] | None = Field( - default=None, alias="DisallowedScriptFunctionIds" - ) + disallowed_script_function_ids: list[int] | None = Field(default=None, alias="DisallowedScriptFunctionIds") class AutomateScriptSummary(ConnectWiseModel): name: str | None = Field(default=None, alias="Name") description: str | None = Field(default=None, alias="Description") folder: AutomateScriptFolder | None = Field(default=None, alias="Folder") - script_target_type: AutomateScriptTarget | None = Field( - default=None, alias="ScriptTargetType" - ) - script_options: AutomateScriptOptions | None = Field( - default=None, alias="ScriptOptions" - ) + script_target_type: AutomateScriptTarget | None = Field(default=None, alias="ScriptTargetType") + script_options: AutomateScriptOptions | None = Field(default=None, alias="ScriptOptions") automation_minutes: int | None = Field(default=None, alias="AutomationMinutes") @@ -3552,18 +3054,12 @@ class AutomateRemoteCommand(ConnectWiseModel): class AutomateWebExtensionArea(ConnectWiseModel): web_extension_area_id: int | None = Field(default=None, alias="WebExtensionAreaId") - web_extension_area_name: str | None = Field( - default=None, alias="WebExtensionAreaName" - ) - web_extension_screen_id: int | None = Field( - default=None, alias="WebExtensionScreenId" - ) + web_extension_area_name: str | None = Field(default=None, alias="WebExtensionAreaName") + web_extension_screen_id: int | None = Field(default=None, alias="WebExtensionScreenId") class AutomateExtensionClaimType(ConnectWiseModel): - extension_claim_type_id: int | None = Field( - default=None, alias="ExtensionClaimTypeId" - ) + extension_claim_type_id: int | None = Field(default=None, alias="ExtensionClaimTypeId") web_extension_id: int | None = Field(default=None, alias="WebExtensionId") display_name: str | None = Field(default=None, alias="DisplayName") claim_key: str | None = Field(default=None, alias="ClaimKey") @@ -3585,7 +3081,7 @@ class AutomateExtensionSolution(ConnectWiseModel): solution_guid: UUID | None = Field( default=None, alias="SolutionGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) solution_name: str | None = Field(default=None, alias="SolutionName") is_installed: bool | None = Field(default=None, alias="IsInstalled") @@ -3612,18 +3108,12 @@ class AutomateCommandMenuItemBase1(ConnectWiseModel): display_name: str | None = Field(default=None, alias="DisplayName") display_order: int | None = Field(default=None, alias="DisplayOrder") menu_key: str | None = Field(default=None, alias="MenuKey") - sub_menus: list[AutomateCommandMenuItemBase1] | None = Field( - default=None, alias="SubMenus" - ) - menu_items: list[AutomateCommandMenuItemBase] | None = Field( - default=None, alias="MenuItems" - ) + sub_menus: list[AutomateCommandMenuItemBase1] | None = Field(default=None, alias="SubMenus") + menu_items: list[AutomateCommandMenuItemBase] | None = Field(default=None, alias="MenuItems") class LabTechProbeCommandHistoryEntry(ConnectWiseModel): - result_set: list[AutomateProbeCommandHistoryEntry] | None = Field( - default=None, alias="ResultSet" - ) + result_set: list[AutomateProbeCommandHistoryEntry] | None = Field(default=None, alias="ResultSet") total_record_count: int | None = Field(default=None, alias="TotalRecordCount") @@ -3632,9 +3122,7 @@ class AutomateString(AutomateComputerServiceItem): class AutomateGuid(ConnectWiseModel): - id: UUID | None = Field( - default=None, alias="Id", example="00000000-0000-0000-0000-000000000000" - ) + id: UUID | None = Field(default=None, alias="Id", examples=["00000000-0000-0000-0000-000000000000"]) name: str | None = Field(default=None, alias="Name") @@ -3647,9 +3135,7 @@ class LabTechQueryOptions(ConnectWiseModel): page: int | None = Field(default=None, alias="Page") page_size: int | None = Field(default=None, alias="PageSize") condition: str | None = Field(default=None, alias="Condition") - expands: dict[str, LabTechQueryOptionExpand] | None = Field( - default=None, alias="Expands" - ) + expands: dict[str, LabTechQueryOptionExpand] | None = Field(default=None, alias="Expands") included_fields: list[str] | None = Field(default=None, alias="IncludedFields") excluded_fields: list[str] | None = Field(default=None, alias="ExcludedFields") ids: list[str] | None = Field(default=None, alias="Ids") @@ -3673,9 +3159,7 @@ class AutomateAlert(ConnectWiseModel): class AutomateAuthInformation(ConnectWiseModel): allow_direct: bool | None = Field(default=None, alias="AllowDirect") - allow_service_registration: bool | None = Field( - default=None, alias="AllowServiceRegistration" - ) + allow_service_registration: bool | None = Field(default=None, alias="AllowServiceRegistration") automate_redirect_uri: str | None = Field(default=None, alias="AutomateRedirectUri") services: list[AutomateAuthService] | None = Field(default=None, alias="Services") @@ -3683,17 +3167,13 @@ class AutomateAuthInformation(ConnectWiseModel): class AutomateAutomaticApprovalSettings(ConnectWiseModel): cvss_lower_bound: int | None = Field(default=None, alias="CvssLowerBound") severities: list[str] | None = Field(default=None, alias="Severities") - categories: list[AutomateWindowsUpdateCategory] | None = Field( - default=None, alias="Categories" - ) + categories: list[AutomateWindowsUpdateCategory] | None = Field(default=None, alias="Categories") titles: list[str] | None = Field(default=None, alias="Titles") class AutomateAutomaticPolicySettings(ConnectWiseModel): severities: list[str] | None = Field(default=None, alias="Severities") - categories: list[AutomateWindowsUpdateCategory] | None = Field( - default=None, alias="Categories" - ) + categories: list[AutomateWindowsUpdateCategory] | None = Field(default=None, alias="Categories") titles: list[str] | None = Field(default=None, alias="Titles") @@ -3701,15 +3181,9 @@ class AutomateAuditAnalyticsBundle(ConnectWiseModel): audit_action_id: int | None = Field(default=None, alias="AuditActionId") external_id: int | None = Field(default=None, alias="ExternalId") secondary_identifier: str | None = Field(default=None, alias="SecondaryIdentifier") - unsanitized_base_message: str | None = Field( - default=None, alias="UnsanitizedBaseMessage" - ) - extra_log_values: list[SystemString] | None = Field( - default=None, alias="ExtraLogValues" - ) - sanitized_analytics_description: str | None = Field( - default=None, alias="SanitizedAnalyticsDescription" - ) + unsanitized_base_message: str | None = Field(default=None, alias="UnsanitizedBaseMessage") + extra_log_values: list[SystemString] | None = Field(default=None, alias="ExtraLogValues") + sanitized_analytics_description: str | None = Field(default=None, alias="SanitizedAnalyticsDescription") class AutomateAdvanceStageRequest(ConnectWiseModel): @@ -3719,9 +3193,7 @@ class AutomateAdvanceStageRequest(ConnectWiseModel): class AutomateWindowsApprovalPolicyPatchBatchRequest(ConnectWiseModel): - patch_policies: list[AutomateWindowsApprovalPolicyPatch] | None = Field( - default=None, alias="PatchPolicies" - ) + patch_policies: list[AutomateWindowsApprovalPolicyPatch] | None = Field(default=None, alias="PatchPolicies") class AutomateApprovalPolicyThirdPartyPatchRequest(ConnectWiseModel): @@ -3735,54 +3207,42 @@ class AutomateWebClientAccessBatchResult(AutomateContactPermissionBatchResult): class AutomateContactPermissionBatchResponse(ConnectWiseModel): - contact_permission_results: list[ - AutomateContactPermissionBatchResult - ] | None = Field(default=None, alias="ContactPermissionResults") - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" + contact_permission_results: list[AutomateContactPermissionBatchResult] | None = Field( + default=None, alias="ContactPermissionResults" ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateDeleteIpRestrictionsBatchResponse(ConnectWiseModel): - ip_restrictions_results: list[ - AutomateDeleteIpRestrictionsBatchResult - ] | None = Field(default=None, alias="IpRestrictionsResults") - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" + ip_restrictions_results: list[AutomateDeleteIpRestrictionsBatchResult] | None = Field( + default=None, alias="IpRestrictionsResults" ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateAddIpRestrictionsBatchRequest(ConnectWiseModel): - ip_restriction_rules: list[AutomateIpRestrictionRule] | None = Field( - default=None, alias="IpRestrictionRules" - ) + ip_restriction_rules: list[AutomateIpRestrictionRule] | None = Field(default=None, alias="IpRestrictionRules") class AutomateAddIpRestrictionsBatchResponse(ConnectWiseModel): ip_restrictions_results: list[AutomateAddIpRestrictionsBatchResult] | None = Field( default=None, alias="IpRestrictionsResults" ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateExecuteProbeBatchResponse(ConnectWiseModel): probe_command_results: list[AutomateExecuteProbeCommandResult] | None = Field( default=None, alias="ProbeCommandResults" ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateDeleteRemoteMonitorBatchResponse(ConnectWiseModel): remote_monitor_results: list[AutomateDeleteRemoteMonitorBatchResult] | None = Field( default=None, alias="RemoteMonitorResults" ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateDistributionWindow(ConnectWiseModel): @@ -3794,12 +3254,8 @@ class AutomateDistributionWindow(ConnectWiseModel): class AutomateWeeklyScheduleFrequency(ConnectWiseModel): runs_at: str | None = Field(default=None, alias="RunsAt") - weeks_of_month_settings: AutomateWeeksOfMonthSettings | None = Field( - default=None, alias="WeeksOfMonthSettings" - ) - days_of_week_settings: AutomateDaysOfWeekSettings | None = Field( - default=None, alias="DaysOfWeekSettings" - ) + weeks_of_month_settings: AutomateWeeksOfMonthSettings | None = Field(default=None, alias="WeeksOfMonthSettings") + days_of_week_settings: AutomateDaysOfWeekSettings | None = Field(default=None, alias="DaysOfWeekSettings") class AutomateDailyRepeatSettings(ConnectWiseModel): @@ -3811,48 +3267,30 @@ class AutomateDailyRepeatSettings(ConnectWiseModel): class AutomateScheduleScriptBatchResponse(ConnectWiseModel): - script_results: list[AutomateScheduleScriptBatchResult] | None = Field( - default=None, alias="ScriptResults" - ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + script_results: list[AutomateScheduleScriptBatchResult] | None = Field(default=None, alias="ScriptResults") + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateDeleteScriptBatchResponse(ConnectWiseModel): - script_results: list[AutomateDeleteScriptBatchResult] | None = Field( - default=None, alias="ScriptResults" - ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + script_results: list[AutomateDeleteScriptBatchResult] | None = Field(default=None, alias="ScriptResults") + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateSearchesBatchResponse(ConnectWiseModel): - searches_results: list[AutomateDeleteSearchesBatchResult] | None = Field( - default=None, alias="SearchesResults" - ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + searches_results: list[AutomateDeleteSearchesBatchResult] | None = Field(default=None, alias="SearchesResults") + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateSendToSearchesBatchResponse(ConnectWiseModel): - search_results: list[AutomateSendToBatchResult] | None = Field( - default=None, alias="SearchResults" - ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + search_results: list[AutomateSendToBatchResult] | None = Field(default=None, alias="SearchResults") + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateExecuteComputersBatchResponse(ConnectWiseModel): - computer_command_result_list: list[ - AutomateExecuteComputerCommandResult - ] | None = Field(default=None, alias="ComputerCommandResultList") - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" + computer_command_result_list: list[AutomateExecuteComputerCommandResult] | None = Field( + default=None, alias="ComputerCommandResultList" ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateExecuteToggleServiceUserCommandBatchRequest(ConnectWiseModel): @@ -3898,13 +3336,9 @@ class AutomateBinaryExtension(ConnectWiseModel): description: str | None = Field(default=None, alias="Description") file_data: str | None = Field(default=None, alias="FileData") is_enabled: bool | None = Field(default=None, alias="IsEnabled") - is_loaded_in_automation_server: bool | None = Field( - default=None, alias="IsLoadedInAutomationServer" - ) + is_loaded_in_automation_server: bool | None = Field(default=None, alias="IsLoadedInAutomationServer") is_loaded_in_iis: bool | None = Field(default=None, alias="IsLoadedInIIS") - is_remote_agent_extension: bool | None = Field( - default=None, alias="IsRemoteAgentExtension" - ) + is_remote_agent_extension: bool | None = Field(default=None, alias="IsRemoteAgentExtension") release_date: datetime | None = Field(default=None, alias="ReleaseDate") run_style: AutomateRunStyle | None = Field(default=None, alias="RunStyle") author: str | None = Field(default=None, alias="Author") @@ -3914,7 +3348,7 @@ class AutomateBinaryExtension(ConnectWiseModel): extension_guid: UUID | None = Field( default=None, alias="ExtensionGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) extension_id: int | None = Field(default=None, alias="ExtensionId") version: str | None = Field(default=None, alias="Version") @@ -3924,45 +3358,19 @@ class LabTechRemoteAgentSchedule(ConnectWiseModel): id: str | None = Field(default=None, alias="Id") name: str | None = Field(default=None, alias="Name") update_config: LabTechSchedule | None = Field(default=None, alias="UpdateConfig") - hardware_inventory: LabTechSchedule | None = Field( - default=None, alias="HardwareInventory" - ) - system_inventory: LabTechSchedule | None = Field( - default=None, alias="SystemInventory" - ) - drive_inventory: LabTechSchedule | None = Field( - default=None, alias="DriveInventory" - ) - process_inventory: LabTechSchedule | None = Field( - default=None, alias="ProcessInventory" - ) - maleware_inventory: LabTechSchedule | None = Field( - default=None, alias="MalewareInventory" - ) - software_inventory: LabTechSchedule | None = Field( - default=None, alias="SoftwareInventory" - ) - event_inventory: LabTechSchedule | None = Field( - default=None, alias="EventInventory" - ) - printer_inventory: LabTechSchedule | None = Field( - default=None, alias="PrinterInventory" - ) - network_inventory: LabTechSchedule | None = Field( - default=None, alias="NetworkInventory" - ) - network_analysis: LabTechSchedule | None = Field( - default=None, alias="NetworkAnalysis" - ) - hotfix_inventory: LabTechSchedule | None = Field( - default=None, alias="HotfixInventory" - ) - service_inventory: LabTechSchedule | None = Field( - default=None, alias="ServiceInventory" - ) - network_probe_inventory: LabTechSchedule | None = Field( - default=None, alias="NetworkProbeInventory" - ) + hardware_inventory: LabTechSchedule | None = Field(default=None, alias="HardwareInventory") + system_inventory: LabTechSchedule | None = Field(default=None, alias="SystemInventory") + drive_inventory: LabTechSchedule | None = Field(default=None, alias="DriveInventory") + process_inventory: LabTechSchedule | None = Field(default=None, alias="ProcessInventory") + maleware_inventory: LabTechSchedule | None = Field(default=None, alias="MalewareInventory") + software_inventory: LabTechSchedule | None = Field(default=None, alias="SoftwareInventory") + event_inventory: LabTechSchedule | None = Field(default=None, alias="EventInventory") + printer_inventory: LabTechSchedule | None = Field(default=None, alias="PrinterInventory") + network_inventory: LabTechSchedule | None = Field(default=None, alias="NetworkInventory") + network_analysis: LabTechSchedule | None = Field(default=None, alias="NetworkAnalysis") + hotfix_inventory: LabTechSchedule | None = Field(default=None, alias="HotfixInventory") + service_inventory: LabTechSchedule | None = Field(default=None, alias="ServiceInventory") + network_probe_inventory: LabTechSchedule | None = Field(default=None, alias="NetworkProbeInventory") last_update: datetime | None = Field(default=None, alias="LastUpdate") last_user: str | None = Field(default=None, alias="LastUser") @@ -3970,9 +3378,7 @@ class LabTechRemoteAgentSchedule(ConnectWiseModel): class LabTechSearch(ConnectWiseModel): id: str | None = Field(default=None, alias="Id") name: str | None = Field(default=None, alias="Name") - search_folder: LabTechSearchFolder | None = Field( - default=None, alias="SearchFolder" - ) + search_folder: LabTechSearchFolder | None = Field(default=None, alias="SearchFolder") is_read_only: bool | None = Field(default=None, alias="IsReadOnly") search_type: Literal[ "AdvancedComputers", @@ -3985,9 +3391,7 @@ class LabTechSearch(ConnectWiseModel): class LabTechUserClass(ConnectWiseModel): id: str | None = Field(default=None, alias="Id") name: str | None = Field(default=None, alias="Name") - permissions: LabTechUserPermissions | None = Field( - default=None, alias="Permissions" - ) + permissions: LabTechUserPermissions | None = Field(default=None, alias="Permissions") class LabTechUser(ConnectWiseModel): @@ -3995,9 +3399,7 @@ class LabTechUser(ConnectWiseModel): folder: LabTechUserFolder | None = Field(default=None, alias="Folder") name: str | None = Field(default=None, alias="Name") email_address: str | None = Field(default=None, alias="EmailAddress") - sso_status: LabTechUserSingleSignOnStatus | None = Field( - default=None, alias="SsoStatus" - ) + sso_status: LabTechUserSingleSignOnStatus | None = Field(default=None, alias="SsoStatus") class LabTechComputerMonitor(ConnectWiseModel): @@ -4008,13 +3410,9 @@ class LabTechComputerMonitor(ConnectWiseModel): state: str | None = Field(default=None, alias="State") last_scanned: datetime | None = Field(default=None, alias="LastScanned") last_failed: datetime | None = Field(default=None, alias="LastFailed") - last_inventory_date: datetime | None = Field( - default=None, alias="LastInventoryDate" - ) + last_inventory_date: datetime | None = Field(default=None, alias="LastInventoryDate") alert_action: LabTechAlertAction | None = Field(default=None, alias="AlertAction") - monitor_history: LabTechComputerMonitorHistory | None = Field( - default=None, alias="MonitorHistory" - ) + monitor_history: LabTechComputerMonitorHistory | None = Field(default=None, alias="MonitorHistory") class LabTechTicketComment(ConnectWiseModel): @@ -4033,9 +3431,7 @@ class LabTechCommandExecute(ConnectWiseModel): parameters: list[str] | None = Field(default=None, alias="Parameters") output: str | None = Field(default=None, alias="Output") fastalk: bool | None = Field(default=None, alias="Fastalk") - date_last_inventoried: datetime | None = Field( - default=None, alias="DateLastInventoried" - ) + date_last_inventoried: datetime | None = Field(default=None, alias="DateLastInventoried") class LabTechSmartData(ConnectWiseModel): @@ -4059,9 +3455,7 @@ class LabTechComputerMicrosoftUpdateData(ConnectWiseModel): is_non_compliant: bool | None = Field(default=None, alias="IsNonCompliant") knowledge_base_id: int | None = Field(default=None, alias="KnowledgeBaseId") microsoft_update_id: str | None = Field(default=None, alias="MicrosoftUpdateId") - policy_approval: LabTechPolicyApprovalSetting | None = Field( - default=None, alias="PolicyApproval" - ) + policy_approval: LabTechPolicyApprovalSetting | None = Field(default=None, alias="PolicyApproval") release_date: datetime | None = Field(default=None, alias="ReleaseDate") severity: str | None = Field(default=None, alias="Severity") title: str | None = Field(default=None, alias="Title") @@ -4069,9 +3463,7 @@ class LabTechComputerMicrosoftUpdateData(ConnectWiseModel): class SystemWaitHandle(ConnectWiseModel): - safe_wait_handle: MicrosoftSafeWaitHandle | None = Field( - default=None, alias="SafeWaitHandle" - ) + safe_wait_handle: MicrosoftSafeWaitHandle | None = Field(default=None, alias="SafeWaitHandle") class LabTechComputerMemorySlot(ConnectWiseModel): @@ -4079,9 +3471,7 @@ class LabTechComputerMemorySlot(ConnectWiseModel): computer_id: int | None = Field(default=None, alias="ComputerId") slot_name: str | None = Field(default=None, alias="SlotName") bank: str | None = Field(default=None, alias="Bank") - form_factor: LabTechMemoryFormFactor | None = Field( - default=None, alias="FormFactor" - ) + form_factor: LabTechMemoryFormFactor | None = Field(default=None, alias="FormFactor") total_width: int | None = Field(default=None, alias="TotalWidth") data_width: int | None = Field(default=None, alias="DataWidth") size: int | None = Field(default=None, alias="Size") @@ -4102,9 +3492,7 @@ class LabTechComputerProcessor(ConnectWiseModel): family: LabTechProcessorFamily | None = Field(default=None, alias="Family") manufacturer: str | None = Field(default=None, alias="Manufacturer") speed: int | None = Field(default=None, alias="Speed") - cache_list: list[LabTechComputerProcessorCache] | None = Field( - default=None, alias="CacheList" - ) + cache_list: list[LabTechComputerProcessorCache] | None = Field(default=None, alias="CacheList") serial_number: str | None = Field(default=None, alias="SerialNumber") part_number: str | None = Field(default=None, alias="PartNumber") cores: int | None = Field(default=None, alias="Cores") @@ -4128,13 +3516,9 @@ class LabTechComputerService(ConnectWiseModel): path_name: str | None = Field(default=None, alias="PathName") service_type: str | None = Field(default=None, alias="ServiceType") username: str | None = Field(default=None, alias="Username") - date_last_inventoried: datetime | None = Field( - default=None, alias="DateLastInventoried" - ) + date_last_inventoried: datetime | None = Field(default=None, alias="DateLastInventoried") run_levels: str | None = Field(default=None, alias="RunLevels") - classification: LabTechServiceClassification | None = Field( - default=None, alias="Classification" - ) + classification: LabTechServiceClassification | None = Field(default=None, alias="Classification") class LabTechComputerSoftware(ConnectWiseModel): @@ -4146,12 +3530,8 @@ class LabTechComputerSoftware(ConnectWiseModel): size: int | None = Field(default=None, alias="Size") uninstaller_path: str | None = Field(default=None, alias="UninstallerPath") version: str | None = Field(default=None, alias="Version") - classification: LabTechSoftwareClassification | None = Field( - default=None, alias="Classification" - ) - date_last_inventoried: datetime | None = Field( - default=None, alias="DateLastInventoried" - ) + classification: LabTechSoftwareClassification | None = Field(default=None, alias="Classification") + date_last_inventoried: datetime | None = Field(default=None, alias="DateLastInventoried") client_id: int | None = Field(default=None, alias="ClientId") computer_name: str | None = Field(default=None, alias="ComputerName") @@ -4162,9 +3542,7 @@ class LabTechComputerVideoCard(ConnectWiseModel): video_processor: str | None = Field(default=None, alias="VideoProcessor") mode: str | None = Field(default=None, alias="Mode") memory: str | None = Field(default=None, alias="Memory") - architecture: LabTechVideoCardArchitecture | None = Field( - default=None, alias="Architecture" - ) + architecture: LabTechVideoCardArchitecture | None = Field(default=None, alias="Architecture") memory_type: LabTechVideoCardMemory | None = Field(default=None, alias="MemoryType") dac_adapter: str | None = Field(default=None, alias="DACAdapter") bits_per_pixel: int | None = Field(default=None, alias="BitsPerPixel") @@ -4175,9 +3553,7 @@ class LabTechComputerSensor(ConnectWiseModel): computer_id: int | None = Field(default=None, alias="ComputerId") sensor_id: int | None = Field(default=None, alias="SensorId") sensor_name: str | None = Field(default=None, alias="SensorName") - device_type: LabTechSensorDeviceType | None = Field( - default=None, alias="DeviceType" - ) + device_type: LabTechSensorDeviceType | None = Field(default=None, alias="DeviceType") monitor: str | None = Field(default=None, alias="Monitor") value: float | None = Field(default=None, alias="Value") max_value: float | None = Field(default=None, alias="MaxValue") @@ -4186,14 +3562,10 @@ class LabTechComputerSensor(ConnectWiseModel): class LabTechComputerThirdPartyPatch(ConnectWiseModel): approved_version: str | None = Field(default=None, alias="ApprovedVersion") available_version: str | None = Field(default=None, alias="AvailableVersion") - compliance_state: LabTechPatchComplianceState | None = Field( - default=None, alias="ComplianceState" - ) + compliance_state: LabTechPatchComplianceState | None = Field(default=None, alias="ComplianceState") computer_id: int | None = Field(default=None, alias="ComputerId") display_title: str | None = Field(default=None, alias="DisplayTitle") - install_action: LabTechThirdParyInstallAction | None = Field( - default=None, alias="InstallAction" - ) + install_action: LabTechThirdParyInstallAction | None = Field(default=None, alias="InstallAction") install_date: datetime | None = Field(default=None, alias="InstallDate") install_state: str | None = Field(default=None, alias="InstallState") installed_version: str | None = Field(default=None, alias="InstalledVersion") @@ -4204,9 +3576,7 @@ class LabTechComputerThirdPartyPatch(ConnectWiseModel): is_non_compliant: bool | None = Field(default=None, alias="IsNonCompliant") manufacturer: str | None = Field(default=None, alias="Manufacturer") patch_id: str | None = Field(default=None, alias="PatchId") - policy_approval: LabTechThirdPartyPolicyApproval | None = Field( - default=None, alias="PolicyApproval" - ) + policy_approval: LabTechThirdPartyPolicyApproval | None = Field(default=None, alias="PolicyApproval") software_id: str | None = Field(default=None, alias="SoftwareId") title: str | None = Field(default=None, alias="Title") @@ -4224,47 +3594,29 @@ class AutomateDeploymentLogin(ConnectWiseModel): class AutomateExtraField(ConnectWiseModel): target_id: int | None = Field(default=None, alias="TargetId") - extra_field_definition_id: int | None = Field( - default=None, alias="ExtraFieldDefinitionId" - ) + extra_field_definition_id: int | None = Field(default=None, alias="ExtraFieldDefinitionId") title: str | None = Field(default=None, alias="Title") - display_format: AutomateExtraFieldDisplayFormat | None = Field( - default=None, alias="DisplayFormat" - ) + display_format: AutomateExtraFieldDisplayFormat | None = Field(default=None, alias="DisplayFormat") location: AutomateExtraFieldLocation | None = Field(default=None, alias="Location") - title_format: AutomateExtraFieldTitleFormat | None = Field( - default=None, alias="TitleFormat" - ) + title_format: AutomateExtraFieldTitleFormat | None = Field(default=None, alias="TitleFormat") section: str | None = Field(default=None, alias="Section") tooltip: str | None = Field(default=None, alias="Tooltip") is_read_only: bool | None = Field(default=None, alias="IsReadOnly") - text_field_settings: AutomateTextFieldSettings | None = Field( - default=None, alias="TextFieldSettings" - ) - dropdown_settings: AutomateDropdownSettings | None = Field( - default=None, alias="DropdownSettings" - ) - checkbox_settings: AutomateCheckboxSettings | None = Field( - default=None, alias="CheckboxSettings" - ) + text_field_settings: AutomateTextFieldSettings | None = Field(default=None, alias="TextFieldSettings") + dropdown_settings: AutomateDropdownSettings | None = Field(default=None, alias="DropdownSettings") + checkbox_settings: AutomateCheckboxSettings | None = Field(default=None, alias="CheckboxSettings") class AutomateExecuteDeviceCommandResponse(ConnectWiseModel): command_result_list: list[AutomateExecuteDeviceCommandResult] | None = Field( default=None, alias="CommandResultList" ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateExecuteDeviceScriptResponse(ConnectWiseModel): - script_result_list: list[AutomateExecuteDeviceScriptResult] | None = Field( - default=None, alias="ScriptResultList" - ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + script_result_list: list[AutomateExecuteDeviceScriptResult] | None = Field(default=None, alias="ScriptResultList") + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class LabTechEventLog(ConnectWiseModel): @@ -4293,44 +3645,24 @@ class AutomateExtraFieldDefinition(ConnectWiseModel): sort_oder: int | None = Field(default=None, alias="SortOder") is_encrypted: bool | None = Field(default=None, alias="IsEncrypted") is_restricted: bool | None = Field(default=None, alias="IsRestricted") - read_user_classes: list[AutomateUserClass] | None = Field( - default=None, alias="ReadUserClasses" - ) - edit_user_classes: list[AutomateUserClass] | None = Field( - default=None, alias="EditUserClasses" - ) - extra_field_definition_id: int | None = Field( - default=None, alias="ExtraFieldDefinitionId" - ) + read_user_classes: list[AutomateUserClass] | None = Field(default=None, alias="ReadUserClasses") + edit_user_classes: list[AutomateUserClass] | None = Field(default=None, alias="EditUserClasses") + extra_field_definition_id: int | None = Field(default=None, alias="ExtraFieldDefinitionId") title: str | None = Field(default=None, alias="Title") - display_format: AutomateExtraFieldDisplayFormat | None = Field( - default=None, alias="DisplayFormat" - ) + display_format: AutomateExtraFieldDisplayFormat | None = Field(default=None, alias="DisplayFormat") location: AutomateExtraFieldLocation | None = Field(default=None, alias="Location") - title_format: AutomateExtraFieldTitleFormat | None = Field( - default=None, alias="TitleFormat" - ) + title_format: AutomateExtraFieldTitleFormat | None = Field(default=None, alias="TitleFormat") section: str | None = Field(default=None, alias="Section") tooltip: str | None = Field(default=None, alias="Tooltip") is_read_only: bool | None = Field(default=None, alias="IsReadOnly") - text_field_settings: AutomateTextFieldSettings | None = Field( - default=None, alias="TextFieldSettings" - ) - dropdown_settings: AutomateDropdownSettings | None = Field( - default=None, alias="DropdownSettings" - ) - checkbox_settings: AutomateCheckboxSettings | None = Field( - default=None, alias="CheckboxSettings" - ) + text_field_settings: AutomateTextFieldSettings | None = Field(default=None, alias="TextFieldSettings") + dropdown_settings: AutomateDropdownSettings | None = Field(default=None, alias="DropdownSettings") + checkbox_settings: AutomateCheckboxSettings | None = Field(default=None, alias="CheckboxSettings") class AutomateGroupAutoJoinSettings(ConnectWiseModel): - computer_auto_join_search: AutomateSearch | None = Field( - default=None, alias="ComputerAutoJoinSearch" - ) - is_limited_to_computer_auto_join: bool | None = Field( - default=None, alias="IsLimitedToComputerAutoJoin" - ) + computer_auto_join_search: AutomateSearch | None = Field(default=None, alias="ComputerAutoJoinSearch") + is_limited_to_computer_auto_join: bool | None = Field(default=None, alias="IsLimitedToComputerAutoJoin") class AutomatePatchingPolicySchedule(ConnectWiseModel): @@ -4338,79 +3670,47 @@ class AutomatePatchingPolicySchedule(ConnectWiseModel): window_start: str | None = Field(default=None, alias="WindowStart") window_duration: str | None = Field(default=None, alias="WindowDuration") policy_schedule_type: str | None = Field(default=None, alias="PolicyScheduleType") - dates_settings: AutomateDatesScheduleSettings | None = Field( - default=None, alias="DatesSettings" - ) - days_settings: AutomateDaysScheduleSettings | None = Field( - default=None, alias="DaysSettings" - ) + dates_settings: AutomateDatesScheduleSettings | None = Field(default=None, alias="DatesSettings") + days_settings: AutomateDaysScheduleSettings | None = Field(default=None, alias="DaysSettings") patch_tuesday_settings: AutomatePatchTuesdayScheduleSettings | None = Field( default=None, alias="PatchTuesdaySettings" ) class AutomatePatchingPolicyScriptOptions(ConnectWiseModel): - before_script_options: AutomatePatchingPolicyScript | None = Field( - default=None, alias="BeforeScriptOptions" - ) - after_script_options: AutomatePatchingPolicyScript | None = Field( - default=None, alias="AfterScriptOptions" - ) + before_script_options: AutomatePatchingPolicyScript | None = Field(default=None, alias="BeforeScriptOptions") + after_script_options: AutomatePatchingPolicyScript | None = Field(default=None, alias="AfterScriptOptions") class AutomateGroupTypeInformation(ConnectWiseModel): - inherited_group_type_id: int | None = Field( - default=None, alias="InheritedGroupTypeId" - ) + inherited_group_type_id: int | None = Field(default=None, alias="InheritedGroupTypeId") is_modifiable: bool | None = Field(default=None, alias="IsModifiable") - group_types: list[AutomateGroupType] | None = Field( - default=None, alias="GroupTypes" - ) + group_types: list[AutomateGroupType] | None = Field(default=None, alias="GroupTypes") class AutomateRemoteAgentTemplateInformation(ConnectWiseModel): - inherited_remote_agent_template_id: int | None = Field( - default=None, alias="InheritedRemoteAgentTemplateId" - ) + inherited_remote_agent_template_id: int | None = Field(default=None, alias="InheritedRemoteAgentTemplateId") is_modifiable: bool | None = Field(default=None, alias="IsModifiable") - remote_agent_templates: list[AutomateRemoteAgentTemplate] | None = Field( - default=None, alias="RemoteAgentTemplates" - ) + remote_agent_templates: list[AutomateRemoteAgentTemplate] | None = Field(default=None, alias="RemoteAgentTemplates") class AutomateInternalMonitorSubscriptionViewModel(ConnectWiseModel): - alert_templates: list[AutomateAlertTemplate] | None = Field( - default=None, alias="AlertTemplates" - ) - ticket_categories: list[AutomateTicketCategory] | None = Field( - default=None, alias="TicketCategories" - ) + alert_templates: list[AutomateAlertTemplate] | None = Field(default=None, alias="AlertTemplates") + ticket_categories: list[AutomateTicketCategory] | None = Field(default=None, alias="TicketCategories") is_group_subscribed: bool | None = Field(default=None, alias="IsGroupSubscribed") - is_subscription_inherited: bool | None = Field( - default=None, alias="IsSubscriptionInherited" - ) + is_subscription_inherited: bool | None = Field(default=None, alias="IsSubscriptionInherited") is_override_applied: bool | None = Field(default=None, alias="IsOverrideApplied") - monitor_alert_template_id: int | None = Field( - default=None, alias="MonitorAlertTemplateId" - ) - monitor_ticket_category_id: int | None = Field( - default=None, alias="MonitorTicketCategoryId" - ) - overridden_alert_template_id: int | None = Field( - default=None, alias="OverriddenAlertTemplateId" - ) - overridden_ticket_category_id: int | None = Field( - default=None, alias="OverriddenTicketCategoryId" - ) + monitor_alert_template_id: int | None = Field(default=None, alias="MonitorAlertTemplateId") + monitor_ticket_category_id: int | None = Field(default=None, alias="MonitorTicketCategoryId") + overridden_alert_template_id: int | None = Field(default=None, alias="OverriddenAlertTemplateId") + overridden_ticket_category_id: int | None = Field(default=None, alias="OverriddenTicketCategoryId") class LabTechScanFrequency(ConnectWiseModel): scan_frequency_id: int | None = Field(default=None, alias="ScanFrequencyId") frequency_in_minutes: int | None = Field(default=None, alias="FrequencyInMinutes") display_name: str | None = Field(default=None, alias="DisplayName") - frequency_category: LabTechScanFrequencyCategory | None = Field( - default=None, alias="FrequencyCategory" - ) + frequency_category: LabTechScanFrequencyCategory | None = Field(default=None, alias="FrequencyCategory") class LabTechManagedLicense(ConnectWiseModel): @@ -4424,39 +3724,27 @@ class LabTechManagedLicense(ConnectWiseModel): class AutomateManagementPackQuickSettingsResponse(ConnectWiseModel): - core_services_status: AutomateManagementPackStatus | None = Field( - default=None, alias="CoreServicesStatus" - ) - database_status: AutomateManagementPackStatus | None = Field( - default=None, alias="DatabaseStatus" - ) + core_services_status: AutomateManagementPackStatus | None = Field(default=None, alias="CoreServicesStatus") + database_status: AutomateManagementPackStatus | None = Field(default=None, alias="DatabaseStatus") messaging_services_status: AutomateManagementPackStatus | None = Field( default=None, alias="MessagingServicesStatus" ) - network_port_status: AutomateManagementPackStatus | None = Field( - default=None, alias="NetworkPortStatus" - ) + network_port_status: AutomateManagementPackStatus | None = Field(default=None, alias="NetworkPortStatus") websites_and_proxies_status: AutomateManagementPackStatus | None = Field( default=None, alias="WebsitesAndProxiesStatus" ) class AutomatePatchingPolicyWorkstationOptions(ConnectWiseModel): - send_wake_on_lan_packet: bool | None = Field( - default=None, alias="SendWakeOnLanPacket" - ) - create_windows_restore_point: bool | None = Field( - default=None, alias="CreateWindowsRestorePoint" - ) + send_wake_on_lan_packet: bool | None = Field(default=None, alias="SendWakeOnLanPacket") + create_windows_restore_point: bool | None = Field(default=None, alias="CreateWindowsRestorePoint") daytime_patching_options: AutomateDaytimePatchingOptions | None = Field( default=None, alias="DaytimePatchingOptions" ) class AutomateMicrosoftUpdatePolicyWindows10Options(ConnectWiseModel): - service_branch_settings: AutomateServiceBranchSettings | None = Field( - default=None, alias="ServiceBranchSettings" - ) + service_branch_settings: AutomateServiceBranchSettings | None = Field(default=None, alias="ServiceBranchSettings") feature_update_deferment_settings: AutomateUpdateDefermentSettings | None = Field( default=None, alias="FeatureUpdateDefermentSettings" ) @@ -4475,60 +3763,42 @@ class LabTechMonitorAlertStyle(ConnectWiseModel): class LabTechScriptData(ConnectWiseModel): - script_metadata: LabTechScriptMetadata | None = Field( - default=None, alias="ScriptMetadata" - ) - script_steps: list[LabTechScriptStep] | None = Field( - default=None, alias="ScriptSteps" - ) + script_metadata: LabTechScriptMetadata | None = Field(default=None, alias="ScriptMetadata") + script_steps: list[LabTechScriptStep] | None = Field(default=None, alias="ScriptSteps") class LabTechSnmpOidQueryParameters(ConnectWiseModel): ip_address: str | None = Field(default=None, alias="IpAddress") - snmp_version: LabTechSnmpOidQuerySnmpVersion | None = Field( - default=None, alias="SnmpVersion" - ) + snmp_version: LabTechSnmpOidQuerySnmpVersion | None = Field(default=None, alias="SnmpVersion") community: str | None = Field(default=None, alias="Community") username: str | None = Field(default=None, alias="Username") - encryption_method: LabTechSnmpOidQueryEncryptionMethod | None = Field( - default=None, alias="EncryptionMethod" - ) + encryption_method: LabTechSnmpOidQueryEncryptionMethod | None = Field(default=None, alias="EncryptionMethod") encryption_password: str | None = Field(default=None, alias="EncryptionPassword") authentication_method: LabTechSnmpOidQueryAuthenticationMethod | None = Field( default=None, alias="AuthenticationMethod" ) - authentication_password: str | None = Field( - default=None, alias="AuthenticationPassword" - ) + authentication_password: str | None = Field(default=None, alias="AuthenticationPassword") object_identifier: str | None = Field(default=None, alias="ObjectIdentifier") class LabTechHardwareSensorQueryParameters(ConnectWiseModel): - sensor: LabTechHardwareSensorQuerySensor | None = Field( - default=None, alias="Sensor" - ) + sensor: LabTechHardwareSensorQuerySensor | None = Field(default=None, alias="Sensor") sensor_number: str | None = Field(default=None, alias="SensorNumber") class LabTechRegistryValueQueryParameters(ConnectWiseModel): - hive: LabTechRegistryValueQueryRegistryHive | None = Field( - default=None, alias="Hive" - ) + hive: LabTechRegistryValueQueryRegistryHive | None = Field(default=None, alias="Hive") key: str | None = Field(default=None, alias="Key") value: str | None = Field(default=None, alias="Value") class LabTechEventLogQueryParameters(ConnectWiseModel): log: str | None = Field(default=None, alias="Log") - level_filter: LabTechEventLogQueryEventLevelFilter | None = Field( - default=None, alias="LevelFilter" - ) + level_filter: LabTechEventLogQueryEventLevelFilter | None = Field(default=None, alias="LevelFilter") keywords: int | None = Field(default=None, alias="Keywords") source: str | None = Field(default=None, alias="Source") event_id: int | None = Field(default=None, alias="EventId") - regular_expression_filter: str | None = Field( - default=None, alias="RegularExpressionFilter" - ) + regular_expression_filter: str | None = Field(default=None, alias="RegularExpressionFilter") class AutomateExecutePatchActionRequest(ConnectWiseModel): @@ -4550,104 +3820,48 @@ class LabTechProbeCommand(ConnectWiseModel): class LabTechNewProbeConfiguration(ConnectWiseModel): is_agent_push_enabled: bool | None = Field(default=None, alias="IsAgentPushEnabled") - is_automated_deployment_enabled: bool | None = Field( - default=None, alias="IsAutomatedDeploymentEnabled" - ) - is_data_collection_enabled: bool | None = Field( - default=None, alias="IsDataCollectionEnabled" - ) - is_snmp_trap_server_enabled: bool | None = Field( - default=None, alias="IsSnmpTrapServerEnabled" - ) - is_syslog_server_enabled: bool | None = Field( - default=None, alias="IsSyslogServerEnabled" - ) - is_tftp_server_enabled: bool | None = Field( - default=None, alias="IsTftpServerEnabled" - ) - credentials_list: list[LabTechProbeConfigurationCredentials] | None = Field( - default=None, alias="CredentialsList" - ) + is_automated_deployment_enabled: bool | None = Field(default=None, alias="IsAutomatedDeploymentEnabled") + is_data_collection_enabled: bool | None = Field(default=None, alias="IsDataCollectionEnabled") + is_snmp_trap_server_enabled: bool | None = Field(default=None, alias="IsSnmpTrapServerEnabled") + is_syslog_server_enabled: bool | None = Field(default=None, alias="IsSyslogServerEnabled") + is_tftp_server_enabled: bool | None = Field(default=None, alias="IsTftpServerEnabled") + credentials_list: list[LabTechProbeConfigurationCredentials] | None = Field(default=None, alias="CredentialsList") class LabTechDiscoveryScanSettings(ConnectWiseModel): - discovery_scan_frequency: LabTechScanFrequency | None = Field( - default=None, alias="DiscoveryScanFrequency" - ) - limit_discovery_to_scan_window: bool | None = Field( - default=None, alias="LimitDiscoveryToScanWindow" - ) - discovery_window_start: str | None = Field( - default=None, alias="DiscoveryWindowStart" - ) + discovery_scan_frequency: LabTechScanFrequency | None = Field(default=None, alias="DiscoveryScanFrequency") + limit_discovery_to_scan_window: bool | None = Field(default=None, alias="LimitDiscoveryToScanWindow") + discovery_window_start: str | None = Field(default=None, alias="DiscoveryWindowStart") discovery_window_end: str | None = Field(default=None, alias="DiscoveryWindowEnd") - is_mac_addres_scanning_enabled: bool | None = Field( - default=None, alias="IsMacAddresScanningEnabled" - ) - concurrent_thread_count: int | None = Field( - default=None, alias="ConcurrentThreadCount" - ) + is_mac_addres_scanning_enabled: bool | None = Field(default=None, alias="IsMacAddresScanningEnabled") + concurrent_thread_count: int | None = Field(default=None, alias="ConcurrentThreadCount") class LabTechStatusScanSettings(ConnectWiseModel): - status_scan_frequency: LabTechScanFrequency | None = Field( - default=None, alias="StatusScanFrequency" - ) - status_scan_network_port_list: str | None = Field( - default=None, alias="StatusScanNetworkPortList" - ) - network_port_option: LabTechStatusScanNetworkPortOption | None = Field( - default=None, alias="NetworkPortOption" - ) + status_scan_frequency: LabTechScanFrequency | None = Field(default=None, alias="StatusScanFrequency") + status_scan_network_port_list: str | None = Field(default=None, alias="StatusScanNetworkPortList") + network_port_option: LabTechStatusScanNetworkPortOption | None = Field(default=None, alias="NetworkPortOption") class LabTechProbeConfigurationDefaults(ConnectWiseModel): - probe_default_setting_id: int | None = Field( - default=None, alias="ProbeDefaultSettingId" - ) - community_string_get_list: str | None = Field( - default=None, alias="CommunityStringGetList" - ) - snmp_timeout_in_seconds: int | None = Field( - default=None, alias="SnmpTimeoutInSeconds" - ) - agent_deployment_attempt_maximum: int | None = Field( - default=None, alias="AgentDeploymentAttemptMaximum" - ) - discovery_settings: LabTechDiscoveryScanSettings | None = Field( - default=None, alias="DiscoverySettings" - ) - status_settings: LabTechStatusScanSettings | None = Field( - default=None, alias="StatusSettings" - ) - snmp_settings: LabTechSnmpSettings | None = Field( - default=None, alias="SnmpSettings" - ) - is_data_collection_enabled: bool | None = Field( - default=None, alias="IsDataCollectionEnabled" - ) - snmp_trap_server_listening_port: int | None = Field( - default=None, alias="SnmpTrapServerListeningPort" - ) - syslog_settings: LabTechSyslogServerSettings | None = Field( - default=None, alias="SyslogSettings" - ) - tftp_settings: LabTechTftpServerSettings | None = Field( - default=None, alias="TftpSettings" - ) + probe_default_setting_id: int | None = Field(default=None, alias="ProbeDefaultSettingId") + community_string_get_list: str | None = Field(default=None, alias="CommunityStringGetList") + snmp_timeout_in_seconds: int | None = Field(default=None, alias="SnmpTimeoutInSeconds") + agent_deployment_attempt_maximum: int | None = Field(default=None, alias="AgentDeploymentAttemptMaximum") + discovery_settings: LabTechDiscoveryScanSettings | None = Field(default=None, alias="DiscoverySettings") + status_settings: LabTechStatusScanSettings | None = Field(default=None, alias="StatusSettings") + snmp_settings: LabTechSnmpSettings | None = Field(default=None, alias="SnmpSettings") + is_data_collection_enabled: bool | None = Field(default=None, alias="IsDataCollectionEnabled") + snmp_trap_server_listening_port: int | None = Field(default=None, alias="SnmpTrapServerListeningPort") + syslog_settings: LabTechSyslogServerSettings | None = Field(default=None, alias="SyslogSettings") + tftp_settings: LabTechTftpServerSettings | None = Field(default=None, alias="TftpSettings") class LabTechProbeSnmpV3Configuration(ConnectWiseModel): - probe_snmp_configuration_id: int | None = Field( - default=None, alias="ProbeSnmpConfigurationId" - ) + probe_snmp_configuration_id: int | None = Field(default=None, alias="ProbeSnmpConfigurationId") snmp_v3_username: str | None = Field(default=None, alias="SnmpV3Username") - authentication: LabTechProbeSnmpAuthentication | None = Field( - default=None, alias="Authentication" - ) - encryption: LabTechProbeSnmpEncryption | None = Field( - default=None, alias="Encryption" - ) + authentication: LabTechProbeSnmpAuthentication | None = Field(default=None, alias="Authentication") + encryption: LabTechProbeSnmpEncryption | None = Field(default=None, alias="Encryption") class AutomatePromptWithoutDeadlineSettings(ConnectWiseModel): @@ -4658,31 +3872,19 @@ class AutomatePromptWithoutDeadlineSettings(ConnectWiseModel): schedule_trigger_settings: AutomatePatchingPolicySchedule | None = Field( default=None, alias="ScheduleTriggerSettings" ) - prompt_settings: AutomateRebootPolicyPromptSettings | None = Field( - default=None, alias="PromptSettings" - ) - reboot_prior_to_patch_job_installs: bool | None = Field( - default=None, alias="RebootPriorToPatchJobInstalls" - ) + prompt_settings: AutomateRebootPolicyPromptSettings | None = Field(default=None, alias="PromptSettings") + reboot_prior_to_patch_job_installs: bool | None = Field(default=None, alias="RebootPriorToPatchJobInstalls") maintenance_mode_options: AutomateRebootPolicyMaintenanceModeOptions | None = Field( default=None, alias="MaintenanceModeOptions" ) - script_options: AutomatePatchingPolicyScriptOptions | None = Field( - default=None, alias="ScriptOptions" - ) + script_options: AutomatePatchingPolicyScriptOptions | None = Field(default=None, alias="ScriptOptions") class AutomateDisableServerPatchRebootServerSettings(ConnectWiseModel): - alert_template: AutomateAlertTemplate | None = Field( - default=None, alias="AlertTemplate" - ) + alert_template: AutomateAlertTemplate | None = Field(default=None, alias="AlertTemplate") alert_message: str | None = Field(default=None, alias="AlertMessage") - ticket_category: AutomateTicketCategory | None = Field( - default=None, alias="TicketCategory" - ) - report_category: AutomateReportCategory | None = Field( - default=None, alias="ReportCategory" - ) + ticket_category: AutomateTicketCategory | None = Field(default=None, alias="TicketCategory") + report_category: AutomateReportCategory | None = Field(default=None, alias="ReportCategory") class AutomateRecordedAction(ConnectWiseModel): @@ -4694,9 +3896,7 @@ class AutomateRecordedAction(ConnectWiseModel): class AutomateRunningScriptTarget(ConnectWiseModel): - target_type: AutomateRunningScriptTargetType | None = Field( - default=None, alias="TargetType" - ) + target_type: AutomateRunningScriptTargetType | None = Field(default=None, alias="TargetType") computer: AutomateComputer | None = Field(default=None, alias="Computer") client: AutomateClient | None = Field(default=None, alias="Client") @@ -4710,35 +3910,23 @@ class AutomateScriptSource(ConnectWiseModel): class AutomateTicketEntrySettings(ConnectWiseModel): ticket_subject: str | None = Field(default=None, alias="TicketSubject") ticket_requestor: str | None = Field(default=None, alias="TicketRequestor") - ticket_category: AutomateTicketEntryCategory | None = Field( - default=None, alias="TicketCategory" - ) - close_ticket_trigger: AutomateCloseTicketTrigger | None = Field( - default=None, alias="CloseTicketTrigger" - ) + ticket_category: AutomateTicketEntryCategory | None = Field(default=None, alias="TicketCategory") + close_ticket_trigger: AutomateCloseTicketTrigger | None = Field(default=None, alias="CloseTicketTrigger") class AutomateTimeEntrySettings(ConnectWiseModel): ticket_id: str | None = Field(default=None, alias="TicketId") minutes_to_log: str | None = Field(default=None, alias="MinutesToLog") - time_category: AutomateTimeEntryCategory | None = Field( - default=None, alias="TimeCategory" - ) - stop_timer_trigger: AutomateStopTimerTrigger | None = Field( - default=None, alias="StopTimerTrigger" - ) + time_category: AutomateTimeEntryCategory | None = Field(default=None, alias="TimeCategory") + stop_timer_trigger: AutomateStopTimerTrigger | None = Field(default=None, alias="StopTimerTrigger") notes: str | None = Field(default=None, alias="Notes") - technician: AutomateTimeEntryTechnician | None = Field( - default=None, alias="Technician" - ) + technician: AutomateTimeEntryTechnician | None = Field(default=None, alias="Technician") class AutomateScriptStep(ConnectWiseModel): operating_system: int | None = Field(default=None, alias="OperatingSystem") is_enabled: bool | None = Field(default=None, alias="IsEnabled") - should_continue_on_failure: bool | None = Field( - default=None, alias="ShouldContinueOnFailure" - ) + should_continue_on_failure: bool | None = Field(default=None, alias="ShouldContinueOnFailure") indentation_level: int | None = Field(default=None, alias="IndentationLevel") function: AutomateScriptFunctionBase | None = Field(default=None, alias="Function") @@ -4765,37 +3953,25 @@ class AutomateContact(ConnectWiseModel): is_activated: bool | None = Field(default=None, alias="IsActivated") date_created: datetime | None = Field(default=None, alias="DateCreated") last_update_date: datetime | None = Field(default=None, alias="LastUpdateDate") - plugin_data: dict[str, dict[str, dict[str, Any]]] | None = Field( - default=None, alias="PluginData" - ) + plugin_data: dict[str, dict[str, dict[str, Any]]] | None = Field(default=None, alias="PluginData") source: AutomateContactSource | None = Field(default=None, alias="Source") class AutomateAutoJoinSettings(ConnectWiseModel): - computer_search_settings: AutomateSearchSettings | None = Field( - default=None, alias="ComputerSearchSettings" - ) + computer_search_settings: AutomateSearchSettings | None = Field(default=None, alias="ComputerSearchSettings") network_device_search_settings: AutomateSearchSettings | None = Field( default=None, alias="NetworkDeviceSearchSettings" ) - contact_search_settings: AutomateContactSearchSettings | None = Field( - default=None, alias="ContactSearchSettings" - ) + contact_search_settings: AutomateContactSearchSettings | None = Field(default=None, alias="ContactSearchSettings") class AutomateScriptFunction(ConnectWiseModel): function_id: int | None = Field(default=None, alias="FunctionId") name: str | None = Field(default=None, alias="Name") - is_conditional_function: bool | None = Field( - default=None, alias="IsConditionalFunction" - ) + is_conditional_function: bool | None = Field(default=None, alias="IsConditionalFunction") description: str | None = Field(default=None, alias="Description") - target_type: AutomateScriptFunctionTarget | None = Field( - default=None, alias="TargetType" - ) - parameters: list[AutomateScriptFunctionParameter] | None = Field( - default=None, alias="Parameters" - ) + target_type: AutomateScriptFunctionTarget | None = Field(default=None, alias="TargetType") + parameters: list[AutomateScriptFunctionParameter] | None = Field(default=None, alias="Parameters") class AutomateSearchAttributes(ConnectWiseModel): @@ -4812,12 +3988,8 @@ class AutomateSearchAttributes(ConnectWiseModel): "TypeEquality", "TypeRole", ] | None = Field(default=None, alias="DataType") - data_look_up_type: Literal["None", "Static", "Dynamic"] | None = Field( - default=None, alias="DataLookUpType" - ) - data_lookup: list[AutomateSearchValueLookUp] | None = Field( - default=None, alias="DataLookup" - ) + data_look_up_type: Literal["None", "Static", "Dynamic"] | None = Field(default=None, alias="DataLookUpType") + data_lookup: list[AutomateSearchValueLookUp] | None = Field(default=None, alias="DataLookup") collection_node: str | None = Field(default=None, alias="CollectionNode") @@ -4829,63 +4001,37 @@ class AutomateAdvancedSearchDynamicLookup(ConnectWiseModel): class AutomateAdvancedSearchFilter(ConnectWiseModel): - node_type: Literal[ - "AndNode", "OrNode", "ComparisonNode", "AnyMeetsNode", "NotNode" - ] | None = Field(default=None, alias="NodeType") - node_name: str | None = Field(default=None, alias="NodeName") - filter_criterias: list[AutomateFilterCriteria] | None = Field( - default=None, alias="FilterCriterias" - ) - child_nodes: list[AutomateAdvancedSearchFilter] | None = Field( - default=None, alias="ChildNodes" + node_type: Literal["AndNode", "OrNode", "ComparisonNode", "AnyMeetsNode", "NotNode"] | None = Field( + default=None, alias="NodeType" ) + node_name: str | None = Field(default=None, alias="NodeName") + filter_criterias: list[AutomateFilterCriteria] | None = Field(default=None, alias="FilterCriterias") + child_nodes: list[AutomateAdvancedSearchFilter] | None = Field(default=None, alias="ChildNodes") class AutomateAdvancedSearchDetails(ConnectWiseModel): search: AutomateSearch | None = Field(default=None, alias="Search") - advanced_search_filter: AutomateAdvancedSearchFilter | None = Field( - default=None, alias="AdvancedSearchFilter" - ) + advanced_search_filter: AutomateAdvancedSearchFilter | None = Field(default=None, alias="AdvancedSearchFilter") class AutomateScriptAutomationTimeCategoryResponse(ConnectWiseModel): - total: AutomateScriptAutomationTimeResult | None = Field( - default=None, alias="Total" - ) - system: AutomateScriptAutomationTimeResult | None = Field( - default=None, alias="System" - ) - users: AutomateScriptAutomationTimeResult | None = Field( - default=None, alias="Users" - ) - maximum_history_days_available: int | None = Field( - default=None, alias="MaximumHistoryDaysAvailable" - ) + total: AutomateScriptAutomationTimeResult | None = Field(default=None, alias="Total") + system: AutomateScriptAutomationTimeResult | None = Field(default=None, alias="System") + users: AutomateScriptAutomationTimeResult | None = Field(default=None, alias="Users") + maximum_history_days_available: int | None = Field(default=None, alias="MaximumHistoryDaysAvailable") class AutomateScriptAutomationTimeUserResponse(ConnectWiseModel): - user_list: list[AutomateScriptAutomationTimeUserResult] | None = Field( - default=None, alias="UserList" - ) - maximum_history_days_available: int | None = Field( - default=None, alias="MaximumHistoryDaysAvailable" - ) + user_list: list[AutomateScriptAutomationTimeUserResult] | None = Field(default=None, alias="UserList") + maximum_history_days_available: int | None = Field(default=None, alias="MaximumHistoryDaysAvailable") class AutomateSystemWorkflowProgressEntry(ConnectWiseModel): - system_workflow_progress_id: int | None = Field( - default=None, alias="SystemWorkflowProgressId" - ) + system_workflow_progress_id: int | None = Field(default=None, alias="SystemWorkflowProgressId") description: str | None = Field(default=None, alias="Description") - workflow_step: AutomateWorkflowStep | None = Field( - default=None, alias="WorkflowStep" - ) - workflow_status: AutomateWorkflowStatus | None = Field( - default=None, alias="WorkflowStatus" - ) - workflow_metadata: list[AutomateWorkflowMetadata] | None = Field( - default=None, alias="WorkflowMetadata" - ) + workflow_step: AutomateWorkflowStep | None = Field(default=None, alias="WorkflowStep") + workflow_status: AutomateWorkflowStatus | None = Field(default=None, alias="WorkflowStatus") + workflow_metadata: list[AutomateWorkflowMetadata] | None = Field(default=None, alias="WorkflowMetadata") class AutomateUserAccess(ConnectWiseModel): @@ -4894,9 +4040,7 @@ class AutomateUserAccess(ConnectWiseModel): plugin_permissions: list[AutomateUserBinaryExtensionPermission] | None = Field( default=None, alias="PluginPermissions" ) - web_extension_claims: list[AutomateUserExtensionClaimType] | None = Field( - default=None, alias="WebExtensionClaims" - ) + web_extension_claims: list[AutomateUserExtensionClaimType] | None = Field(default=None, alias="WebExtensionClaims") class LabTechUserAudit(ConnectWiseModel): @@ -4913,34 +4057,22 @@ class LabTechUserAudit(ConnectWiseModel): class AutomateUserClassWebExtensionViewModel(ConnectWiseModel): web_extension_id: int | None = Field(default=None, alias="WebExtensionId") web_extension_name: str | None = Field(default=None, alias="WebExtensionName") - extension_claims: list[AutomateExtensionClaimViewModel] | None = Field( - default=None, alias="ExtensionClaims" - ) + extension_claims: list[AutomateExtensionClaimViewModel] | None = Field(default=None, alias="ExtensionClaims") class AutomateUserClassWebExtensionRequest(ConnectWiseModel): - assigned_extensions: list[AutomateAssignedWebExtension] | None = Field( - default=None, alias="AssignedExtensions" - ) + assigned_extensions: list[AutomateAssignedWebExtension] | None = Field(default=None, alias="AssignedExtensions") class AutomateGroupInternalMonitorInfo(ConnectWiseModel): monitor_id: int | None = Field(default=None, alias="MonitorId") monitor_name: str | None = Field(default=None, alias="MonitorName") - is_monitor_globally_applied: bool | None = Field( - default=None, alias="IsMonitorGloballyApplied" - ) - is_subscription_inherited: bool | None = Field( - default=None, alias="IsSubscriptionInherited" - ) + is_monitor_globally_applied: bool | None = Field(default=None, alias="IsMonitorGloballyApplied") + is_subscription_inherited: bool | None = Field(default=None, alias="IsSubscriptionInherited") is_group_subscribed: bool | None = Field(default=None, alias="IsGroupSubscribed") monitor_interval: str | None = Field(default=None, alias="MonitorInterval") - monitor_next_scan_date: datetime | None = Field( - default=None, alias="MonitorNextScanDate" - ) - effective_alert_policy: AutomateMonitorAlertPolicy | None = Field( - default=None, alias="EffectiveAlertPolicy" - ) + monitor_next_scan_date: datetime | None = Field(default=None, alias="MonitorNextScanDate") + effective_alert_policy: AutomateMonitorAlertPolicy | None = Field(default=None, alias="EffectiveAlertPolicy") class AutomateUpdateGroupMonitorSubscriptionRequest(ConnectWiseModel): @@ -4950,38 +4082,24 @@ class AutomateUpdateGroupMonitorSubscriptionRequest(ConnectWiseModel): class AutomateAlertingSettings(ConnectWiseModel): is_alerting_enabled: bool | None = Field(default=None, alias="IsAlertingEnabled") - alert_template: AutomateAlertTemplate | None = Field( - default=None, alias="AlertTemplate" - ) - alert_style_type: AutomateAlertStyleType | None = Field( - default=None, alias="AlertStyleType" - ) + alert_template: AutomateAlertTemplate | None = Field(default=None, alias="AlertTemplate") + alert_style_type: AutomateAlertStyleType | None = Field(default=None, alias="AlertStyleType") alert_success_subject: str | None = Field(default=None, alias="AlertSuccessSubject") alert_success_message: str | None = Field(default=None, alias="AlertSuccessMessage") alert_failure_subject: str | None = Field(default=None, alias="AlertFailureSubject") alert_failure_message: str | None = Field(default=None, alias="AlertFailureMessage") should_run_script: bool | None = Field(default=None, alias="ShouldRunScript") alert_script: AutomateAlertScript | None = Field(default=None, alias="AlertScript") - ticket_category: AutomateTicketCategory | None = Field( - default=None, alias="TicketCategory" - ) - report_category: AutomateReportCategory | None = Field( - default=None, alias="ReportCategory" - ) + ticket_category: AutomateTicketCategory | None = Field(default=None, alias="TicketCategory") + report_category: AutomateReportCategory | None = Field(default=None, alias="ReportCategory") class AutomateCondition(ConnectWiseModel): condition_type_id: int | None = Field(default=None, alias="ConditionTypeId") comparand: str | None = Field(default=None, alias="Comparand") - normal_state_condition: AutomateStateCondition | None = Field( - default=None, alias="NormalStateCondition" - ) - warning_state_condition: AutomateStateCondition | None = Field( - default=None, alias="WarningStateCondition" - ) - error_state_condition: AutomateStateCondition | None = Field( - default=None, alias="ErrorStateCondition" - ) + normal_state_condition: AutomateStateCondition | None = Field(default=None, alias="NormalStateCondition") + warning_state_condition: AutomateStateCondition | None = Field(default=None, alias="WarningStateCondition") + error_state_condition: AutomateStateCondition | None = Field(default=None, alias="ErrorStateCondition") class AutomateCreateScriptFromCommandsRequest(ConnectWiseModel): @@ -4991,139 +4109,91 @@ class AutomateCreateScriptFromCommandsRequest(ConnectWiseModel): class AutomateWebExtensionTile(ConnectWiseModel): tile_guid: UUID | None = Field( - default=None, alias="TileGuid", example="00000000-0000-0000-0000-000000000000" - ) - normal_tile_source_url: str | None = Field( - default=None, alias="NormalTileSourceUrl" - ) - normal_tile_header_url: str | None = Field( - default=None, alias="NormalTileHeaderUrl" + default=None, + alias="TileGuid", + examples=["00000000-0000-0000-0000-000000000000"], ) + normal_tile_source_url: str | None = Field(default=None, alias="NormalTileSourceUrl") + normal_tile_header_url: str | None = Field(default=None, alias="NormalTileHeaderUrl") max_tile_source_url: str | None = Field(default=None, alias="MaxTileSourceUrl") tile_title: str | None = Field(default=None, alias="TileTitle") - tile_size: AutomateWebExtensionTileSize | None = Field( - default=None, alias="TileSize" - ) - web_extension_control_id: int | None = Field( - default=None, alias="WebExtensionControlId" - ) - web_extension_control_name: str | None = Field( - default=None, alias="WebExtensionControlName" - ) + tile_size: AutomateWebExtensionTileSize | None = Field(default=None, alias="TileSize") + web_extension_control_id: int | None = Field(default=None, alias="WebExtensionControlId") + web_extension_control_name: str | None = Field(default=None, alias="WebExtensionControlName") web_extension_guid: UUID | None = Field( default=None, alias="WebExtensionGuid", - example="00000000-0000-0000-0000-000000000000", - ) - extension_claim_type: AutomateExtensionClaimType | None = Field( - default=None, alias="ExtensionClaimType" + examples=["00000000-0000-0000-0000-000000000000"], ) + extension_claim_type: AutomateExtensionClaimType | None = Field(default=None, alias="ExtensionClaimType") is_core_extension: bool | None = Field(default=None, alias="IsCoreExtension") - web_extension_area_control_type_ids: list[int] | None = Field( - default=None, alias="WebExtensionAreaControlTypeIds" - ) + web_extension_area_control_type_ids: list[int] | None = Field(default=None, alias="WebExtensionAreaControlTypeIds") class AutomateWebExtensionRedirect(ConnectWiseModel): redirect_guid: UUID | None = Field( default=None, alias="RedirectGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) source_url: str | None = Field(default=None, alias="SourceUrl") - web_extension_control_id: int | None = Field( - default=None, alias="WebExtensionControlId" - ) - web_extension_control_name: str | None = Field( - default=None, alias="WebExtensionControlName" - ) + web_extension_control_id: int | None = Field(default=None, alias="WebExtensionControlId") + web_extension_control_name: str | None = Field(default=None, alias="WebExtensionControlName") web_extension_guid: UUID | None = Field( default=None, alias="WebExtensionGuid", - example="00000000-0000-0000-0000-000000000000", - ) - extension_claim_type: AutomateExtensionClaimType | None = Field( - default=None, alias="ExtensionClaimType" + examples=["00000000-0000-0000-0000-000000000000"], ) + extension_claim_type: AutomateExtensionClaimType | None = Field(default=None, alias="ExtensionClaimType") is_core_extension: bool | None = Field(default=None, alias="IsCoreExtension") - web_extension_area_control_type_ids: list[int] | None = Field( - default=None, alias="WebExtensionAreaControlTypeIds" - ) + web_extension_area_control_type_ids: list[int] | None = Field(default=None, alias="WebExtensionAreaControlTypeIds") class AutomateWebExtensionInlineFrame(ConnectWiseModel): inline_frame_guid: UUID | None = Field( default=None, alias="InlineFrameGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) source_url: str | None = Field(default=None, alias="SourceUrl") - web_extension_control_id: int | None = Field( - default=None, alias="WebExtensionControlId" - ) - web_extension_control_name: str | None = Field( - default=None, alias="WebExtensionControlName" - ) + web_extension_control_id: int | None = Field(default=None, alias="WebExtensionControlId") + web_extension_control_name: str | None = Field(default=None, alias="WebExtensionControlName") web_extension_guid: UUID | None = Field( default=None, alias="WebExtensionGuid", - example="00000000-0000-0000-0000-000000000000", - ) - extension_claim_type: AutomateExtensionClaimType | None = Field( - default=None, alias="ExtensionClaimType" + examples=["00000000-0000-0000-0000-000000000000"], ) + extension_claim_type: AutomateExtensionClaimType | None = Field(default=None, alias="ExtensionClaimType") is_core_extension: bool | None = Field(default=None, alias="IsCoreExtension") - web_extension_area_control_type_ids: list[int] | None = Field( - default=None, alias="WebExtensionAreaControlTypeIds" - ) + web_extension_area_control_type_ids: list[int] | None = Field(default=None, alias="WebExtensionAreaControlTypeIds") class AutomateWebExtensionClickAction(ConnectWiseModel): click_action_id: int | None = Field(default=None, alias="ClickActionId") url: str | None = Field(default=None, alias="Url") - url_open_type: AutomateWebExtensionUrlOpenType | None = Field( - default=None, alias="UrlOpenType" - ) + url_open_type: AutomateWebExtensionUrlOpenType | None = Field(default=None, alias="UrlOpenType") class AutomateWebExtensionMenuItem(ConnectWiseModel): - web_extension_menu_item_id: int | None = Field( - default=None, alias="WebExtensionMenuItemId" - ) - web_extension_menu_item_parent_id: int | None = Field( - default=None, alias="WebExtensionMenuItemParentId" - ) + web_extension_menu_item_id: int | None = Field(default=None, alias="WebExtensionMenuItemId") + web_extension_menu_item_parent_id: int | None = Field(default=None, alias="WebExtensionMenuItemParentId") menu_text: str | None = Field(default=None, alias="MenuText") - click_action: AutomateWebExtensionClickAction | None = Field( - default=None, alias="ClickAction" - ) - menu_items: list[AutomateWebExtensionMenuItem] | None = Field( - default=None, alias="MenuItems" - ) + click_action: AutomateWebExtensionClickAction | None = Field(default=None, alias="ClickAction") + menu_items: list[AutomateWebExtensionMenuItem] | None = Field(default=None, alias="MenuItems") class AutomateWindowsServiceBranchStats(ConnectWiseModel): - server_release_counts: list[AutomateWindowsReleaseStats] | None = Field( - default=None, alias="ServerReleaseCounts" - ) - server_no_channel_count: int | None = Field( - default=None, alias="ServerNoChannelCount" - ) - server_semi_annual_channel_count: int | None = Field( - default=None, alias="ServerSemiAnnualChannelCount" - ) + server_release_counts: list[AutomateWindowsReleaseStats] | None = Field(default=None, alias="ServerReleaseCounts") + server_no_channel_count: int | None = Field(default=None, alias="ServerNoChannelCount") + server_semi_annual_channel_count: int | None = Field(default=None, alias="ServerSemiAnnualChannelCount") server_semi_annual_channel_targeted_count: int | None = Field( default=None, alias="ServerSemiAnnualChannelTargetedCount" ) workstation_release_counts: list[AutomateWindowsReleaseStats] | None = Field( default=None, alias="WorkstationReleaseCounts" ) - workstation_no_channel_count: int | None = Field( - default=None, alias="WorkstationNoChannelCount" - ) - workstation_semi_annual_channel_count: int | None = Field( - default=None, alias="WorkstationSemiAnnualChannelCount" - ) + workstation_no_channel_count: int | None = Field(default=None, alias="WorkstationNoChannelCount") + workstation_semi_annual_channel_count: int | None = Field(default=None, alias="WorkstationSemiAnnualChannelCount") workstation_semi_annual_channel_targeted_count: int | None = Field( default=None, alias="WorkstationSemiAnnualChannelTargetedCount" ) @@ -5142,29 +4212,21 @@ class AutomateApprovalPolicy(ConnectWiseModel): automatic_ignore_settings: AutomateAutomaticPolicySettings | None = Field( default=None, alias="AutomaticIgnoreSettings" ) - automatic_deny_settings: AutomateAutomaticPolicySettings | None = Field( - default=None, alias="AutomaticDenySettings" - ) + automatic_deny_settings: AutomateAutomaticPolicySettings | None = Field(default=None, alias="AutomaticDenySettings") class AutomateWebClientAccessBatchResponse(ConnectWiseModel): web_client_access_results: list[AutomateWebClientAccessBatchResult] | None = Field( default=None, alias="WebClientAccessResults" ) - contains_unsuccessful_results: bool | None = Field( - default=None, alias="ContainsUnsuccessfulResults" - ) + contains_unsuccessful_results: bool | None = Field(default=None, alias="ContainsUnsuccessfulResults") class AutomateDailyScheduleFrequency(ConnectWiseModel): runs_at: str | None = Field(default=None, alias="RunsAt") daily_interval: int | None = Field(default=None, alias="DailyInterval") - days_of_week_settings: AutomateDaysOfWeekSettings | None = Field( - default=None, alias="DaysOfWeekSettings" - ) - daily_repeat_settings: AutomateDailyRepeatSettings | None = Field( - default=None, alias="DailyRepeatSettings" - ) + days_of_week_settings: AutomateDaysOfWeekSettings | None = Field(default=None, alias="DaysOfWeekSettings") + daily_repeat_settings: AutomateDailyRepeatSettings | None = Field(default=None, alias="DailyRepeatSettings") class LabTechRemoteAgentTemplate(ConnectWiseModel): @@ -5186,29 +4248,19 @@ class LabTechRemoteAgentTemplate(ConnectWiseModel): "DisableWindowsUpdate", "LabtechModeLabtechModeUIAccessDisabled", ] | None = Field(default=None, alias="WindowsUpdate") - ssl_accept_expired_certificates: bool | None = Field( - default=None, alias="SSLAcceptExpiredCertificates" - ) + ssl_accept_expired_certificates: bool | None = Field(default=None, alias="SSLAcceptExpiredCertificates") ssl_access_untrusted_certificate_authorities: bool | None = Field( default=None, alias="SSLAccessUntrustedCertificateAuthorities" ) - ssl_accept_mismatched_names: bool | None = Field( - default=None, alias="SSLAcceptMismatchedNames" - ) - ssl_accept_revoked_certificates: bool | None = Field( - default=None, alias="SSLAcceptRevokedCertificates" - ) + ssl_accept_mismatched_names: bool | None = Field(default=None, alias="SSLAcceptMismatchedNames") + ssl_accept_revoked_certificates: bool | None = Field(default=None, alias="SSLAcceptRevokedCertificates") ssl_accept_all: bool | None = Field(default=None, alias="SSLAcceptAll") default_language_pack: str | None = Field(default=None, alias="DefaultLanguagePack") heartbeat_enabled: bool | None = Field(default=None, alias="HeartbeatEnabled") heartbeat_frequency: int | None = Field(default=None, alias="HeartbeatFrequency") - remote_agent_log_debug: bool | None = Field( - default=None, alias="RemoteAgentLogDebug" - ) + remote_agent_log_debug: bool | None = Field(default=None, alias="RemoteAgentLogDebug") schedule: LabTechRemoteAgentSchedule | None = Field(default=None, alias="Schedule") - agent_update_window: LabTechSchedule | None = Field( - default=None, alias="AgentUpdateWindow" - ) + agent_update_window: LabTechSchedule | None = Field(default=None, alias="AgentUpdateWindow") temp_directory: str | None = Field(default=None, alias="TempDirectory") cache_directory: str | None = Field(default=None, alias="CacheDirectory") cache_username: str | None = Field(default=None, alias="CacheUsername") @@ -5219,50 +4271,34 @@ class LabTechRemoteAgentTemplate(ConnectWiseModel): tray_title: str | None = Field(default=None, alias="TrayTitle") remote_agent_name: str | None = Field(default=None, alias="RemoteAgentName") show_tray: bool | None = Field(default=None, alias="ShowTray") - tray_disable_powered_by: bool | None = Field( - default=None, alias="TrayDisablePoweredBy" - ) + tray_disable_powered_by: bool | None = Field(default=None, alias="TrayDisablePoweredBy") tray_icon: str | None = Field(default=None, alias="TrayIcon") - agent_reboot_mode: Literal[ - "Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny" - ] | None = Field(default=None, alias="AgentRebootMode") - remote_access_mode: Literal[ - "Silent", "Ask", "AskThenAllow", "AskThenDeny", "Deny" - ] | None = Field(default=None, alias="RemoteAccessMode") - file_explorer_access_mode: Literal[ - "Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny" - ] | None = Field(default=None, alias="FileExplorerAccessMode") - registry_editor_access_mode: Literal[ - "Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny" - ] | None = Field(default=None, alias="RegistryEditorAccessMode") - screen_capture_access_mode: Literal[ - "Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny" - ] | None = Field(default=None, alias="ScreenCaptureAccessMode") - disallow_user_close_tray: bool | None = Field( - default=None, alias="DisallowUserCloseTray" + agent_reboot_mode: Literal["Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny"] | None = Field( + default=None, alias="AgentRebootMode" ) - allow_user_disable_remote_access: bool | None = Field( - default=None, alias="AllowUserDisableRemoteAccess" + remote_access_mode: Literal["Silent", "Ask", "AskThenAllow", "AskThenDeny", "Deny"] | None = Field( + default=None, alias="RemoteAccessMode" ) - tray_help_url: str | None = Field(default=None, alias="TrayHelpURL") - tray_custom_menu_title: str | None = Field( - default=None, alias="TrayCustomMenuTitle" + file_explorer_access_mode: Literal["Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny"] | None = Field( + default=None, alias="FileExplorerAccessMode" + ) + registry_editor_access_mode: Literal["Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny"] | None = Field( + default=None, alias="RegistryEditorAccessMode" ) + screen_capture_access_mode: Literal["Now", "Ask", "AskThenAllow", "AskThenDeny", "Deny"] | None = Field( + default=None, alias="ScreenCaptureAccessMode" + ) + disallow_user_close_tray: bool | None = Field(default=None, alias="DisallowUserCloseTray") + allow_user_disable_remote_access: bool | None = Field(default=None, alias="AllowUserDisableRemoteAccess") + tray_help_url: str | None = Field(default=None, alias="TrayHelpURL") + tray_custom_menu_title: str | None = Field(default=None, alias="TrayCustomMenuTitle") tray_custom_menu_url: str | None = Field(default=None, alias="TrayCustomMenuURL") tray_show_custom_menu: bool | None = Field(default=None, alias="TrayShowCustomMenu") tray_show_help: bool | None = Field(default=None, alias="TrayShowHelp") - tray_menus: list[LabTechComputerMenu] | None = Field( - default=None, alias="TrayMenus" - ) - tray_reboot_log_off_notification_text: str | None = Field( - default=None, alias="TrayRebootLogOffNotificationText" - ) - tray_shutdown_notification_text: str | None = Field( - default=None, alias="TrayShutdownNotificationText" - ) - tray_remote_access_notification_text: str | None = Field( - default=None, alias="TrayRemoteAccessNotificationText" - ) + tray_menus: list[LabTechComputerMenu] | None = Field(default=None, alias="TrayMenus") + tray_reboot_log_off_notification_text: str | None = Field(default=None, alias="TrayRebootLogOffNotificationText") + tray_shutdown_notification_text: str | None = Field(default=None, alias="TrayShutdownNotificationText") + tray_remote_access_notification_text: str | None = Field(default=None, alias="TrayRemoteAccessNotificationText") tray_file_explorer_access_notification_text: str | None = Field( default=None, alias="TrayFileExplorerAccessNotificationText" ) @@ -5273,82 +4309,44 @@ class LabTechRemoteAgentTemplate(ConnectWiseModel): default=None, alias="TrayScreenCaptureAccessNotificationText" ) service_ticket_title: str | None = Field(default=None, alias="ServiceTicketTitle") - tray_ticket_from_label_text: str | None = Field( - default=None, alias="TrayTicketFromLabelText" - ) - tray_ticket_subject_label_text: str | None = Field( - default=None, alias="TrayTicketSubjectLabelText" - ) - tray_show_service_ticket_menu: bool | None = Field( - default=None, alias="TrayShowServiceTicketMenu" - ) - tray_show_messages_and_tickets: bool | None = Field( - default=None, alias="TrayShowMessagesAndTickets" - ) - tray_ticket_verify_email: bool | None = Field( - default=None, alias="TrayTicketVerifyEmail" - ) + tray_ticket_from_label_text: str | None = Field(default=None, alias="TrayTicketFromLabelText") + tray_ticket_subject_label_text: str | None = Field(default=None, alias="TrayTicketSubjectLabelText") + tray_show_service_ticket_menu: bool | None = Field(default=None, alias="TrayShowServiceTicketMenu") + tray_show_messages_and_tickets: bool | None = Field(default=None, alias="TrayShowMessagesAndTickets") + tray_ticket_verify_email: bool | None = Field(default=None, alias="TrayTicketVerifyEmail") support_url: str | None = Field(default=None, alias="SupportURL") rss_feed_address1: str | None = Field(default=None, alias="RSSFeedAddress1") rss_feed_address2: str | None = Field(default=None, alias="RSSFeedAddress2") rss_feed_address3: str | None = Field(default=None, alias="RSSFeedAddress3") rss_feed_address4: str | None = Field(default=None, alias="RSSFeedAddress4") enable_rss: bool | None = Field(default=None, alias="EnableRSS") - tray_chat_notification_text: str | None = Field( - default=None, alias="TrayChatNotificationText" - ) - tray_chat_notification_title: str | None = Field( - default=None, alias="TrayChatNotificationTitle" - ) - tray_interrupt_user_with_chat: bool | None = Field( - default=None, alias="TrayInterruptUserWithChat" - ) + tray_chat_notification_text: str | None = Field(default=None, alias="TrayChatNotificationText") + tray_chat_notification_title: str | None = Field(default=None, alias="TrayChatNotificationTitle") + tray_interrupt_user_with_chat: bool | None = Field(default=None, alias="TrayInterruptUserWithChat") proxy_server_url: str | None = Field(default=None, alias="ProxyServerURL") proxy_server_user: str | None = Field(default=None, alias="ProxyServerUser") proxy_server_password: str | None = Field(default=None, alias="ProxyServerPassword") - tray_notification_title: str | None = Field( - default=None, alias="TrayNotificationTitle" - ) - tray_new_message_notification_text: str | None = Field( - default=None, alias="TrayNewMessageNotificationText" - ) - tray_new_rss_feed_notification_text: str | None = Field( - default=None, alias="TrayNewRSSFeedNotificationText" - ) - tray_remote_access_notification_title: str | None = Field( - default=None, alias="TrayRemoteAccessNotificationTitle" - ) - tray_system_message_notification_title: str | None = Field( - default=None, alias="TraySystemMessageNotificationTitle" - ) + tray_notification_title: str | None = Field(default=None, alias="TrayNotificationTitle") + tray_new_message_notification_text: str | None = Field(default=None, alias="TrayNewMessageNotificationText") + tray_new_rss_feed_notification_text: str | None = Field(default=None, alias="TrayNewRSSFeedNotificationText") + tray_remote_access_notification_title: str | None = Field(default=None, alias="TrayRemoteAccessNotificationTitle") + tray_system_message_notification_title: str | None = Field(default=None, alias="TraySystemMessageNotificationTitle") backup_server_url: str | None = Field(default=None, alias="BackupServerURL") backup_server_user: str | None = Field(default=None, alias="BackupServerUser") - backup_server_password: str | None = Field( - default=None, alias="BackupServerPassword" - ) - network_access_storage_path: str | None = Field( - default=None, alias="NetworkAccessStoragePath" - ) - template_properties: list[LabTechTemplateProperty] | None = Field( - default=None, alias="TemplateProperties" - ) - antivirus_template: LabTechAVTemplatePolicy | None = Field( - default=None, alias="AntivirusTemplate" - ) + backup_server_password: str | None = Field(default=None, alias="BackupServerPassword") + network_access_storage_path: str | None = Field(default=None, alias="NetworkAccessStoragePath") + template_properties: list[LabTechTemplateProperty] | None = Field(default=None, alias="TemplateProperties") + antivirus_template: LabTechAVTemplatePolicy | None = Field(default=None, alias="AntivirusTemplate") class LabTechUserClassComputerPermissions(ConnectWiseModel): id: str | None = Field(default=None, alias="Id") user_class: LabTechUserClass | None = Field(default=None, alias="UserClass") - permissions: LabTechComputerPermissions | None = Field( - default=None, alias="Permissions" - ) + permissions: LabTechComputerPermissions | None = Field(default=None, alias="Permissions") class SystemCancellationToken(ConnectWiseModel): - is_cancellation_requested: bool | None = Field( - default=None, alias="IsCancellationRequested" - ) + is_cancellation_requested: bool | None = Field(default=None, alias="IsCancellationRequested") can_be_canceled: bool | None = Field(default=None, alias="CanBeCanceled") wait_handle: SystemWaitHandle | None = Field(default=None, alias="WaitHandle") @@ -5356,24 +4354,18 @@ class SystemCancellationToken(ConnectWiseModel): class AutomateMicrosoftUpdatePolicy(ConnectWiseModel): policy_id: int | None = Field(default=None, alias="PolicyId") policy_name: str | None = Field(default=None, alias="PolicyName") - schedule_settings: AutomatePatchingPolicySchedule | None = Field( - default=None, alias="ScheduleSettings" - ) + schedule_settings: AutomatePatchingPolicySchedule | None = Field(default=None, alias="ScheduleSettings") windows_update_agent_settings: AutomateWindowsUpdateAgentSettings | None = Field( default=None, alias="WindowsUpdateAgentSettings" ) - policy_options: AutomateMicrosoftUpdatePolicyOptions | None = Field( - default=None, alias="PolicyOptions" - ) + policy_options: AutomateMicrosoftUpdatePolicyOptions | None = Field(default=None, alias="PolicyOptions") workstation_options: AutomatePatchingPolicyWorkstationOptions | None = Field( default=None, alias="WorkstationOptions" ) - windows10_update_options: AutomateMicrosoftUpdatePolicyWindows10Options | None = ( - Field(default=None, alias="Windows10UpdateOptions") - ) - script_options: AutomatePatchingPolicyScriptOptions | None = Field( - default=None, alias="ScriptOptions" + windows10_update_options: AutomateMicrosoftUpdatePolicyWindows10Options | None = Field( + default=None, alias="Windows10UpdateOptions" ) + script_options: AutomatePatchingPolicyScriptOptions | None = Field(default=None, alias="ScriptOptions") class AutomateThirdPartyUpdatePolicy(ConnectWiseModel): @@ -5385,35 +4377,23 @@ class AutomateThirdPartyUpdatePolicy(ConnectWiseModel): workstation_options: AutomatePatchingPolicyWorkstationOptions | None = Field( default=None, alias="WorkstationOptions" ) - script_options: AutomatePatchingPolicyScriptOptions | None = Field( - default=None, alias="ScriptOptions" - ) + script_options: AutomatePatchingPolicyScriptOptions | None = Field(default=None, alias="ScriptOptions") class AutomateGroupConfigurationViewModel(ConnectWiseModel): - group_type_information: AutomateGroupTypeInformation | None = Field( - default=None, alias="GroupTypeInformation" - ) - remote_agent_template_information: AutomateRemoteAgentTemplateInformation | None = ( - Field(default=None, alias="RemoteAgentTemplateInformation") + group_type_information: AutomateGroupTypeInformation | None = Field(default=None, alias="GroupTypeInformation") + remote_agent_template_information: AutomateRemoteAgentTemplateInformation | None = Field( + default=None, alias="RemoteAgentTemplateInformation" ) computer_search_information: AutomateComputerSearchInformation | None = Field( default=None, alias="ComputerSearchInformation" ) - network_device_searches: list[AutomateSearch] | None = Field( - default=None, alias="NetworkDeviceSearches" - ) - contact_searches: list[AutomateSearch] | None = Field( - default=None, alias="ContactSearches" - ) + network_device_searches: list[AutomateSearch] | None = Field(default=None, alias="NetworkDeviceSearches") + contact_searches: list[AutomateSearch] | None = Field(default=None, alias="ContactSearches") clients: list[AutomateClient] | None = Field(default=None, alias="Clients") locations: list[AutomateLocation] | None = Field(default=None, alias="Locations") - maintenance_windows: list[AutomateMaintenanceWindow] | None = Field( - default=None, alias="MaintenanceWindows" - ) - user_classes: list[AutomateUserClass] | None = Field( - default=None, alias="UserClasses" - ) + maintenance_windows: list[AutomateMaintenanceWindow] | None = Field(default=None, alias="MaintenanceWindows") + user_classes: list[AutomateUserClass] | None = Field(default=None, alias="UserClasses") class LabTechScript(ConnectWiseModel): @@ -5423,23 +4403,15 @@ class LabTechScript(ConnectWiseModel): comments: str | None = Field(default=None, alias="Comments") is_computer_script: bool | None = Field(default=None, alias="IsComputerScript") is_location_script: bool | None = Field(default=None, alias="IsLocationScript") - is_maintenance_script: bool | None = Field( - default=None, alias="IsMaintenanceScript" - ) + is_maintenance_script: bool | None = Field(default=None, alias="IsMaintenanceScript") is_function_script: bool | None = Field(default=None, alias="IsFunctionScript") is_offline: bool | None = Field(default=None, alias="IsOffline") - ignore_for_mobile_devices: bool | None = Field( - default=None, alias="IgnoreForMobileDevices" - ) + ignore_for_mobile_devices: bool | None = Field(default=None, alias="IgnoreForMobileDevices") is_public_sharable: bool | None = Field(default=None, alias="IsPublicSharable") is_user_response: bool | None = Field(default=None, alias="IsUserResponse") is_system_script: bool | None = Field(default=None, alias="IsSystemScript") - is_mobile_device_script: bool | None = Field( - default=None, alias="IsMobileDeviceScript" - ) - is_network_device_script: bool | None = Field( - default=None, alias="IsNetworkDeviceScript" - ) + is_mobile_device_script: bool | None = Field(default=None, alias="IsMobileDeviceScript") + is_network_device_script: bool | None = Field(default=None, alias="IsNetworkDeviceScript") is_contact_script: bool | None = Field(default=None, alias="IsContactScript") version: int | None = Field(default=None, alias="Version") guid: str | None = Field(default=None, alias="GUID") @@ -5454,9 +4426,7 @@ class LabTechScript(ConnectWiseModel): class LabTechMonitorRoutineParameters(ConnectWiseModel): - format: LabTechMonitorRoutineParametersFormat | None = Field( - default=None, alias="Format" - ) + format: LabTechMonitorRoutineParametersFormat | None = Field(default=None, alias="Format") unformatted_monitor_parameters: LabTechUnformattedMonitorRoutineParameters | None = Field( default=None, alias="UnformattedMonitorParameters" ) @@ -5473,8 +4443,8 @@ class LabTechMonitorRoutineParameters(ConnectWiseModel): performance_counter_query_parameters: LabTechPerformanceCounterQueryParameters | None = Field( default=None, alias="PerformanceCounterQueryParameters" ) - hardware_sensor_query_parameters: LabTechHardwareSensorQueryParameters | None = ( - Field(default=None, alias="HardwareSensorQueryParameters") + hardware_sensor_query_parameters: LabTechHardwareSensorQueryParameters | None = Field( + default=None, alias="HardwareSensorQueryParameters" ) network_device_wbem_query_parameters: LabTechNetworkDeviceWbemQueryParameters | None = Field( default=None, alias="NetworkDeviceWbemQueryParameters" @@ -5482,8 +4452,8 @@ class LabTechMonitorRoutineParameters(ConnectWiseModel): get_plugin_command_result_parameters: LabTechGetPluginCommandResultParameters | None = Field( default=None, alias="GetPluginCommandResultParameters" ) - file_or_directory_query_parameters: LabTechFileOrDirectoryQueryParameters | None = ( - Field(default=None, alias="FileOrDirectoryQueryParameters") + file_or_directory_query_parameters: LabTechFileOrDirectoryQueryParameters | None = Field( + default=None, alias="FileOrDirectoryQueryParameters" ) service_name: str | None = Field(default=None, alias="ServiceName") volume_mountpoint: str | None = Field(default=None, alias="VolumeMountpoint") @@ -5494,102 +4464,58 @@ class LabTechMonitorRoutineParameters(ConnectWiseModel): event_log_listener_parameters: LabTechEventLogQueryParameters | None = Field( default=None, alias="EventLogListenerParameters" ) - get_executable_result_parameters: LabTechGetExecutableResultParameters | None = ( - Field(default=None, alias="GetExecutableResultParameters") + get_executable_result_parameters: LabTechGetExecutableResultParameters | None = Field( + default=None, alias="GetExecutableResultParameters" ) wmi_query: str | None = Field(default=None, alias="WmiQuery") class LabTechProbeConfiguration(ConnectWiseModel): - probe_configuration_id: int | None = Field( - default=None, alias="ProbeConfigurationId" - ) + probe_configuration_id: int | None = Field(default=None, alias="ProbeConfigurationId") location_id: int | None = Field(default=None, alias="LocationId") - agent_deployment_attempt_maximum: int | None = Field( - default=None, alias="AgentDeploymentAttemptMaximum" - ) - automated_deployment_enabled: bool | None = Field( - default=None, alias="AutomatedDeploymentEnabled" - ) - discovery_settings: LabTechDiscoveryScanSettings | None = Field( - default=None, alias="DiscoverySettings" - ) - status_settings: LabTechStatusScanSettings | None = Field( - default=None, alias="StatusSettings" - ) - snmp_settings: LabTechSnmpSettings | None = Field( - default=None, alias="SnmpSettings" - ) - is_data_collection_enabled: bool | None = Field( - default=None, alias="IsDataCollectionEnabled" - ) - snmp_trap_server_listening_port: int | None = Field( - default=None, alias="SnmpTrapServerListeningPort" - ) - syslog_settings: LabTechSyslogServerSettings | None = Field( - default=None, alias="SyslogSettings" - ) - tftp_settings: LabTechTftpServerSettings | None = Field( - default=None, alias="TftpSettings" - ) + agent_deployment_attempt_maximum: int | None = Field(default=None, alias="AgentDeploymentAttemptMaximum") + automated_deployment_enabled: bool | None = Field(default=None, alias="AutomatedDeploymentEnabled") + discovery_settings: LabTechDiscoveryScanSettings | None = Field(default=None, alias="DiscoverySettings") + status_settings: LabTechStatusScanSettings | None = Field(default=None, alias="StatusSettings") + snmp_settings: LabTechSnmpSettings | None = Field(default=None, alias="SnmpSettings") + is_data_collection_enabled: bool | None = Field(default=None, alias="IsDataCollectionEnabled") + snmp_trap_server_listening_port: int | None = Field(default=None, alias="SnmpTrapServerListeningPort") + syslog_settings: LabTechSyslogServerSettings | None = Field(default=None, alias="SyslogSettings") + tftp_settings: LabTechTftpServerSettings | None = Field(default=None, alias="TftpSettings") class LabTechProbeSnmpConfiguration(ConnectWiseModel): - probe_snmp_configuration_id: int | None = Field( - default=None, alias="ProbeSnmpConfigurationId" - ) - probe_configuration_id: int | None = Field( - default=None, alias="ProbeConfigurationId" - ) - snmp_timeout_in_seconds: int | None = Field( - default=None, alias="SnmpTimeoutInSeconds" - ) - community_string_get_list: str | None = Field( - default=None, alias="CommunityStringGetList" - ) - snmp_v3_settings: LabTechProbeSnmpV3Configuration | None = Field( - default=None, alias="SnmpV3Settings" - ) + probe_snmp_configuration_id: int | None = Field(default=None, alias="ProbeSnmpConfigurationId") + probe_configuration_id: int | None = Field(default=None, alias="ProbeConfigurationId") + snmp_timeout_in_seconds: int | None = Field(default=None, alias="SnmpTimeoutInSeconds") + community_string_get_list: str | None = Field(default=None, alias="CommunityStringGetList") + snmp_v3_settings: LabTechProbeSnmpV3Configuration | None = Field(default=None, alias="SnmpV3Settings") class AutomateDisableServerPatchRebootSettings(ConnectWiseModel): - server_settings: AutomateDisableServerPatchRebootServerSettings | None = Field( - default=None, alias="ServerSettings" - ) - workstation_settings: AutomateDisableServerPatchRebootWorkstationSettings | None = ( - Field(default=None, alias="WorkstationSettings") + server_settings: AutomateDisableServerPatchRebootServerSettings | None = Field(default=None, alias="ServerSettings") + workstation_settings: AutomateDisableServerPatchRebootWorkstationSettings | None = Field( + default=None, alias="WorkstationSettings" ) class AutomateScript(ConnectWiseModel): script_id: int | None = Field(default=None, alias="ScriptId") - ticket_entry_settings: AutomateTicketEntrySettings | None = Field( - default=None, alias="TicketEntrySettings" - ) - time_entry_settings: AutomateTimeEntrySettings | None = Field( - default=None, alias="TimeEntrySettings" - ) + ticket_entry_settings: AutomateTicketEntrySettings | None = Field(default=None, alias="TicketEntrySettings") + time_entry_settings: AutomateTimeEntrySettings | None = Field(default=None, alias="TimeEntrySettings") user_class_access_settings: list[AutomateUserClassAccess] | None = Field( default=None, alias="UserClassAccessSettings" ) is_protected: bool | None = Field(default=None, alias="IsProtected") - uses_enhanced_logging: bool | None = Field( - default=None, alias="UsesEnhancedLogging" - ) + uses_enhanced_logging: bool | None = Field(default=None, alias="UsesEnhancedLogging") steps: list[AutomateScriptStep] | None = Field(default=None, alias="Steps") - global_variables: dict[str, str] | None = Field( - default=None, alias="GlobalVariables" - ) + global_variables: dict[str, str] | None = Field(default=None, alias="GlobalVariables") parameters: list[str] | None = Field(default=None, alias="Parameters") name: str | None = Field(default=None, alias="Name") description: str | None = Field(default=None, alias="Description") folder: AutomateScriptFolder | None = Field(default=None, alias="Folder") - script_target_type: AutomateScriptTarget | None = Field( - default=None, alias="ScriptTargetType" - ) - script_options: AutomateScriptOptions | None = Field( - default=None, alias="ScriptOptions" - ) + script_target_type: AutomateScriptTarget | None = Field(default=None, alias="ScriptTargetType") + script_options: AutomateScriptOptions | None = Field(default=None, alias="ScriptOptions") automation_minutes: int | None = Field(default=None, alias="AutomationMinutes") @@ -5599,18 +4525,10 @@ class AutomateGroup(ConnectWiseModel): full_name: str | None = Field(default=None, alias="FullName") description: str | None = Field(default=None, alias="Description") group_type: AutomateGroupType | None = Field(default=None, alias="GroupType") - template_settings: AutomateTemplateSettings | None = Field( - default=None, alias="TemplateSettings" - ) - auto_join_settings: AutomateAutoJoinSettings | None = Field( - default=None, alias="AutoJoinSettings" - ) - linking_settings: AutomateLinkingSettings | None = Field( - default=None, alias="LinkingSettings" - ) - master_status: AutomateMasterStatus | None = Field( - default=None, alias="MasterStatus" - ) + template_settings: AutomateTemplateSettings | None = Field(default=None, alias="TemplateSettings") + auto_join_settings: AutomateAutoJoinSettings | None = Field(default=None, alias="AutoJoinSettings") + linking_settings: AutomateLinkingSettings | None = Field(default=None, alias="LinkingSettings") + master_status: AutomateMasterStatus | None = Field(default=None, alias="MasterStatus") maintenance_window_settings: AutomateMaintenanceWindowSettings | None = Field( default=None, alias="MaintenanceWindowSettings" ) @@ -5620,20 +4538,14 @@ class AutomateMonitor(ConnectWiseModel): monitor_id: int | None = Field(default=None, alias="MonitorId") name: str | None = Field(default=None, alias="Name") groups: list[AutomateGroup] | None = Field(default=None, alias="Groups") - target_computer: AutomateComputer | None = Field( - default=None, alias="TargetComputer" - ) + target_computer: AutomateComputer | None = Field(default=None, alias="TargetComputer") class AutomateSearchLookUpBase(ConnectWiseModel): search_node: str | None = Field(default=None, alias="SearchNode") is_leaf_node: bool | None = Field(default=None, alias="IsLeafNode") - child_nodes: list[AutomateSearchLookUpBase] | None = Field( - default=None, alias="ChildNodes" - ) - attributes: AutomateSearchAttributes | None = Field( - default=None, alias="Attributes" - ) + child_nodes: list[AutomateSearchLookUpBase] | None = Field(default=None, alias="ChildNodes") + attributes: AutomateSearchAttributes | None = Field(default=None, alias="Attributes") class AutomateUser(ConnectWiseModel): @@ -5641,165 +4553,99 @@ class AutomateUser(ConnectWiseModel): name: str | None = Field(default=None, alias="Name") first_name: str | None = Field(default=None, alias="FirstName") last_name: str | None = Field(default=None, alias="LastName") - last_successful_login: datetime | None = Field( - default=None, alias="LastSuccessfulLogin" - ) + last_successful_login: datetime | None = Field(default=None, alias="LastSuccessfulLogin") password: str | None = Field(default=None, alias="Password") folder: AutomateUserFolder | None = Field(default=None, alias="Folder") email_address: str | None = Field(default=None, alias="EmailAddress") auditing_level: int | None = Field(default=None, alias="AuditingLevel") command_level: int | None = Field(default=None, alias="CommandLevel") - uses_ticket_based_security: bool | None = Field( - default=None, alias="UsesTicketBasedSecurity" - ) - new_ticket_display_limit: int | None = Field( - default=None, alias="NewTicketDisplayLimit" - ) + uses_ticket_based_security: bool | None = Field(default=None, alias="UsesTicketBasedSecurity") + new_ticket_display_limit: int | None = Field(default=None, alias="NewTicketDisplayLimit") open_ticket_limit: int | None = Field(default=None, alias="OpenTicketLimit") is_integrator: bool | None = Field(default=None, alias="IsIntegrator") is_locked: bool | None = Field(default=None, alias="IsLocked") is_ticket_router: bool | None = Field(default=None, alias="IsTicketRouter") is_ticket_supervisor: bool | None = Field(default=None, alias="IsTicketSupervisor") ticket_level: AutomateTicketLevel | None = Field(default=None, alias="TicketLevel") - requires_login_report: bool | None = Field( - default=None, alias="RequiresLoginReport" - ) - requires_logout_report: bool | None = Field( - default=None, alias="RequiresLogoutReport" - ) + requires_login_report: bool | None = Field(default=None, alias="RequiresLoginReport") + requires_logout_report: bool | None = Field(default=None, alias="RequiresLogoutReport") last_updated: datetime | None = Field(default=None, alias="LastUpdated") - primary_clients: list[AutomateClient] | None = Field( - default=None, alias="PrimaryClients" - ) - user_classes: list[AutomateUserClass] | None = Field( - default=None, alias="UserClasses" - ) - associated_groups: list[AutomateGroup] | None = Field( - default=None, alias="AssociatedGroups" - ) - sso_status: AutomateUserSingleSignOnStatus | None = Field( - default=None, alias="SsoStatus" - ) + primary_clients: list[AutomateClient] | None = Field(default=None, alias="PrimaryClients") + user_classes: list[AutomateUserClass] | None = Field(default=None, alias="UserClasses") + associated_groups: list[AutomateGroup] | None = Field(default=None, alias="AssociatedGroups") + sso_status: AutomateUserSingleSignOnStatus | None = Field(default=None, alias="SsoStatus") sso_email: str | None = Field(default=None, alias="SsoEmail") - allow_legacy_api_access: bool | None = Field( - default=None, alias="AllowLegacyApiAccess" - ) + allow_legacy_api_access: bool | None = Field(default=None, alias="AllowLegacyApiAccess") class AutomateConfiguration(ConnectWiseModel): check_type: AutomateCheckType | None = Field(default=None, alias="CheckType") interval: AutomateCheckInterval | None = Field(default=None, alias="Interval") condition: AutomateCondition | None = Field(default=None, alias="Condition") - ping_settings: AutomatePingSettings | None = Field( - default=None, alias="PingSettings" - ) - latency_settings: AutomateLatencySettings | None = Field( - default=None, alias="LatencySettings" - ) + ping_settings: AutomatePingSettings | None = Field(default=None, alias="PingSettings") + latency_settings: AutomateLatencySettings | None = Field(default=None, alias="LatencySettings") tcp_settings: AutomateTcpSettings | None = Field(default=None, alias="TcpSettings") udp_settings: AutomateUdpSettings | None = Field(default=None, alias="UdpSettings") - snmp_settings: AutomateSnmpSettings | None = Field( - default=None, alias="SnmpSettings" - ) + snmp_settings: AutomateSnmpSettings | None = Field(default=None, alias="SnmpSettings") performance_counter_settings: AutomatePerformanceCounterSettings | None = Field( default=None, alias="PerformanceCounterSettings" ) file_or_directory_settings: AutomateFileOrDirectorySettings | None = Field( default=None, alias="FileOrDirectorySettings" ) - service_settings: AutomateServiceSettings | None = Field( - default=None, alias="ServiceSettings" - ) - disk_space_settings: AutomateDiskSpaceSettings | None = Field( - default=None, alias="DiskSpaceSettings" - ) - registry_settings: AutomateRegistrySettings | None = Field( - default=None, alias="RegistrySettings" - ) - process_settings: AutomateProcessSettings | None = Field( - default=None, alias="ProcessSettings" - ) - event_log_settings: AutomateEventLogSettings | None = Field( - default=None, alias="EventLogSettings" - ) - executable_settings: AutomateExecutableSettings | None = Field( - default=None, alias="ExecutableSettings" - ) + service_settings: AutomateServiceSettings | None = Field(default=None, alias="ServiceSettings") + disk_space_settings: AutomateDiskSpaceSettings | None = Field(default=None, alias="DiskSpaceSettings") + registry_settings: AutomateRegistrySettings | None = Field(default=None, alias="RegistrySettings") + process_settings: AutomateProcessSettings | None = Field(default=None, alias="ProcessSettings") + event_log_settings: AutomateEventLogSettings | None = Field(default=None, alias="EventLogSettings") + executable_settings: AutomateExecutableSettings | None = Field(default=None, alias="ExecutableSettings") wmi_settings: AutomateWmiSettings | None = Field(default=None, alias="WmiSettings") - bandwidth_settings: AutomateBandwidthSettings | None = Field( - default=None, alias="BandwidthSettings" - ) - sensor_settings: AutomateSensorSettings | None = Field( - default=None, alias="SensorSettings" - ) + bandwidth_settings: AutomateBandwidthSettings | None = Field(default=None, alias="BandwidthSettings") + sensor_settings: AutomateSensorSettings | None = Field(default=None, alias="SensorSettings") class AutomateWebExtensionClickButton(ConnectWiseModel): icon_url: str | None = Field(default=None, alias="IconUrl") button_text: str | None = Field(default=None, alias="ButtonText") - click_action: AutomateWebExtensionClickAction | None = Field( - default=None, alias="ClickAction" - ) + click_action: AutomateWebExtensionClickAction | None = Field(default=None, alias="ClickAction") allows_multi_select: bool | None = Field(default=None, alias="AllowsMultiSelect") - web_extension_control_id: int | None = Field( - default=None, alias="WebExtensionControlId" - ) - web_extension_control_name: str | None = Field( - default=None, alias="WebExtensionControlName" - ) + web_extension_control_id: int | None = Field(default=None, alias="WebExtensionControlId") + web_extension_control_name: str | None = Field(default=None, alias="WebExtensionControlName") web_extension_guid: UUID | None = Field( default=None, alias="WebExtensionGuid", - example="00000000-0000-0000-0000-000000000000", - ) - extension_claim_type: AutomateExtensionClaimType | None = Field( - default=None, alias="ExtensionClaimType" + examples=["00000000-0000-0000-0000-000000000000"], ) + extension_claim_type: AutomateExtensionClaimType | None = Field(default=None, alias="ExtensionClaimType") is_core_extension: bool | None = Field(default=None, alias="IsCoreExtension") - web_extension_area_control_type_ids: list[int] | None = Field( - default=None, alias="WebExtensionAreaControlTypeIds" - ) + web_extension_area_control_type_ids: list[int] | None = Field(default=None, alias="WebExtensionAreaControlTypeIds") class AutomateWebExtensionMenuButton(ConnectWiseModel): icon_url: str | None = Field(default=None, alias="IconUrl") button_text: str | None = Field(default=None, alias="ButtonText") - menu_items: list[AutomateWebExtensionMenuItem] | None = Field( - default=None, alias="MenuItems" - ) + menu_items: list[AutomateWebExtensionMenuItem] | None = Field(default=None, alias="MenuItems") allows_multi_select: bool | None = Field(default=None, alias="AllowsMultiSelect") - web_extension_control_id: int | None = Field( - default=None, alias="WebExtensionControlId" - ) - web_extension_control_name: str | None = Field( - default=None, alias="WebExtensionControlName" - ) + web_extension_control_id: int | None = Field(default=None, alias="WebExtensionControlId") + web_extension_control_name: str | None = Field(default=None, alias="WebExtensionControlName") web_extension_guid: UUID | None = Field( default=None, alias="WebExtensionGuid", - example="00000000-0000-0000-0000-000000000000", - ) - extension_claim_type: AutomateExtensionClaimType | None = Field( - default=None, alias="ExtensionClaimType" + examples=["00000000-0000-0000-0000-000000000000"], ) + extension_claim_type: AutomateExtensionClaimType | None = Field(default=None, alias="ExtensionClaimType") is_core_extension: bool | None = Field(default=None, alias="IsCoreExtension") - web_extension_area_control_type_ids: list[int] | None = Field( - default=None, alias="WebExtensionAreaControlTypeIds" - ) + web_extension_area_control_type_ids: list[int] | None = Field(default=None, alias="WebExtensionAreaControlTypeIds") class AutomateWebExtension(ConnectWiseModel): web_extension_id: int | None = Field(default=None, alias="WebExtensionId") - extension_solution: AutomateExtensionSolution | None = Field( - default=None, alias="ExtensionSolution" - ) - extension_status: AutomateExtensionStatus | None = Field( - default=None, alias="ExtensionStatus" - ) + extension_solution: AutomateExtensionSolution | None = Field(default=None, alias="ExtensionSolution") + extension_status: AutomateExtensionStatus | None = Field(default=None, alias="ExtensionStatus") web_extension_guid: UUID | None = Field( default=None, alias="WebExtensionGuid", - example="00000000-0000-0000-0000-000000000000", + examples=["00000000-0000-0000-0000-000000000000"], ) web_extension_name: str | None = Field(default=None, alias="WebExtensionName") author: str | None = Field(default=None, alias="Author") @@ -5811,43 +4657,23 @@ class AutomateWebExtension(ConnectWiseModel): has_static_files: bool | None = Field(default=None, alias="HasStaticFiles") has_graph_files: bool | None = Field(default=None, alias="HasGraphFiles") is_core_extension: bool | None = Field(default=None, alias="IsCoreExtension") - extension_claim_types: list[AutomateExtensionClaimType] | None = Field( - default=None, alias="ExtensionClaimTypes" - ) - redirects: list[AutomateWebExtensionRedirect] | None = Field( - default=None, alias="Redirects" - ) + extension_claim_types: list[AutomateExtensionClaimType] | None = Field(default=None, alias="ExtensionClaimTypes") + redirects: list[AutomateWebExtensionRedirect] | None = Field(default=None, alias="Redirects") tiles: list[AutomateWebExtensionTile] | None = Field(default=None, alias="Tiles") - inline_frames: list[AutomateWebExtensionInlineFrame] | None = Field( - default=None, alias="InlineFrames" - ) - menu_buttons: list[AutomateWebExtensionMenuButton] | None = Field( - default=None, alias="MenuButtons" - ) - click_buttons: list[AutomateWebExtensionClickButton] | None = Field( - default=None, alias="ClickButtons" - ) + inline_frames: list[AutomateWebExtensionInlineFrame] | None = Field(default=None, alias="InlineFrames") + menu_buttons: list[AutomateWebExtensionMenuButton] | None = Field(default=None, alias="MenuButtons") + click_buttons: list[AutomateWebExtensionClickButton] | None = Field(default=None, alias="ClickButtons") class AutomateScriptScheduleSettings(ConnectWiseModel): script_schedule_frequency: AutomateScriptScheduleFrequency | None = Field( default=None, alias="ScriptScheduleFrequency" ) - minutely_settings: AutomateMinutelyScheduleFrequency | None = Field( - default=None, alias="MinutelySettings" - ) - hourly_settings: AutomateHourlyScheduleFrequency | None = Field( - default=None, alias="HourlySettings" - ) - daily_settings: AutomateDailyScheduleFrequency | None = Field( - default=None, alias="DailySettings" - ) - weekly_settings: AutomateWeeklyScheduleFrequency | None = Field( - default=None, alias="WeeklySettings" - ) - monthly_settings: AutomateMonthlyScheduleFrequency | None = Field( - default=None, alias="MonthlySettings" - ) + minutely_settings: AutomateMinutelyScheduleFrequency | None = Field(default=None, alias="MinutelySettings") + hourly_settings: AutomateHourlyScheduleFrequency | None = Field(default=None, alias="HourlySettings") + daily_settings: AutomateDailyScheduleFrequency | None = Field(default=None, alias="DailySettings") + weekly_settings: AutomateWeeklyScheduleFrequency | None = Field(default=None, alias="WeeklySettings") + monthly_settings: AutomateMonthlyScheduleFrequency | None = Field(default=None, alias="MonthlySettings") class AutomateRebootPolicy(ConnectWiseModel): @@ -5857,22 +4683,16 @@ class AutomateRebootPolicy(ConnectWiseModel): disable_server_patch_reboot_settings: AutomateDisableServerPatchRebootSettings | None = Field( default=None, alias="DisableServerPatchRebootSettings" ) - prompt_without_deadline_settings: AutomatePromptWithoutDeadlineSettings | None = ( - Field(default=None, alias="PromptWithoutDeadlineSettings") + prompt_without_deadline_settings: AutomatePromptWithoutDeadlineSettings | None = Field( + default=None, alias="PromptWithoutDeadlineSettings" ) class AutomateLocalOverridePolicy(ConnectWiseModel): - approval_policies: list[AutomateApprovalPolicy] | None = Field( - default=None, alias="ApprovalPolicies" - ) + approval_policies: list[AutomateApprovalPolicy] | None = Field(default=None, alias="ApprovalPolicies") computer_id: int | None = Field(default=None, alias="ComputerId") - microsoft_update_policy: AutomateMicrosoftUpdatePolicy | None = Field( - default=None, alias="MicrosoftUpdatePolicy" - ) - reboot_policy: AutomateRebootPolicy | None = Field( - default=None, alias="RebootPolicy" - ) + microsoft_update_policy: AutomateMicrosoftUpdatePolicy | None = Field(default=None, alias="MicrosoftUpdatePolicy") + reboot_policy: AutomateRebootPolicy | None = Field(default=None, alias="RebootPolicy") third_party_update_policy: AutomateThirdPartyUpdatePolicy | None = Field( default=None, alias="ThirdPartyUpdatePolicy" ) @@ -5888,36 +4708,24 @@ class AutomateRunningScript(ConnectWiseModel): class AutomateScheduledScriptTarget(ConnectWiseModel): - schedule_target_type: AutomateScheduleTargetType | None = Field( - default=None, alias="ScheduleTargetType" - ) + schedule_target_type: AutomateScheduleTargetType | None = Field(default=None, alias="ScheduleTargetType") group: AutomateGroup | None = Field(default=None, alias="Group") client: AutomateClient | None = Field(default=None, alias="Client") location: AutomateLocation | None = Field(default=None, alias="Location") computer: AutomateComputer | None = Field(default=None, alias="Computer") - network_device: AutomateNetworkDevice | None = Field( - default=None, alias="NetworkDevice" - ) + network_device: AutomateNetworkDevice | None = Field(default=None, alias="NetworkDevice") contact: AutomateContact | None = Field(default=None, alias="Contact") class AutomateScriptReferences(ConnectWiseModel): schedule_count: int | None = Field(default=None, alias="ScheduleCount") - internal_monitors: list[AutomateMonitor] | None = Field( - default=None, alias="InternalMonitors" - ) - remote_monitors: list[AutomateMonitor] | None = Field( - default=None, alias="RemoteMonitors" - ) - alert_templates: list[AutomateAlertTemplate] | None = Field( - default=None, alias="AlertTemplates" - ) + internal_monitors: list[AutomateMonitor] | None = Field(default=None, alias="InternalMonitors") + remote_monitors: list[AutomateMonitor] | None = Field(default=None, alias="RemoteMonitors") + alert_templates: list[AutomateAlertTemplate] | None = Field(default=None, alias="AlertTemplates") class AutomateAdvancedSearchLookUp(ConnectWiseModel): - look_up_nodes: list[AutomateSearchLookUpBase] | None = Field( - default=None, alias="LookUpNodes" - ) + look_up_nodes: list[AutomateSearchLookUpBase] | None = Field(default=None, alias="LookUpNodes") collection_nodes: list[str] | None = Field(default=None, alias="CollectionNodes") @@ -5932,46 +4740,26 @@ class AutomateRemoteMonitorTemplate(ConnectWiseModel): last_edited_time: datetime | None = Field(default=None, alias="LastEditedTime") remote_monitor_id: int | None = Field(default=None, alias="RemoteMonitorId") name: str | None = Field(default=None, alias="Name") - alerting_settings: AutomateAlertingSettings | None = Field( - default=None, alias="AlertingSettings" - ) - configuration: AutomateConfiguration | None = Field( - default=None, alias="Configuration" - ) + alerting_settings: AutomateAlertingSettings | None = Field(default=None, alias="AlertingSettings") + configuration: AutomateConfiguration | None = Field(default=None, alias="Configuration") class AutomatePatchingPolicies(ConnectWiseModel): - microsoft_update_policy: AutomateMicrosoftUpdatePolicy | None = Field( - default=None, alias="MicrosoftUpdatePolicy" - ) - reboot_policy: AutomateRebootPolicy | None = Field( - default=None, alias="RebootPolicy" - ) + microsoft_update_policy: AutomateMicrosoftUpdatePolicy | None = Field(default=None, alias="MicrosoftUpdatePolicy") + reboot_policy: AutomateRebootPolicy | None = Field(default=None, alias="RebootPolicy") third_party_update_policy: AutomateThirdPartyUpdatePolicy | None = Field( default=None, alias="ThirdPartyUpdatePolicy" ) - approval_policies: list[AutomateApprovalPolicy] | None = Field( - default=None, alias="ApprovalPolicies" - ) + approval_policies: list[AutomateApprovalPolicy] | None = Field(default=None, alias="ApprovalPolicies") class AutomateWebExtensionAreaControls(ConnectWiseModel): - web_extension_area: AutomateWebExtensionArea | None = Field( - default=None, alias="WebExtensionArea" - ) - click_buttons: list[AutomateWebExtensionClickButton] | None = Field( - default=None, alias="ClickButtons" - ) - menu_buttons: list[AutomateWebExtensionMenuButton] | None = Field( - default=None, alias="MenuButtons" - ) + web_extension_area: AutomateWebExtensionArea | None = Field(default=None, alias="WebExtensionArea") + click_buttons: list[AutomateWebExtensionClickButton] | None = Field(default=None, alias="ClickButtons") + menu_buttons: list[AutomateWebExtensionMenuButton] | None = Field(default=None, alias="MenuButtons") tiles: list[AutomateWebExtensionTile] | None = Field(default=None, alias="Tiles") - redirects: list[AutomateWebExtensionRedirect] | None = Field( - default=None, alias="Redirects" - ) - inline_frames: list[AutomateWebExtensionInlineFrame] | None = Field( - default=None, alias="InlineFrames" - ) + redirects: list[AutomateWebExtensionRedirect] | None = Field(default=None, alias="Redirects") + inline_frames: list[AutomateWebExtensionInlineFrame] | None = Field(default=None, alias="InlineFrames") class AutomateScheduleScriptBatchRequest(ConnectWiseModel): @@ -6008,9 +4796,7 @@ class AutomateScheduleScriptBatchRequest(ConnectWiseModel): entity_ids: list[int] | None = Field(default=None, alias="EntityIds") script_id: int | None = Field(default=None, alias="ScriptId") script_guid: str | None = Field(default=None, alias="ScriptGuid") - schedule: AutomateScriptScheduleSettings | None = Field( - default=None, alias="Schedule" - ) + schedule: AutomateScriptScheduleSettings | None = Field(default=None, alias="Schedule") parameters: list[SystemString] | None = Field(default=None, alias="Parameters") use_agent_time: bool | None = Field(default=None, alias="UseAgentTime") start_date: datetime | None = Field(default=None, alias="StartDate") @@ -6018,55 +4804,37 @@ class AutomateScheduleScriptBatchRequest(ConnectWiseModel): offline_action_flags: AutomateScheduledScriptOfflineActionFlags | None = Field( default=None, alias="OfflineActionFlags" ) - distribution_window: AutomateDistributionWindow | None = Field( - default=None, alias="DistributionWindow" - ) + distribution_window: AutomateDistributionWindow | None = Field(default=None, alias="DistributionWindow") priority: int | None = Field(default=None, alias="Priority") include_sub_groups: bool | None = Field(default=None, alias="IncludeSubGroups") class AutomateGroupPatchingPolicy(ConnectWiseModel): - approval_policies: list[AutomateApprovalPolicy] | None = Field( - default=None, alias="ApprovalPolicies" - ) + approval_policies: list[AutomateApprovalPolicy] | None = Field(default=None, alias="ApprovalPolicies") group_id: int | None = Field(default=None, alias="GroupId") group_name: str | None = Field(default=None, alias="GroupName") is_manual: bool | None = Field(default=None, alias="IsManual") is_patching_group: bool | None = Field(default=None, alias="IsPatchingGroup") - microsoft_update_policy: AutomateMicrosoftUpdatePolicy | None = Field( - default=None, alias="MicrosoftUpdatePolicy" - ) + microsoft_update_policy: AutomateMicrosoftUpdatePolicy | None = Field(default=None, alias="MicrosoftUpdatePolicy") priority: int | None = Field(default=None, alias="Priority") - reboot_policy: AutomateRebootPolicy | None = Field( - default=None, alias="RebootPolicy" - ) + reboot_policy: AutomateRebootPolicy | None = Field(default=None, alias="RebootPolicy") third_party_update_policy: AutomateThirdPartyUpdatePolicy | None = Field( default=None, alias="ThirdPartyUpdatePolicy" ) - auto_join_settings: AutomateGroupAutoJoinSettings | None = Field( - default=None, alias="AutoJoinSettings" - ) - windows_computer_count: int | None = Field( - default=None, alias="WindowsComputerCount" - ) + auto_join_settings: AutomateGroupAutoJoinSettings | None = Field(default=None, alias="AutoJoinSettings") + windows_computer_count: int | None = Field(default=None, alias="WindowsComputerCount") class AutomateScheduledScript(ConnectWiseModel): scheduled_script_id: int | None = Field(default=None, alias="ScheduledScriptId") script: AutomateScript | None = Field(default=None, alias="Script") - schedule_target: AutomateScheduledScriptTarget | None = Field( - default=None, alias="ScheduleTarget" - ) - schedule: AutomateScriptScheduleSettings | None = Field( - default=None, alias="Schedule" - ) + schedule_target: AutomateScheduledScriptTarget | None = Field(default=None, alias="ScheduleTarget") + schedule: AutomateScriptScheduleSettings | None = Field(default=None, alias="Schedule") limiting_search: AutomateSearch | None = Field(default=None, alias="LimitingSearch") offline_action_flags: AutomateScheduledScriptOfflineActionFlags | None = Field( default=None, alias="OfflineActionFlags" ) - distribution_window: AutomateDistributionWindow | None = Field( - default=None, alias="DistributionWindow" - ) + distribution_window: AutomateDistributionWindow | None = Field(default=None, alias="DistributionWindow") parameters: list[SystemString] | None = Field(default=None, alias="Parameters") use_agent_time: bool | None = Field(default=None, alias="UseAgentTime") scheduled_by: str | None = Field(default=None, alias="ScheduledBy") @@ -6096,15 +4864,9 @@ class LabTechClient(ConnectWiseModel): comment: str | None = Field(default=None, alias="Comment") country: str | None = Field(default=None, alias="Country") external_id: str | None = Field(default=None, alias="ExternalId") - uses_in_house_support_staff: bool | None = Field( - default=None, alias="UsesInHouseSupportStaff" - ) - new_ticket_notification_email: str | None = Field( - default=None, alias="NewTicketNotificationEmail" - ) - is_hidden_from_all_inclusive_group: bool | None = Field( - default=None, alias="IsHiddenFromAllInclusiveGroup" - ) + uses_in_house_support_staff: bool | None = Field(default=None, alias="UsesInHouseSupportStaff") + new_ticket_notification_email: str | None = Field(default=None, alias="NewTicketNotificationEmail") + is_hidden_from_all_inclusive_group: bool | None = Field(default=None, alias="IsHiddenFromAllInclusiveGroup") locations: list[LabTechLocation] | None = Field(default=None, alias="Locations") @@ -6132,18 +4894,10 @@ class LabTechLocation(ConnectWiseModel): probe_id: int | None = Field(default=None, alias="ProbeId") external_id: int | None = Field(default=None, alias="ExternalId") router: LabTechRouter | None = Field(default=None, alias="Router") - deployment_template: LabTechRemoteAgentTemplate | None = Field( - default=None, alias="DeploymentTemplate" - ) - maintenance_window: LabTechMaintenanceWindowDefinition | None = Field( - default=None, alias="MaintenanceWindow" - ) - default_deployment_group: LabTechGroup | None = Field( - default=None, alias="DefaultDeploymentGroup" - ) - default_deployment_login: LabTechDeploymentLogin | None = Field( - default=None, alias="DefaultDeploymentLogin" - ) + deployment_template: LabTechRemoteAgentTemplate | None = Field(default=None, alias="DeploymentTemplate") + maintenance_window: LabTechMaintenanceWindowDefinition | None = Field(default=None, alias="MaintenanceWindow") + default_deployment_group: LabTechGroup | None = Field(default=None, alias="DefaultDeploymentGroup") + default_deployment_login: LabTechDeploymentLogin | None = Field(default=None, alias="DefaultDeploymentLogin") class LabTechContact(ConnectWiseModel): @@ -6163,13 +4917,9 @@ class LabTechContact(ConnectWiseModel): pager_number: str | None = Field(default=None, alias="PagerNumber") email: str | None = Field(default=None, alias="Email") external_id: str | None = Field(default=None, alias="ExternalId") - web_permissions: LabTechContactWebPermissions | None = Field( - default=None, alias="WebPermissions" - ) + web_permissions: LabTechContactWebPermissions | None = Field(default=None, alias="WebPermissions") created_date: datetime | None = Field(default=None, alias="CreatedDate") - associated_computers: list[LabTechComputer] | None = Field( - default=None, alias="AssociatedComputers" - ) + associated_computers: list[LabTechComputer] | None = Field(default=None, alias="AssociatedComputers") class LabTechGroup(ConnectWiseModel): @@ -6185,48 +4935,24 @@ class LabTechGroup(ConnectWiseModel): type_name: str | None = Field(default=None, alias="TypeName") template_priority: int | None = Field(default=None, alias="TemplatePriority") guid: str | None = Field(default=None, alias="GUID") - computers_auto_join_search: LabTechSearch | None = Field( - default=None, alias="ComputersAutoJoinSearch" - ) - network_devices_auto_join_search: LabTechSearch | None = Field( - default=None, alias="NetworkDevicesAutoJoinSearch" - ) - contacts_auto_join_search: LabTechSearch | None = Field( - default=None, alias="ContactsAutoJoinSearch" - ) - maintenance_window: LabTechMaintenanceWindow | None = Field( - default=None, alias="MaintenanceWindow" - ) - maintenance_window_last_applied: datetime | None = Field( - default=None, alias="MaintenanceWindowLastApplied" - ) - computers_limit_to_search: bool | None = Field( - default=None, alias="ComputersLimitToSearch" - ) - network_devices_limit_to_search: bool | None = Field( - default=None, alias="NetworkDevicesLimitToSearch" - ) - contacts_limit_to_search: bool | None = Field( - default=None, alias="ContactsLimitToSearch" - ) - contacts_join_computers: bool | None = Field( - default=None, alias="ContactsJoinComputers" - ) - remote_agent_template: LabTechRemoteAgentTemplate | None = Field( - default=None, alias="RemoteAgentTemplate" - ) + computers_auto_join_search: LabTechSearch | None = Field(default=None, alias="ComputersAutoJoinSearch") + network_devices_auto_join_search: LabTechSearch | None = Field(default=None, alias="NetworkDevicesAutoJoinSearch") + contacts_auto_join_search: LabTechSearch | None = Field(default=None, alias="ContactsAutoJoinSearch") + maintenance_window: LabTechMaintenanceWindow | None = Field(default=None, alias="MaintenanceWindow") + maintenance_window_last_applied: datetime | None = Field(default=None, alias="MaintenanceWindowLastApplied") + computers_limit_to_search: bool | None = Field(default=None, alias="ComputersLimitToSearch") + network_devices_limit_to_search: bool | None = Field(default=None, alias="NetworkDevicesLimitToSearch") + contacts_limit_to_search: bool | None = Field(default=None, alias="ContactsLimitToSearch") + contacts_join_computers: bool | None = Field(default=None, alias="ContactsJoinComputers") + remote_agent_template: LabTechRemoteAgentTemplate | None = Field(default=None, alias="RemoteAgentTemplate") client_to_sync: LabTechClient | None = Field(default=None, alias="ClientToSync") - location_to_sync: LabTechLocation | None = Field( - default=None, alias="LocationToSync" - ) + location_to_sync: LabTechLocation | None = Field(default=None, alias="LocationToSync") comments: str | None = Field(default=None, alias="Comments") computer_permissions: list[LabTechUserClassComputerPermissions] | None = Field( default=None, alias="ComputerPermissions" ) computers: list[LabTechComputer] | None = Field(default=None, alias="Computers") - network_devices: list[LabTechNetworkDevice] | None = Field( - default=None, alias="NetworkDevices" - ) + network_devices: list[LabTechNetworkDevice] | None = Field(default=None, alias="NetworkDevices") contacts: list[LabTechContact] | None = Field(default=None, alias="Contacts") @@ -6239,40 +4965,24 @@ class LabTechComputer(ConnectWiseModel): is_master: bool | None = Field(default=None, alias="IsMaster") is_network_probe: bool | None = Field(default=None, alias="IsNetworkProbe") is_heartbeat_enabled: bool | None = Field(default=None, alias="IsHeartbeatEnabled") - is_maintenance_mode_enabled: bool | None = Field( - default=None, alias="IsMaintenanceModeEnabled" - ) + is_maintenance_mode_enabled: bool | None = Field(default=None, alias="IsMaintenanceModeEnabled") is_tunnel_supported: bool | None = Field(default=None, alias="IsTunnelSupported") is_virtual_machine: bool | None = Field(default=None, alias="IsVirtualMachine") computer_name: str | None = Field(default=None, alias="ComputerName") operating_system_name: str | None = Field(default=None, alias="OperatingSystemName") - operating_system_version: str | None = Field( - default=None, alias="OperatingSystemVersion" - ) + operating_system_version: str | None = Field(default=None, alias="OperatingSystemVersion") domain_name: str | None = Field(default=None, alias="DomainName") - remote_agent_last_inventory: datetime | None = Field( - default=None, alias="RemoteAgentLastInventory" - ) + remote_agent_last_inventory: datetime | None = Field(default=None, alias="RemoteAgentLastInventory") utc_offset: int | None = Field(default=None, alias="UTCOffset") open_ports_tcp: list[int] | None = Field(default=None, alias="OpenPortsTCP") open_ports_udp: list[int] | None = Field(default=None, alias="OpenPortsUDP") comment: str | None = Field(default=None, alias="Comment") remote_agent_version: str | None = Field(default=None, alias="RemoteAgentVersion") - remote_agent_last_contact: datetime | None = Field( - default=None, alias="RemoteAgentLastContact" - ) - domain_name_servers: list[str] | None = Field( - default=None, alias="DomainNameServers" - ) - last_inventory_received: datetime | None = Field( - default=None, alias="LastInventoryReceived" - ) - windows_update_date: datetime | None = Field( - default=None, alias="WindowsUpdateDate" - ) - antivirus_definition_date: datetime | None = Field( - default=None, alias="AntivirusDefinitionDate" - ) + remote_agent_last_contact: datetime | None = Field(default=None, alias="RemoteAgentLastContact") + domain_name_servers: list[str] | None = Field(default=None, alias="DomainNameServers") + last_inventory_received: datetime | None = Field(default=None, alias="LastInventoryReceived") + windows_update_date: datetime | None = Field(default=None, alias="WindowsUpdateDate") + antivirus_definition_date: datetime | None = Field(default=None, alias="AntivirusDefinitionDate") last_heartbeat: datetime | None = Field(default=None, alias="LastHeartbeat") total_memory: int | None = Field(default=None, alias="TotalMemory") free_memory: int | None = Field(default=None, alias="FreeMemory") @@ -6284,9 +4994,7 @@ class LabTechComputer(ConnectWiseModel): mac_address: str | None = Field(default=None, alias="MACAddress") date_added: datetime | None = Field(default=None, alias="DateAdded") user_idle_time: int | None = Field(default=None, alias="UserIdleTime") - logged_in_users: list[LabTechLoggedInUser] | None = Field( - default=None, alias="LoggedInUsers" - ) + logged_in_users: list[LabTechLoggedInUser] | None = Field(default=None, alias="LoggedInUsers") last_user_name: str | None = Field(default=None, alias="LastUserName") tickets: list[LabTechTicket] | None = Field(default=None, alias="Tickets") groups: list[LabTechGroup] | None = Field(default=None, alias="Groups") @@ -6298,9 +5006,7 @@ class LabTechComputer(ConnectWiseModel): type: str | None = Field(default=None, alias="Type") status: str | None = Field(default=None, alias="Status") master_mode: str | None = Field(default=None, alias="MasterMode") - virus_scanner: LabTechVirusScannerDef | None = Field( - default=None, alias="VirusScanner" - ) + virus_scanner: LabTechVirusScannerDef | None = Field(default=None, alias="VirusScanner") friendly_name: str | None = Field(default=None, alias="FriendlyName") is_locked_down: bool | None = Field(default=None, alias="IsLockedDown") is_system_account: bool | None = Field(default=None, alias="IsSystemAccount") @@ -6322,9 +5028,7 @@ class LabTechComputer(ConnectWiseModel): bios_manufacturer: str | None = Field(default=None, alias="BiosManufacturer") bios_flash: str | None = Field(default=None, alias="BiosFlash") primary_contact_name: str | None = Field(default=None, alias="PrimaryContactName") - comment_priority: LabTechCommentPriority | None = Field( - default=None, alias="CommentPriority" - ) + comment_priority: LabTechCommentPriority | None = Field(default=None, alias="CommentPriority") irq: list[int] | None = Field(default=None, alias="IRQ") address: list[int] | None = Field(default=None, alias="Address") dma: list[int] | None = Field(default=None, alias="DMA") @@ -6339,12 +5043,8 @@ class LabTechNetworkDevice(ConnectWiseModel): name: str | None = Field(default=None, alias="Name") friendly_name: str | None = Field(default=None, alias="FriendlyName") open_ports_tcp: list[int] | None = Field(default=None, alias="OpenPortsTCP") - device_type: LabTechNetworkDeviceType | None = Field( - default=None, alias="DeviceType" - ) - detection_template_name: str | None = Field( - default=None, alias="DetectionTemplateName" - ) + device_type: LabTechNetworkDeviceType | None = Field(default=None, alias="DeviceType") + detection_template_name: str | None = Field(default=None, alias="DetectionTemplateName") last_updated: datetime | None = Field(default=None, alias="LastUpdated") mac_address: str | None = Field(default=None, alias="MACAddress") status: str | None = Field(default=None, alias="Status") @@ -6384,8 +5084,8 @@ class LabTechNetworkDevice(ConnectWiseModel): interface_count: int | None = Field(default=None, alias="InterfaceCount") probe_id: int | None = Field(default=None, alias="ProbeId") probe_name: str | None = Field(default=None, alias="ProbeName") - agent_deployment_readiness_check: LabTechAgentDeploymentReadinessCheck | None = ( - Field(default=None, alias="AgentDeploymentReadinessCheck") + agent_deployment_readiness_check: LabTechAgentDeploymentReadinessCheck | None = Field( + default=None, alias="AgentDeploymentReadinessCheck" ) @@ -6412,9 +5112,7 @@ class LabTechTicket(ConnectWiseModel): monitor_id: int | None = Field(default=None, alias="MonitorId") guid: str | None = Field(default=None, alias="Guid") agent: LabTechComputerMonitor | None = Field(default=None, alias="Agent") - network_device: LabTechNetworkDevice | None = Field( - default=None, alias="NetworkDevice" - ) + network_device: LabTechNetworkDevice | None = Field(default=None, alias="NetworkDevice") comments: list[LabTechTicketComment] | None = Field(default=None, alias="Comments") @@ -6427,82 +5125,50 @@ class LabTechMonitorAlertSuspension(ConnectWiseModel): class LabTechMonitor(ConnectWiseModel): alert_action: LabTechAlertAction | None = Field(default=None, alias="AlertAction") - alert_style: LabTechMonitorAlertStyle | None = Field( - default=None, alias="AlertStyle" - ) - comparer_settings: LabTechMonitorComparerSettings | None = Field( - default=None, alias="ComparerSettings" - ) + alert_style: LabTechMonitorAlertStyle | None = Field(default=None, alias="AlertStyle") + comparer_settings: LabTechMonitorComparerSettings | None = Field(default=None, alias="ComparerSettings") control_guid: str | None = Field(default=None, alias="ControlGuid") failure_count: int | None = Field(default=None, alias="FailureCount") id_field: str | None = Field(default=None, alias="IdField") interval: int | None = Field(default=None, alias="Interval") installed: bool | None = Field(default=None, alias="Installed") is_internal_monitor: bool | None = Field(default=None, alias="IsInternalMonitor") - is_network_device_monitor: bool | None = Field( - default=None, alias="IsNetworkDeviceMonitor" - ) + is_network_device_monitor: bool | None = Field(default=None, alias="IsNetworkDeviceMonitor") last_checked: datetime | None = Field(default=None, alias="LastChecked") last_failed: datetime | None = Field(default=None, alias="LastFailed") last_status: str | None = Field(default=None, alias="LastStatus") guid: str | None = Field(default=None, alias="Guid") - monitor_alert_target: LabTechMonitorAlertTarget | None = Field( - default=None, alias="MonitorAlertTarget" - ) + monitor_alert_target: LabTechMonitorAlertTarget | None = Field(default=None, alias="MonitorAlertTarget") monitor_id: int | None = Field(default=None, alias="MonitorId") - monitor_owner: LabTechMonitorOwner | None = Field( - default=None, alias="MonitorOwner" - ) - monitor_state: LabTechMonitorState | None = Field( - default=None, alias="MonitorState" - ) + monitor_owner: LabTechMonitorOwner | None = Field(default=None, alias="MonitorOwner") + monitor_state: LabTechMonitorState | None = Field(default=None, alias="MonitorState") local_state: LabTechMonitorState | None = Field(default=None, alias="LocalState") name: str | None = Field(default=None, alias="Name") pending_update: bool | None = Field(default=None, alias="PendingUpdate") - report_category: LabTechReportCategory | None = Field( - default=None, alias="ReportCategory" - ) - ticket_category: LabTechTicketCategory | None = Field( - default=None, alias="TicketCategory" - ) + report_category: LabTechReportCategory | None = Field(default=None, alias="ReportCategory") + ticket_category: LabTechTicketCategory | None = Field(default=None, alias="TicketCategory") warning_count: int | None = Field(default=None, alias="WarningCount") script: LabTechScript | None = Field(default=None, alias="Script") version: int | None = Field(default=None, alias="Version") - routine_parameters: LabTechMonitorRoutineParameters | None = Field( - default=None, alias="RoutineParameters" - ) + routine_parameters: LabTechMonitorRoutineParameters | None = Field(default=None, alias="RoutineParameters") routine: LabTechMonitorRoutine | None = Field(default=None, alias="Routine") - alert_messages: LabTechMonitorAlertMessages | None = Field( - default=None, alias="AlertMessages" - ) + alert_messages: LabTechMonitorAlertMessages | None = Field(default=None, alias="AlertMessages") targets: LabTechMonitorTarget | None = Field(default=None, alias="Targets") is_global_monitor: bool | None = Field(default=None, alias="IsGlobalMonitor") is_overridden: bool | None = Field(default=None, alias="IsOverridden") is_collecting_data: bool | None = Field(default=None, alias="IsCollectingData") - affected_entities: LabTechMonitorAffectedEntities | None = Field( - default=None, alias="AffectedEntities" - ) + affected_entities: LabTechMonitorAffectedEntities | None = Field(default=None, alias="AffectedEntities") class LabTechMonitorComparerSettings(ConnectWiseModel): comparer: LabTechMonitorComparer | None = Field(default=None, alias="Comparer") - format: LabTechMonitorComparerSettingsFormat | None = Field( - default=None, alias="Format" - ) + format: LabTechMonitorComparerSettingsFormat | None = Field(default=None, alias="Format") value: LabTechMonitorComparerValue | None = Field(default=None, alias="Value") - smoothing_coefficient: float | None = Field( - default=None, alias="SmoothingCoefficient" - ) + smoothing_coefficient: float | None = Field(default=None, alias="SmoothingCoefficient") is_expression: bool | None = Field(default=None, alias="IsExpression") - smoothing_style: LabTechMonitorComparerSettingsSmoothingStyle | None = Field( - default=None, alias="SmoothingStyle" - ) - language_overrides: dict[str, str] | None = Field( - default=None, alias="LanguageOverrides" - ) - result_format: LabTechMonitorComparerSettingsResultFormat | None = Field( - default=None, alias="ResultFormat" - ) + smoothing_style: LabTechMonitorComparerSettingsSmoothingStyle | None = Field(default=None, alias="SmoothingStyle") + language_overrides: dict[str, str] | None = Field(default=None, alias="LanguageOverrides") + result_format: LabTechMonitorComparerSettingsResultFormat | None = Field(default=None, alias="ResultFormat") class LabTechMonitorOwner(ConnectWiseModel): @@ -6510,18 +5176,14 @@ class LabTechMonitorOwner(ConnectWiseModel): description: str | None = Field(default=None, alias="Description") owning_group: LabTechGroup | None = Field(default=None, alias="OwningGroup") owning_script: LabTechScript | None = Field(default=None, alias="OwningScript") - owning_plugin: LabTechMonitorPluginOwner | None = Field( - default=None, alias="OwningPlugin" - ) + owning_plugin: LabTechMonitorPluginOwner | None = Field(default=None, alias="OwningPlugin") class LabTechMonitorTarget(ConnectWiseModel): location: LabTechLocation | None = Field(default=None, alias="Location") client: LabTechClient | None = Field(default=None, alias="Client") computer: LabTechComputer | None = Field(default=None, alias="Computer") - network_device: LabTechNetworkDevice | None = Field( - default=None, alias="NetworkDevice" - ) + network_device: LabTechNetworkDevice | None = Field(default=None, alias="NetworkDevice") group_ids: list[int] | None = Field(default=None, alias="GroupIds") @@ -6529,9 +5191,7 @@ class LabTechMonitorAffectedEntities(ConnectWiseModel): remote_monitor_affected_location: LabTechLocation | None = Field( default=None, alias="RemoteMonitorAffectedLocation" ) - remote_monitor_affected_client: LabTechClient | None = Field( - default=None, alias="RemoteMonitorAffectedClient" - ) + remote_monitor_affected_client: LabTechClient | None = Field(default=None, alias="RemoteMonitorAffectedClient") internal_monitor_affected_locations: list[LabTechLocation] | None = Field( default=None, alias="InternalMonitorAffectedLocations" ) @@ -6541,30 +5201,18 @@ class LabTechMonitorAffectedEntities(ConnectWiseModel): class LabTechMonitorComparerValue(ConnectWiseModel): - format: LabTechMonitorComparerValueFormat | None = Field( - default=None, alias="Format" - ) - multi_value_format: LabTechMonitorComparerMultiValueFormat | None = Field( - default=None, alias="MultiValueFormat" - ) - state_based_value_format: LabTechMonitorComparerStateBasedValueFormat | None = ( - Field(default=None, alias="StateBasedValueFormat") - ) - single_value_format: LabTechMonitorComparerSingleValueFormat | None = Field( - default=None, alias="SingleValueFormat" + format: LabTechMonitorComparerValueFormat | None = Field(default=None, alias="Format") + multi_value_format: LabTechMonitorComparerMultiValueFormat | None = Field(default=None, alias="MultiValueFormat") + state_based_value_format: LabTechMonitorComparerStateBasedValueFormat | None = Field( + default=None, alias="StateBasedValueFormat" ) + single_value_format: LabTechMonitorComparerSingleValueFormat | None = Field(default=None, alias="SingleValueFormat") class LabTechMonitorComparerStateBasedValueFormat(ConnectWiseModel): - normal_comparer: LabTechMonitorComparerSettings | None = Field( - default=None, alias="NormalComparer" - ) - warning_comparer: LabTechMonitorComparerSettings | None = Field( - default=None, alias="WarningComparer" - ) - error_comparer: LabTechMonitorComparerSettings | None = Field( - default=None, alias="ErrorComparer" - ) + normal_comparer: LabTechMonitorComparerSettings | None = Field(default=None, alias="NormalComparer") + warning_comparer: LabTechMonitorComparerSettings | None = Field(default=None, alias="WarningComparer") + error_comparer: LabTechMonitorComparerSettings | None = Field(default=None, alias="ErrorComparer") class LabTechPatchManagerDevice(ConnectWiseModel): @@ -6572,52 +5220,28 @@ class LabTechPatchManagerDevice(ConnectWiseModel): computer_name: str | None = Field(default=None, alias="ComputerName") stage: LabTechPatchStage | None = Field(default=None, alias="Stage") operating_system_name: str | None = Field(default=None, alias="OperatingSystemName") - normalized_operating_system_name: str | None = Field( - default=None, alias="NormalizedOperatingSystemName" - ) + normalized_operating_system_name: str | None = Field(default=None, alias="NormalizedOperatingSystemName") company: LabTechClient | None = Field(default=None, alias="Company") site: LabTechLocation | None = Field(default=None, alias="Site") - last_microsoft_window: datetime | None = Field( - default=None, alias="LastMicrosoftWindow" - ) - last_third_party_window: datetime | None = Field( - default=None, alias="LastThirdPartyWindow" - ) - next_microsoft_window: datetime | None = Field( - default=None, alias="NextMicrosoftWindow" - ) - next_third_party_window: datetime | None = Field( - default=None, alias="NextThirdPartyWindow" - ) - did_last_patch_job_fail: bool | None = Field( - default=None, alias="DidLastPatchJobFail" - ) - is_daytime_patching_enabled: bool | None = Field( - default=None, alias="IsDaytimePatchingEnabled" - ) + last_microsoft_window: datetime | None = Field(default=None, alias="LastMicrosoftWindow") + last_third_party_window: datetime | None = Field(default=None, alias="LastThirdPartyWindow") + next_microsoft_window: datetime | None = Field(default=None, alias="NextMicrosoftWindow") + next_third_party_window: datetime | None = Field(default=None, alias="NextThirdPartyWindow") + did_last_patch_job_fail: bool | None = Field(default=None, alias="DidLastPatchJobFail") + is_daytime_patching_enabled: bool | None = Field(default=None, alias="IsDaytimePatchingEnabled") is_missing_baseline: bool | None = Field(default=None, alias="IsMissingBaseline") - is_missing_patch_inventory: bool | None = Field( - default=None, alias="IsMissingPatchInventory" - ) + is_missing_patch_inventory: bool | None = Field(default=None, alias="IsMissingPatchInventory") is_patch_job_running: bool | None = Field(default=None, alias="IsPatchJobRunning") is_pending_update: bool | None = Field(default=None, alias="IsPendingUpdate") is_reboot_pending: bool | None = Field(default=None, alias="IsRebootPending") is_wsus_enabled: bool | None = Field(default=None, alias="IsWsusEnabled") is_wua_out_of_date: bool | None = Field(default=None, alias="IsWuaOutOfDate") missing_patch_count: int | None = Field(default=None, alias="MissingPatchCount") - microsoft_compliance_percent: float | None = Field( - default=None, alias="MicrosoftCompliancePercent" - ) - third_party_compliance_percent: float | None = Field( - default=None, alias="ThirdPartyCompliancePercent" - ) + microsoft_compliance_percent: float | None = Field(default=None, alias="MicrosoftCompliancePercent") + third_party_compliance_percent: float | None = Field(default=None, alias="ThirdPartyCompliancePercent") has_approved_patches: bool | None = Field(default=None, alias="HasApprovedPatches") - has_approved_microsoft_patches: bool | None = Field( - default=None, alias="HasApprovedMicrosoftPatches" - ) - has_approved_third_party_patches: bool | None = Field( - default=None, alias="HasApprovedThirdPartyPatches" - ) + has_approved_microsoft_patches: bool | None = Field(default=None, alias="HasApprovedMicrosoftPatches") + has_approved_third_party_patches: bool | None = Field(default=None, alias="HasApprovedThirdPartyPatches") release_id: int | None = Field(default=None, alias="ReleaseId") @@ -6627,9 +5251,7 @@ class LabTechRetiredAsset(ConnectWiseModel): location: LabTechLocation | None = Field(default=None, alias="Location") computer_name: str | None = Field(default=None, alias="ComputerName") operating_system_name: str | None = Field(default=None, alias="OperatingSystemName") - operating_system_version: str | None = Field( - default=None, alias="OperatingSystemVersion" - ) + operating_system_version: str | None = Field(default=None, alias="OperatingSystemVersion") comment: str | None = Field(default=None, alias="Comment") local_ip_address: str | None = Field(default=None, alias="LocalIPAddress") gateway_ip_address: str | None = Field(default=None, alias="GatewayIPAddress") diff --git a/src/pyconnectwise/models/base/connectwise_model.py b/src/pyconnectwise/models/base/connectwise_model.py index b8ce8a38f..ce97f9064 100644 --- a/src/pyconnectwise/models/base/connectwise_model.py +++ b/src/pyconnectwise/models/base/connectwise_model.py @@ -1,9 +1,12 @@ from __future__ import annotations + +import inspect +from types import UnionType +from typing import Union, get_args, get_origin + from pydantic import BaseModel, ConfigDict + from pyconnectwise.utils.naming import to_camel_case -from typing import get_origin, get_args, Union -from types import UnionType -import inspect class ConnectWiseModel(BaseModel): @@ -22,9 +25,7 @@ def _get_field_names(cls) -> list[str]: for arg in get_args(v.annotation): if inspect.isclass(arg) and issubclass(arg, ConnectWiseModel): was_model = True - field_names.extend( - [f"{v.alias}/{sub}" for sub in arg._get_field_names()] - ) + field_names.extend([f"{v.alias}/{sub}" for sub in arg._get_field_names()]) if not was_model: field_names.append(v.alias) @@ -37,10 +38,7 @@ def _get_field_names_and_types(cls) -> dict[str, str]: # noqa: C901 for v in cls.__fields__.values(): was_model = False field_type = "None" - if ( - get_origin(v.annotation) is UnionType - or get_origin(v.annotation) is Union - ): + if get_origin(v.annotation) is UnionType or get_origin(v.annotation) is Union: for arg in get_args(v.annotation): if inspect.isclass(arg) and issubclass(arg, ConnectWiseModel): was_model = True @@ -49,9 +47,7 @@ def _get_field_names_and_types(cls) -> dict[str, str]: # noqa: C901 elif arg is not None and arg.__name__ != "NoneType": field_type = arg.__name__ else: - if inspect.isclass(v.annotation) and issubclass( - v.annotation, ConnectWiseModel - ): + if inspect.isclass(v.annotation) and issubclass(v.annotation, ConnectWiseModel): was_model = True for sk, sv in v.annotation._get_field_names_and_types().items(): field_names_and_types[f"{v.alias}/{sk}"] = sv diff --git a/src/pyconnectwise/models/manage/__init__.py b/src/pyconnectwise/models/manage/__init__.py index 0a747cc9d..6e3aa0800 100644 --- a/src/pyconnectwise/models/manage/__init__.py +++ b/src/pyconnectwise/models/manage/__init__.py @@ -1,25 +1,27 @@ # generated by datamodel-codegen: -# filename: All.json +# filename: tmpsy69p9nm from __future__ import annotations -from datetime import date, datetime # noqa: TCH003 -from typing import Any, Literal -from uuid import UUID # noqa: TCH003 - -from pydantic import Field +from typing import TYPE_CHECKING, Annotated, Any, Literal from pyconnectwise.models.base.connectwise_model import ConnectWiseModel +if TYPE_CHECKING: + from datetime import date, datetime + from uuid import UUID + + from pydantic import Field + class AccountingBatch(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + batch_identifier: Annotated[str | None, Field(alias="batchIdentifier")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + export_expenses_flag: Annotated[bool | None, Field(alias="exportExpensesFlag")] = None + export_invoices_flag: Annotated[bool | None, Field(alias="exportInvoicesFlag")] = None + export_products_flag: Annotated[bool | None, Field(alias="exportProductsFlag")] = None id: int | None = None - batch_identifier: str | None = Field(default=None, alias="batchIdentifier") - export_invoices_flag: bool | None = Field(default=None, alias="exportInvoicesFlag") - export_expenses_flag: bool | None = Field(default=None, alias="exportExpensesFlag") - export_products_flag: bool | None = Field(default=None, alias="exportProductsFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class AccountingPackage(ConnectWiseModel): @@ -29,92 +31,60 @@ class AccountingPackage(ConnectWiseModel): class AccountingPackageReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - identifier: Literal[ - "QB99", "Mas200", "GPlains", "SBA", "Mas200v4", "Other" - ] | None = None + identifier: Literal["QB99", "Mas200", "GPlains", "SBA", "Mas200v4", "Other"] | None = None name: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class AccountingPackageSetup(ConnectWiseModel): - id: int | None = None - accounting_package: AccountingPackageReference | None = Field( - default=None, alias="accountingPackage" - ) - direct_transfer_flag: bool | None = Field(default=None, alias="directTransferFlag") - include_invoices_flag: bool | None = Field( - default=None, alias="includeInvoicesFlag" - ) - invoice_format: Literal["Default", "Condensed", "Detailed"] | None = Field( - default=None, alias="invoiceFormat" - ) - include_expenses_flag: bool | None = Field( - default=None, alias="includeExpensesFlag" - ) - transfer_expenses_as_bill_flag: bool | None = Field( - default=None, alias="transferExpensesAsBillFlag" - ) - expense_format: Literal["Default", "Condensed"] | None = Field( - default=None, alias="expenseFormat" - ) - suppress_memo_flag: bool | None = Field(default=None, alias="suppressMemoFlag") - sync_payment_info_flag: bool | None = Field( - default=None, alias="syncPaymentInfoFlag" - ) - sync_wise_pay_payment_info_flag: bool | None = Field( - default=None, alias="syncWisePayPaymentInfoFlag" - ) - wise_pay_lab_flag: bool | None = Field(default=None, alias="wisePayLabFlag") - include_sales_tax_flag: bool | None = Field( - default=None, alias="includeSalesTaxFlag" - ) - enable_tax_groups_flag: bool | None = Field( - default=None, alias="enableTaxGroupsFlag" - ) - zero_dollar_tax_amounts_flag: bool | None = Field( - default=None, alias="zeroDollarTaxAmountsFlag" - ) - include_items_flag: bool | None = Field(default=None, alias="includeItemsFlag") - inventory_soh_flag: bool | None = Field(default=None, alias="inventorySOHFlag") - send_component_amount_flag: bool | None = Field( - default=None, alias="sendComponentAmountFlag" - ) - send_uom_flag: bool | None = Field(default=None, alias="sendUomFlag") - include_cogs_entries_flag: bool | None = Field( - default=None, alias="includeCogsEntriesFlag" - ) - include_cogs_drop_ship_flag: bool | None = Field( - default=None, alias="includeCogsDropShipFlag" - ) + accounting_package: Annotated[AccountingPackageReference | None, Field(alias="accountingPackage")] = None + direct_transfer_flag: Annotated[bool | None, Field(alias="directTransferFlag")] = None + enable_tax_groups_flag: Annotated[bool | None, Field(alias="enableTaxGroupsFlag")] = None + expense_format: Annotated[Literal["Default", "Condensed"] | None, Field(alias="expenseFormat")] = None + id: int | None = None + include_cogs_drop_ship_flag: Annotated[bool | None, Field(alias="includeCogsDropShipFlag")] = None + include_cogs_entries_flag: Annotated[bool | None, Field(alias="includeCogsEntriesFlag")] = None + include_expenses_flag: Annotated[bool | None, Field(alias="includeExpensesFlag")] = None + include_invoices_flag: Annotated[bool | None, Field(alias="includeInvoicesFlag")] = None + include_items_flag: Annotated[bool | None, Field(alias="includeItemsFlag")] = None + include_sales_tax_flag: Annotated[bool | None, Field(alias="includeSalesTaxFlag")] = None + inventory_soh_flag: Annotated[bool | None, Field(alias="inventorySOHFlag")] = None + invoice_format: Annotated[Literal["Default", "Condensed", "Detailed"] | None, Field(alias="invoiceFormat")] = None + send_component_amount_flag: Annotated[bool | None, Field(alias="sendComponentAmountFlag")] = None + send_uom_flag: Annotated[bool | None, Field(alias="sendUomFlag")] = None + suppress_memo_flag: Annotated[bool | None, Field(alias="suppressMemoFlag")] = None + sync_payment_info_flag: Annotated[bool | None, Field(alias="syncPaymentInfoFlag")] = None + transfer_expenses_as_bill_flag: Annotated[bool | None, Field(alias="transferExpensesAsBillFlag")] = None + zero_dollar_tax_amounts_flag: Annotated[bool | None, Field(alias="zeroDollarTaxAmountsFlag")] = None class ActivityReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ActivityStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 30; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - spawn_followup_flag: bool | None = Field(default=None, alias="spawnFollowupFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + spawn_followup_flag: Annotated[bool | None, Field(alias="spawnFollowupFlag")] = None class ActivityStatusInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ActivityStatusReference(ActivityReference): @@ -122,18 +92,18 @@ class ActivityStatusReference(ActivityReference): class ActivityType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + email_flag: Annotated[bool | None, Field(alias="emailFlag")] = None + history_flag: Annotated[bool | None, Field(alias="historyFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + memo_flag: Annotated[bool | None, Field(alias="memoFlag")] = None name: str """ Max length: 50; """ points: int | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - email_flag: bool | None = Field(default=None, alias="emailFlag") - memo_flag: bool | None = Field(default=None, alias="memoFlag") - history_flag: bool | None = Field(default=None, alias="historyFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ActivityTypeReference(ActivityReference): @@ -141,27 +111,27 @@ class ActivityTypeReference(ActivityReference): class AddressFormat(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_countries: Annotated[bool | None, Field(alias="addAllCountries")] = None + country_ids: Annotated[list[int] | None, Field(alias="countryIds")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + format: str + """ + Max length: 250; + """ id: int | None = None name: str """ Max length: 50; """ - format: str - """ - Max length: 250; - """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - country_ids: list[int] | None = Field(default=None, alias="countryIds") - add_all_countries: bool | None = Field(default=None, alias="addAllCountries") - remove_all_countries: bool | None = Field(default=None, alias="removeAllCountries") - info: dict[str, str] | None = Field(default=None, alias="_info") + remove_all_countries: Annotated[bool | None, Field(alias="removeAllCountries")] = None class AddressFormatInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class AddressFormatReference(ActivityReference): @@ -177,6 +147,10 @@ class AdjustmentReference(ActivityReference): class AdjustmentType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + audit_trail_flag: Annotated[bool | None, Field(alias="auditTrailFlag")] = None + created_by: Annotated[str | None, Field(alias="createdBy")] = None + date_created: Annotated[datetime | None, Field(alias="dateCreated")] = None id: int | None = None identifier: str """ @@ -186,10 +160,6 @@ class AdjustmentType(ConnectWiseModel): """ Max length: 100; """ - audit_trail_flag: bool | None = Field(default=None, alias="auditTrailFlag") - date_created: datetime | None = Field(default=None, alias="dateCreated") - created_by: str | None = Field(default=None, alias="createdBy") - info: dict[str, str] | None = Field(default=None, alias="_info") class AdjustmentTypeInfo(ActivityReference): @@ -197,91 +167,48 @@ class AdjustmentTypeInfo(ActivityReference): class AdjustmentTypeReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None identifier: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class AgreementApplicationAviablePer(ConnectWiseModel): - id: int | None = None - tag: str | None = None - name: str | None = None - - -class AgreementApplicationBillingCycle(AgreementApplicationAviablePer): - pass - - -class AgreementApplicationLimit(AgreementApplicationAviablePer): - pass - - -class AgreementApplicationUnit(AgreementApplicationAviablePer): - pass class AgreementBatchSetup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + days_in_advance: Annotated[int, Field(alias="daysInAdvance")] id: int | None = None - next_run_date: datetime = Field(..., alias="nextRunDate") - days_in_advance: int = Field(..., alias="daysInAdvance") - info: dict[str, str] | None = Field(default=None, alias="_info") + next_run_date: Annotated[datetime, Field(alias="nextRunDate")] class AgreementBillingInfo(ConnectWiseModel): - agreement_name: str | None = Field(default=None, alias="agreementName") - agreement_type: str | None = Field(default=None, alias="agreementType") - agreement_amount: float | None = Field(default=None, alias="agreementAmount") - agreement_rec_id: int | None = Field(default=None, alias="agreementRecId") - parent_rec_id: int | None = Field(default=None, alias="parentRecId") - - -class AgreementRecap(ConnectWiseModel): - id: int | None = None - adjustment_amount: float | None = Field(default=None, alias="adjustmentAmount") - agreement_status: str | None = Field(default=None, alias="agreementStatus") - name: str | None = None - available_amount: float | None = Field(default=None, alias="availableAmount") - company_name: str | None = Field(default=None, alias="companyName") - is_unlimited: str | None = Field(default=None, alias="isUnlimited") - last_invoice_amount: str | None = Field(default=None, alias="lastInvoiceAmount") - last_invoice_date: str | None = Field(default=None, alias="lastInvoiceDate") - last_invoice_number: str | None = Field(default=None, alias="lastInvoiceNumber") - next_invoice_amount: float | None = Field(default=None, alias="nextInvoiceAmount") - next_invoice_date: str | None = Field(default=None, alias="nextInvoiceDate") - overrun_amount: float | None = Field(default=None, alias="overrunAmount") - remaining_amount: float | None = Field(default=None, alias="remainingAmount") - starting_amount: float | None = Field(default=None, alias="startingAmount") - unbilled_overage_amount: float | None = Field( - default=None, alias="unbilledOverageAmount" - ) - unbilled_periods: int | None = Field(default=None, alias="unbilledPeriods") - used_amount: float | None = Field(default=None, alias="usedAmount") + agreement_amount: Annotated[float | None, Field(alias="agreementAmount")] = None + agreement_name: Annotated[str | None, Field(alias="agreementName")] = None + agreement_rec_id: Annotated[int | None, Field(alias="agreementRecId")] = None + agreement_type: Annotated[str | None, Field(alias="agreementType")] = None + parent_rec_id: Annotated[int | None, Field(alias="parentRecId")] = None class AgreementReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None type: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class AgreementRevenueReference(ConnectWiseModel): - id: int | None = None - revenue: float | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None cost: float | None = None + id: int | None = None margin: float | None = None percentage: float | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + revenue: float | None = None class AgreementTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + application_units: Annotated[Literal["Amount", "Hours", "Incidents"] | None, Field(alias="applicationUnits")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - application_units: Literal["Amount", "Hours", "Incidents"] | None = Field( - default=None, alias="applicationUnits" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class AgreementTypeReference(ActivityReference): @@ -289,41 +216,66 @@ class AgreementTypeReference(ActivityReference): class AllowedFileType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + file_type: Annotated[str, Field(alias="fileType")] id: int | None = None - file_type: str = Field(..., alias="fileType") - size_limit: int | None = Field(default=None, alias="sizeLimit") - info: dict[str, str] | None = Field(default=None, alias="_info") + size_limit: Annotated[int | None, Field(alias="sizeLimit")] = None class AllowedOrigin(ConnectWiseModel): - id: int | None = None - origin: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + description: str """ Max length: 2000; """ - description: str + id: int | None = None + last_update_utc: Annotated[datetime | None, Field(alias="lastUpdateUtc")] = None + origin: str """ Max length: 2000; """ - last_update_utc: datetime | None = Field(default=None, alias="lastUpdateUtc") - updated_by: str | None = Field(default=None, alias="updatedBy") - info: dict[str, str] | None = Field(default=None, alias="_info") + updated_by: Annotated[str | None, Field(alias="updatedBy")] = None class AuditTrailEntry(ConnectWiseModel): + audit_source: Annotated[str | None, Field(alias="auditSource")] = None + audit_sub_type: Annotated[str | None, Field(alias="auditSubType")] = None + audit_type: Annotated[str | None, Field(alias="auditType")] = None + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None + entered_date: Annotated[str | None, Field(alias="enteredDate")] = None text: str | None = None - entered_date: str | None = Field(default=None, alias="enteredDate") - entered_by: str | None = Field(default=None, alias="enteredBy") - audit_type: str | None = Field(default=None, alias="auditType") - audit_sub_type: str | None = Field(default=None, alias="auditSubType") - audit_source: str | None = Field(default=None, alias="auditSource") + + +class AuditTrailEntryGetRequest(ConnectWiseModel): + device_identifier: Annotated[str | None, Field(alias="deviceIdentifier")] = None + id: int | None = None + type: Literal[ + "None", + "Ticket", + "Contact", + "Company", + "Opportunity", + "Time", + "Activity", + "ProductCatalog", + "ProjectTicket", + "Purchasing", + "Configuration", + "Schedule", + "Agreement", + "AgreementAddition", + "Project", + "Invoice", + "PurchaseOrder", + "Expense", + ] | None = None class AuthAnvil(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - server_location_url: str = Field(..., alias="serverLocationUrl") - site_id: int = Field(..., alias="siteId") - info: dict[str, str] | None = Field(default=None, alias="_info") + server_location_url: Annotated[str, Field(alias="serverLocationUrl")] + site_id: Annotated[int, Field(alias="siteId")] class AutomateScriptReference(ActivityReference): @@ -331,6 +283,12 @@ class AutomateScriptReference(ActivityReference): class BillingCycle(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + billing_options: Annotated[ + Literal["BiMonthly", "BiWeekly", "Monthly", "NotRecurring", "Quarterly", "SemiAnnual", "Weekly", "Yearly"], + Field(alias="billingOptions"), + ] + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None identifier: str """ @@ -340,18 +298,6 @@ class BillingCycle(ConnectWiseModel): """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - billing_options: Literal[ - "BiMonthly", - "BiWeekly", - "Monthly", - "NotRecurring", - "Quarterly", - "SemiAnnual", - "Weekly", - "Yearly", - ] = Field(..., alias="billingOptions") - info: dict[str, str] | None = Field(default=None, alias="_info") class BillingCycleInfo(AddressFormatInfo): @@ -371,25 +317,25 @@ class BillingSetupReference(ActivityReference): class BillingStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 30; """ - sort_order: int | None = Field(default=None, alias="sortOrder") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - sent_flag: bool | None = Field(default=None, alias="sentFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + sent_flag: Annotated[bool | None, Field(alias="sentFlag")] = None + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class BillingStatusInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - sort_order: int | None = Field(default=None, alias="sortOrder") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class BillingStatusReference(ActivityReference): @@ -397,18 +343,18 @@ class BillingStatusReference(ActivityReference): class BillingTerm(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + due_days: Annotated[int, Field(alias="dueDays")] id: int | None = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - due_days: int = Field(..., alias="dueDays") - terms_xref: str | None = Field(default=None, alias="termsXref") + terms_xref: Annotated[str | None, Field(alias="termsXref")] = None """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class BillingTermInfo(ActivityReference): @@ -428,10 +374,10 @@ class BoardCopy(ConnectWiseModel): class BoardExcludedMember(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board_id: Annotated[int | None, Field(alias="boardId")] = None id: int | None = None - member_id: int | None = Field(default=None, alias="memberId") - board_id: int | None = Field(default=None, alias="boardId") - info: dict[str, str] | None = Field(default=None, alias="_info") + member_id: Annotated[int | None, Field(alias="memberId")] = None class BoardReference(ActivityReference): @@ -439,39 +385,35 @@ class BoardReference(ActivityReference): class BoardStatusInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - sort_order: int | None = Field(default=None, alias="sortOrder") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class BoardSubType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_types_flag: Annotated[bool | None, Field(alias="addAllTypesFlag")] = None + board: BoardReference | None = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - type_association_ids: list[int] | None = Field( - default=None, alias="typeAssociationIds" - ) - add_all_types_flag: bool | None = Field(default=None, alias="addAllTypesFlag") - remove_all_types_flag: bool | None = Field(default=None, alias="removeAllTypesFlag") - board: BoardReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + remove_all_types_flag: Annotated[bool | None, Field(alias="removeAllTypesFlag")] = None + type_association_ids: Annotated[list[int] | None, Field(alias="typeAssociationIds")] = None class BoardSubTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - type_association_ids: list[int] | None = Field( - default=None, alias="typeAssociationIds" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + type_association_ids: Annotated[list[int] | None, Field(alias="typeAssociationIds")] = None class BoardTeamInfo(ActivityReference): @@ -479,11 +421,11 @@ class BoardTeamInfo(ActivityReference): class BoardTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - board: BoardReference | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class CalendarInfo(ActivityReference): @@ -495,40 +437,38 @@ class CalendarReference(ActivityReference): class CalendarSetupReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class CallbackEntry(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None description: str | None = None """ Max length: 100; """ - url: str | None = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + is_self_suppressed_flag: Annotated[bool | None, Field(alias="isSelfSuppressedFlag")] = None + is_soap_callback_flag: Annotated[bool | None, Field(alias="isSoapCallbackFlag")] = None + level: str | None = None """ Required Reference """ - object_id: int | None = Field(default=None, alias="objectId") + member_id: Annotated[int | None, Field(alias="memberId")] = None + object_id: Annotated[int | None, Field(alias="objectId")] = None """ Required Reference """ + payload_version: Annotated[str | None, Field(alias="payloadVersion")] = None type: str | None = None """ Required Reference """ - level: str | None = None + url: str | None = None """ Required Reference """ - member_id: int | None = Field(default=None, alias="memberId") - payload_version: str | None = Field(default=None, alias="payloadVersion") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - is_soap_callback_flag: bool | None = Field(default=None, alias="isSoapCallbackFlag") - is_self_suppressed_flag: bool | None = Field( - default=None, alias="isSelfSuppressedFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class CampaignReference(ActivityReference): @@ -536,14 +476,14 @@ class CampaignReference(ActivityReference): class CampaignStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 100; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class CampaignStatusReference(ActivityReference): @@ -555,13 +495,13 @@ class CampaignSubTypeReference(ActivityReference): class CampaignType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str """ Max length: 100; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class CampaignTypeInfo(ActivityReference): @@ -573,64 +513,62 @@ class CampaignTypeReference(ActivityReference): class CatalogItemInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + billable_option: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billableOption") + ] = None + cost: float | None = None + customer_description: Annotated[str | None, Field(alias="customerDescription")] = None + description: str | None = None + drop_ship_flag: Annotated[bool | None, Field(alias="dropShipFlag")] = None id: int | None = None identifier: str | None = None - description: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - product_class: Literal[ - "Agreement", "Bundle", "Inventory", "NonInventory", "Service" - ] | None = Field(default=None, alias="productClass") - serialized_cost_flag: bool | None = Field(default=None, alias="serializedCostFlag") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + manufacturer_part_number: Annotated[str | None, Field(alias="manufacturerPartNumber")] = None price: float | None = None - cost: float | None = None - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - drop_ship_flag: bool | None = Field(default=None, alias="dropShipFlag") - special_order_flag: bool | None = Field(default=None, alias="specialOrderFlag") - customer_description: str | None = Field(default=None, alias="customerDescription") - manufacturer_part_number: str | None = Field( - default=None, alias="manufacturerPartNumber" - ) - vendor_sku: str | None = Field(default=None, alias="vendorSku") - billable_option: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billableOption") - info: dict[str, str] | None = Field(default=None, alias="_info") + product_class: Annotated[ + Literal["Agreement", "Bundle", "Inventory", "NonInventory", "Service"] | None, Field(alias="productClass") + ] = None + serialized_cost_flag: Annotated[bool | None, Field(alias="serializedCostFlag")] = None + special_order_flag: Annotated[bool | None, Field(alias="specialOrderFlag")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None + vendor_sku: Annotated[str | None, Field(alias="vendorSku")] = None class CatalogItemReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None identifier: str | None = None name: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class Category(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_locations: Annotated[bool | None, Field(alias="addAllLocations")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - name: str + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_xref: Annotated[str | None, Field(alias="integrationXref")] = None """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - price_level_xref: str | None = Field(default=None, alias="priceLevelXref") + location_ids: Annotated[list[int] | None, Field(alias="locationIds")] = None + name: str """ - Max length: 10; + Max length: 50; """ - integration_xref: str | None = Field(default=None, alias="integrationXref") + price_level_xref: Annotated[str | None, Field(alias="priceLevelXref")] = None """ - Max length: 50; + Max length: 10; """ - location_ids: list[int] | None = Field(default=None, alias="locationIds") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - add_all_locations: bool | None = Field(default=None, alias="addAllLocations") - remove_all_locations: bool | None = Field(default=None, alias="removeAllLocations") - info: dict[str, str] | None = Field(default=None, alias="_info") + remove_all_locations: Annotated[bool | None, Field(alias="removeAllLocations")] = None class CategoryInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class CertificationReference(ActivityReference): @@ -642,13 +580,13 @@ class ChargeCodeReference(ActivityReference): class Classification(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company_flag: Annotated[bool | None, Field(alias="companyFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + employee_flag: Annotated[bool | None, Field(alias="employeeFlag")] = None id: int | None = None - name: str | None = None multiplier: float | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - company_flag: bool | None = Field(default=None, alias="companyFlag") - employee_flag: bool | None = Field(default=None, alias="employeeFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None class ClassificationReference(ActivityReference): @@ -656,68 +594,72 @@ class ClassificationReference(ActivityReference): class ClosedInvoice(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None status: BillingStatusReference | None = None - internal_notes: str | None = Field(default=None, alias="internalNotes") - info: dict[str, str] | None = Field(default=None, alias="_info") class Code(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board_id: Annotated[int | None, Field(alias="boardId")] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + description: str id: int | None = None + location_id: Annotated[int | None, Field(alias="locationId")] = None name: str """ Max length: 50; """ - description: str - board_id: int | None = Field(default=None, alias="boardId") - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - info: dict[str, str] | None = Field(default=None, alias="_info") class CommunicationType(ConnectWiseModel): - id: int | None = None - description: str - phone_flag: bool | None = Field(default=None, alias="phoneFlag") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + android_xref: Annotated[str | None, Field(alias="androidXref")] = None """ - Gets or sets at least one flag is required to be true -- phone, fax, or email. + Max length: 50; """ - fax_flag: bool | None = Field(default=None, alias="faxFlag") + core_entity_communication_type_id: Annotated[str | None, Field(alias="coreEntityCommunicationTypeId")] = None """ - Gets or sets at least one flag is required to be true -- phone, fax, or email. + Core_Entity_Communication_Type_ID required if core_entity_sync_flag is set Max length: 36; """ - email_flag: bool | None = Field(default=None, alias="emailFlag") + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + description: str + email_flag: Annotated[bool | None, Field(alias="emailFlag")] = None """ - Gets or sets at least one flag is required to be true -- phone, fax, or email. + At least one flag is required to be true -- phone, fax, or email """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - exchange_xref: str | None = Field(default=None, alias="exchangeXref") + exchange_xref: Annotated[str | None, Field(alias="exchangeXref")] = None """ Max length: 50; """ - iphone_xref: str | None = Field(default=None, alias="iphoneXref") + fax_flag: Annotated[bool | None, Field(alias="faxFlag")] = None """ - Max length: 50; + At least one flag is required to be true -- phone, fax, or email """ - android_xref: str | None = Field(default=None, alias="androidXref") + google_xref: Annotated[str | None, Field(alias="googleXref")] = None """ Max length: 50; """ - google_xref: str | None = Field(default=None, alias="googleXref") + id: int | None = None + iphone_xref: Annotated[str | None, Field(alias="iphoneXref")] = None """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + phone_flag: Annotated[bool | None, Field(alias="phoneFlag")] = None + """ + At least one flag is required to be true -- phone, fax, or email + """ class CommunicationTypeInfo(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None description: str | None = None - phone_flag: bool | None = Field(default=None, alias="phoneFlag") - fax_flag: bool | None = Field(default=None, alias="faxFlag") - email_flag: bool | None = Field(default=None, alias="emailFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + email_flag: Annotated[bool | None, Field(alias="emailFlag")] = None + fax_flag: Annotated[bool | None, Field(alias="faxFlag")] = None + id: int | None = None + phone_flag: Annotated[bool | None, Field(alias="phoneFlag")] = None class CommunicationTypeReference(ActivityReference): @@ -725,109 +667,71 @@ class CommunicationTypeReference(ActivityReference): class CompanyMerge(ConnectWiseModel): - to_company_id: int = Field(..., alias="toCompanyId") - name: Literal["From", "To"] | None = None - identifier: Literal["From", "To"] | None = None - status: Literal["From", "To"] | None = None - type: Literal["From", "To"] | None = None - primary_address: Literal["From", "To"] | None = Field( - default=None, alias="primaryAddress" - ) - primary_contact: Literal["From", "To"] | None = Field( - default=None, alias="primaryContact" - ) - phone: Literal["From", "To"] | None = None + account_number: Annotated[Literal["From", "To"] | None, Field(alias="accountNumber")] = None + activities: Literal["Discard", "Merge"] | None = None + billing_address: Annotated[Literal["From", "To"] | None, Field(alias="billingAddress")] = None + billing_contact: Annotated[Literal["From", "To"] | None, Field(alias="billingContact")] = None + billing_terms: Annotated[Literal["From", "To"] | None, Field(alias="billingTerms")] = None + contacts: Literal["Discard", "Merge"] | None = None + date_acquired: Annotated[Literal["From", "To"] | None, Field(alias="dateAcquired")] = None + documents: Literal["Discard", "Merge"] | None = None fax: Literal["From", "To"] | None = None - website: Literal["From", "To"] | None = None + identifier: Literal["From", "To"] | None = None market: Literal["From", "To"] | None = None - territory: Literal["From", "To"] | None = None - revenue: Literal["From", "To"] | None = None - revenue_year: Literal["From", "To"] | None = Field( - default=None, alias="revenueYear" - ) - number_of_employees: Literal["From", "To"] | None = Field( - default=None, alias="numberOfEmployees" - ) - sic_code: Literal["From", "To"] | None = Field(default=None, alias="sicCode") - date_acquired: Literal["From", "To"] | None = Field( - default=None, alias="dateAcquired" - ) - time_zone: Literal["From", "To"] | None = Field(default=None, alias="timeZone") - source_list: Literal["From", "To"] | None = Field(default=None, alias="sourceList") - user_defined_field1: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField1" - ) - user_defined_field2: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField2" - ) - user_defined_field3: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField3" - ) - user_defined_field4: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField4" - ) - user_defined_field5: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField5" - ) - user_defined_field6: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField6" - ) - user_defined_field7: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField7" - ) - user_defined_field8: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField8" - ) - user_defined_field9: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField9" - ) - user_defined_field10: Literal["From", "To"] | None = Field( - default=None, alias="userDefinedField10" - ) - billing_address: Literal["From", "To"] | None = Field( - default=None, alias="billingAddress" - ) - billing_contact: Literal["From", "To"] | None = Field( - default=None, alias="billingContact" - ) - tax_code: Literal["From", "To"] | None = Field(default=None, alias="taxCode") - account_number: Literal["From", "To"] | None = Field( - default=None, alias="accountNumber" - ) - billing_terms: Literal["From", "To"] | None = Field( - default=None, alias="billingTerms" - ) + name: Literal["From", "To"] | None = None notes: Literal["Discard", "Merge"] | None = None - sites: Literal["Discard", "Merge"] | None = None - activities: Literal["Discard", "Merge"] | None = None + number_of_employees: Annotated[Literal["From", "To"] | None, Field(alias="numberOfEmployees")] = None opportunities: Literal["Discard", "Merge"] | None = None - services: Literal["Discard", "Merge"] | None = None + phone: Literal["From", "To"] | None = None + primary_address: Annotated[Literal["From", "To"] | None, Field(alias="primaryAddress")] = None + primary_contact: Annotated[Literal["From", "To"] | None, Field(alias="primaryContact")] = None projects: Literal["Discard", "Merge"] | None = None - contacts: Literal["Discard", "Merge"] | None = None - documents: Literal["Discard", "Merge"] | None = None + revenue: Literal["From", "To"] | None = None + revenue_year: Annotated[Literal["From", "To"] | None, Field(alias="revenueYear")] = None + services: Literal["Discard", "Merge"] | None = None + sic_code: Annotated[Literal["From", "To"] | None, Field(alias="sicCode")] = None + sites: Literal["Discard", "Merge"] | None = None + source_list: Annotated[Literal["From", "To"] | None, Field(alias="sourceList")] = None + status: Literal["From", "To"] | None = None + tax_code: Annotated[Literal["From", "To"] | None, Field(alias="taxCode")] = None + territory: Literal["From", "To"] | None = None + time_zone: Annotated[Literal["From", "To"] | None, Field(alias="timeZone")] = None + to_company_id: Annotated[int, Field(alias="toCompanyId")] + type: Literal["From", "To"] | None = None + user_defined_field1: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField1")] = None + user_defined_field10: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField10")] = None + user_defined_field2: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField2")] = None + user_defined_field3: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField3")] = None + user_defined_field4: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField4")] = None + user_defined_field5: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField5")] = None + user_defined_field6: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField6")] = None + user_defined_field7: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField7")] = None + user_defined_field8: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField8")] = None + user_defined_field9: Annotated[Literal["From", "To"] | None, Field(alias="userDefinedField9")] = None + website: Literal["From", "To"] | None = None class CompanyNoteType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None identifier: str | None = None """ Max length: 15; """ + import_flag: Annotated[bool | None, Field(alias="importFlag")] = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - import_flag: bool | None = Field(default=None, alias="importFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanyNoteTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None identifier: str | None = None name: str | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanyReference(CatalogItemReference): @@ -839,26 +743,26 @@ class CompanyStatusReference(ActivityReference): class CompanyType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - vendor_flag: bool | None = Field(default=None, alias="vendorFlag") - service_alert_flag: bool | None = Field(default=None, alias="serviceAlertFlag") - service_alert_message: str | None = Field(default=None, alias="serviceAlertMessage") + service_alert_flag: Annotated[bool | None, Field(alias="serviceAlertFlag")] = None + service_alert_message: Annotated[str | None, Field(alias="serviceAlertMessage")] = None """ Max length: 150; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + vendor_flag: Annotated[bool | None, Field(alias="vendorFlag")] = None class CompanyTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + is_vendor: Annotated[bool | None, Field(alias="isVendor")] = None name: str | None = None - is_vendor: bool | None = Field(default=None, alias="isVendor") - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanyTypeReference(ActivityReference): @@ -866,50 +770,54 @@ class CompanyTypeReference(ActivityReference): class ConfigurationQuestion(ConnectWiseModel): - answer_id: int | None = Field(default=None, alias="answerId") - question_id: int | None = Field(default=None, alias="questionId") - question: str | None = None answer: dict[str, Any] | None = None - sequence_number: float | None = Field(default=None, alias="sequenceNumber") - number_of_decimals: int | None = Field(default=None, alias="numberOfDecimals") - field_type: Literal[ - "TextArea", - "Currency", - "Date", - "Hyperlink", - "IPAddress", - "Checkbox", - "Number", - "Percent", - "Text", - "Password", - ] | None = Field(default=None, alias="fieldType") - required_flag: bool | None = Field(default=None, alias="requiredFlag") + answer_id: Annotated[int | None, Field(alias="answerId")] = None + field_type: Annotated[ + Literal[ + "TextArea", + "Currency", + "Date", + "Hyperlink", + "IPAddress", + "Checkbox", + "Number", + "Percent", + "Text", + "Password", + ] + | None, + Field(alias="fieldType"), + ] = None + number_of_decimals: Annotated[int | None, Field(alias="numberOfDecimals")] = None + question: str | None = None + question_id: Annotated[int | None, Field(alias="questionId")] = None + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + sequence_number: Annotated[float | None, Field(alias="sequenceNumber")] = None class ConfigurationReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + device_identifier: Annotated[str | None, Field(alias="deviceIdentifier")] = None id: int | None = None - device_identifier: str | None = Field(default=None, alias="deviceIdentifier") - info: dict[str, str] | None = Field(default=None, alias="_info") class ConfigurationStatus(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None description: str """ Max length: 50; """ - closed_flag: bool | None = Field(default=None, alias="closedFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None class ConfigurationStatusInfo(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None description: str | None = None - closed_flag: bool | None = Field(default=None, alias="closedFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None class ConfigurationStatusReference(ActivityReference): @@ -917,32 +825,28 @@ class ConfigurationStatusReference(ActivityReference): class ConfigurationType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - system_flag: bool | None = Field(default=None, alias="systemFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class ConfigurationTypeCopy(BoardCopy): - pass + system_flag: Annotated[bool | None, Field(alias="systemFlag")] = None class ConfigurationTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - system_flag: bool | None = Field(default=None, alias="systemFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + system_flag: Annotated[bool | None, Field(alias="systemFlag")] = None class ConfigurationTypeQuestionReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None question: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ConfigurationTypeReference(ActivityReference): @@ -951,103 +855,89 @@ class ConfigurationTypeReference(ActivityReference): class ConnectWiseHostedScreen(ConnectWiseModel): id: int | None = None - screen_id: str | None = Field(default=None, alias="screenId") name: str | None = None + screen_id: Annotated[str | None, Field(alias="screenId")] = None class ConnectWiseHostedSetup(ConnectWiseModel): - id: int | None = None - screen_id: int = Field(..., alias="screenId") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + client_id: Annotated[str | None, Field(alias="clientId")] = None """ - Can be obtained via ConnectWiseHostedApiScreen report. + Only required if not already set Max length: 36; """ + created_by: Annotated[str | None, Field(alias="createdBy")] = None + date_created: Annotated[datetime | None, Field(alias="dateCreated")] = None description: str """ Max length: 50; """ - url: str + disabled_flag: Annotated[bool | None, Field(alias="disabledFlag")] = None + id: int | None = None + location_ids: Annotated[list[int] | None, Field(alias="locationIds")] = None + locations_enabled_flag: Annotated[bool | None, Field(alias="locationsEnabledFlag")] = None + origin: str | None = None """ - Max length: 1024; + Max length: 100; """ - type: Literal["Tab", "Pod", "ToolbarButton"] - client_id: str | None = Field(default=None, alias="clientId") + pod_height: Annotated[int | None, Field(alias="podHeight")] = None + screen_id: Annotated[int, Field(alias="screenId")] """ - Only required if not already set. Max length: 36; + Can be obtained via ConnectWiseHostedApiScreen report """ - origin: str | None = None + toolbar_button_dialog_height: Annotated[int | None, Field(alias="toolbarButtonDialogHeight")] = None + toolbar_button_dialog_width: Annotated[int | None, Field(alias="toolbarButtonDialogWidth")] = None + toolbar_button_icon_document_id: Annotated[int | None, Field(alias="toolbarButtonIconDocumentId")] = None + toolbar_button_text: Annotated[str | None, Field(alias="toolbarButtonText")] = None """ - Max length: 100; + Only required for ToolbarButtons Max length: 50; """ - pod_height: int | None = Field(default=None, alias="podHeight") - toolbar_button_dialog_height: int | None = Field( - default=None, alias="toolbarButtonDialogHeight" - ) - toolbar_button_dialog_width: int | None = Field( - default=None, alias="toolbarButtonDialogWidth" - ) - toolbar_button_text: str | None = Field(default=None, alias="toolbarButtonText") + toolbar_button_tool_tip: Annotated[str | None, Field(alias="toolbarButtonToolTip")] = None """ - Only required for ToolbarButtons. Max length: 50; + Max length: 50; """ - toolbar_button_tool_tip: str | None = Field( - default=None, alias="toolbarButtonToolTip" - ) + type: Literal["Tab", "Pod", "ToolbarButton"] + url: str """ - Max length: 50; + Max length: 1024; """ - toolbar_button_icon_document_id: int | None = Field( - default=None, alias="toolbarButtonIconDocumentId" - ) - disabled_flag: bool | None = Field(default=None, alias="disabledFlag") - location_ids: list[int] | None = Field(default=None, alias="locationIds") - locations_enabled_flag: bool | None = Field( - default=None, alias="locationsEnabledFlag" - ) - created_by: str | None = Field(default=None, alias="createdBy") - date_created: str | None = Field(default=None, alias="dateCreated") - info: dict[str, str] | None = Field(default=None, alias="_info") class ContactCommunication(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + communication_type: Annotated[Literal["Email", "Fax", "Phone"] | None, Field(alias="communicationType")] = None + contact_id: Annotated[int | None, Field(alias="contactId")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + domain: str | None = None + extension: str | None = None + """ + Max length: 15; + """ id: int | None = None - contact_id: int | None = Field(default=None, alias="contactId") + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None type: CommunicationTypeReference | None = None value: str """ Max length: 250; """ - extension: str | None = None - """ - Max length: 15; - """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - communication_type: Literal["Email", "Fax", "Phone"] | None = Field( - default=None, alias="communicationType" - ) - domain: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ContactCommunicationItem(ConnectWiseModel): + communication_type: Annotated[Literal["Email", "Fax", "Phone"] | None, Field(alias="communicationType")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + domain: str | None = None + extension: str | None = None id: int | None = None type: CommunicationTypeReference | None = None value: str | None = None - extension: str | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - domain: str | None = None - communication_type: Literal["Email", "Fax", "Phone"] | None = Field( - default=None, alias="communicationType" - ) class ContactDepartment(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str """ Max length: 30; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ContactDepartmentInfo(ActivityReference): @@ -1063,50 +953,50 @@ class ContactReference(ActivityReference): class ContactRelationship(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ContactTrack(ConnectWiseModel): - id: int | None = None - track_id: int | None = Field(default=None, alias="trackId") - name: str | None = None - start_date: str | None = Field(default=None, alias="startDate") - end_date: str | None = Field(default=None, alias="endDate") - action_taken: int | None = Field(default=None, alias="actionTaken") - action_remaining: int | None = Field(default=None, alias="actionRemaining") - started_by: str | None = Field(default=None, alias="startedBy") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + action_remaining: Annotated[int | None, Field(alias="actionRemaining")] = None + action_taken: Annotated[int | None, Field(alias="actionTaken")] = None company: CompanyReference | None = None contact: ContactReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + end_date: Annotated[datetime | None, Field(alias="endDate")] = None + id: int | None = None + name: str | None = None + start_date: Annotated[datetime | None, Field(alias="startDate")] = None + started_by: Annotated[str | None, Field(alias="startedBy")] = None + track_id: Annotated[int | None, Field(alias="trackId")] = None class ContactType(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None description: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - service_alert_flag: bool | None = Field(default=None, alias="serviceAlertFlag") - service_alert_message: str | None = Field(default=None, alias="serviceAlertMessage") + id: int | None = None + service_alert_flag: Annotated[bool | None, Field(alias="serviceAlertFlag")] = None + service_alert_message: Annotated[str | None, Field(alias="serviceAlertMessage")] = None """ Max length: 150; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ContactTypeInfo(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None description: str | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - service_alert_flag: bool | None = Field(default=None, alias="serviceAlertFlag") - service_alert_message: str | None = Field(default=None, alias="serviceAlertMessage") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + service_alert_flag: Annotated[bool | None, Field(alias="serviceAlertFlag")] = None + service_alert_message: Annotated[str | None, Field(alias="serviceAlertMessage")] = None class ContactTypeReference(ActivityReference): @@ -1127,17 +1017,15 @@ class Count(ConnectWiseModel): class CountryInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + city_caption: Annotated[str | None, Field(alias="cityCaption")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + dialing_prefix: Annotated[str | None, Field(alias="dialingPrefix")] = None id: int | None = None + localization_caption_one: Annotated[str | None, Field(alias="localizationCaptionOne")] = None name: str | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - city_caption: str | None = Field(default=None, alias="cityCaption") - state_caption: str | None = Field(default=None, alias="stateCaption") - zip_caption: str | None = Field(default=None, alias="zipCaption") - dialing_prefix: str | None = Field(default=None, alias="dialingPrefix") - localization_caption_one: str | None = Field( - default=None, alias="localizationCaptionOne" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + state_caption: Annotated[str | None, Field(alias="stateCaption")] = None + zip_caption: Annotated[str | None, Field(alias="zipCaption")] = None class CountryReference(CatalogItemReference): @@ -1145,31 +1033,29 @@ class CountryReference(CatalogItemReference): class CreateAccountingBatchRequest(ConnectWiseModel): - id: int | None = None - batch_identifier: str | None = Field(default=None, alias="batchIdentifier") + batch_identifier: Annotated[str | None, Field(alias="batchIdentifier")] = None """ Max length: 50; """ - gl_interface_identifier: str | None = Field( - default=None, alias="glInterfaceIdentifier" - ) - export_invoices_flag: bool | None = Field(default=None, alias="exportInvoicesFlag") + export_expenses_flag: Annotated[bool | None, Field(alias="exportExpensesFlag")] = None """ - Batch must export Invoices, Expenses or Products. + Batch must export Invoices, Expenses or Products """ - export_expenses_flag: bool | None = Field(default=None, alias="exportExpensesFlag") + export_invoices_flag: Annotated[bool | None, Field(alias="exportInvoicesFlag")] = None """ - Batch must export Invoices, Expenses or Products. + Batch must export Invoices, Expenses or Products """ - export_products_flag: bool | None = Field(default=None, alias="exportProductsFlag") + export_products_flag: Annotated[bool | None, Field(alias="exportProductsFlag")] = None """ - Batch must export Invoices, Expenses or Products. + Batch must export Invoices, Expenses or Products """ - processed_record_ids: list[int] = Field(..., alias="processedRecordIds") + gl_interface_identifier: Annotated[str | None, Field(alias="glInterfaceIdentifier")] = None + id: int | None = None + processed_record_ids: Annotated[list[int], Field(alias="processedRecordIds")] """ - GL Entry RecIDs. + GL Entry RecIDs """ - summarize_expenses: bool | None = Field(default=None, alias="summarizeExpenses") + summarize_expenses: Annotated[bool | None, Field(alias="summarizeExpenses")] = None class CurrencyCode(ActivityReference): @@ -1185,26 +1071,26 @@ class CurrencyInfo(ActivityReference): class CurrencyReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + currency_code: Annotated[str | None, Field(alias="currencyCode")] = None + currency_identifier: Annotated[str | None, Field(alias="currencyIdentifier")] = None + decimal_separator: Annotated[str | None, Field(alias="decimalSeparator")] = None + display_id_flag: Annotated[bool | None, Field(alias="displayIdFlag")] = None + display_symbol_flag: Annotated[bool | None, Field(alias="displaySymbolFlag")] = None id: int | None = None - symbol: str | None = None - currency_code: str | None = Field(default=None, alias="currencyCode") - decimal_separator: str | None = Field(default=None, alias="decimalSeparator") - number_of_decimals: int | None = Field(default=None, alias="numberOfDecimals") - thousands_separator: str | None = Field(default=None, alias="thousandsSeparator") - negative_parentheses_flag: bool | None = Field( - default=None, alias="negativeParenthesesFlag" - ) - display_symbol_flag: bool | None = Field(default=None, alias="displaySymbolFlag") - currency_identifier: str | None = Field(default=None, alias="currencyIdentifier") - display_id_flag: bool | None = Field(default=None, alias="displayIdFlag") - right_align: bool | None = Field(default=None, alias="rightAlign") name: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + negative_parentheses_flag: Annotated[bool | None, Field(alias="negativeParenthesesFlag")] = None + number_of_decimals: Annotated[int | None, Field(alias="numberOfDecimals")] = None + right_align: Annotated[bool | None, Field(alias="rightAlign")] = None + symbol: str | None = None + thousands_separator: Annotated[str | None, Field(alias="thousandsSeparator")] = None class CustomFieldValue(ConnectWiseModel): - id: int | None = None caption: str | None = None + entry_method: Annotated[Literal["Date", "EntryField", "List", "Option"] | None, Field(alias="entryMethod")] = None + id: int | None = None + number_of_decimals: Annotated[int | None, Field(alias="numberOfDecimals")] = None type: Literal[ "TextArea", "Button", @@ -1218,207 +1104,168 @@ class CustomFieldValue(ConnectWiseModel): "Text", "Password", ] | None = None - entry_method: Literal["Date", "EntryField", "List", "Option"] | None = Field( - default=None, alias="entryMethod" - ) - number_of_decimals: int | None = Field(default=None, alias="numberOfDecimals") - value: str | bool | int | None = None + value: dict[str, Any] | None = None class CustomReport(ConnectWiseModel): - id: int | None = None - report_link: str = Field(..., alias="reportLink") - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_flag: Annotated[bool | None, Field(alias="agreementFlag")] = None + agreement_override: Annotated[str | None, Field(alias="agreementOverride")] = None + agreement_param_id: Annotated[int | None, Field(alias="agreementParamId")] = None """ - Max length: 100; + Parameter unique identifier for the Custom Report's Agreement parameter """ - module: Literal[ - "Companies", - "Finance", - "Marketing", - "Procurement", - "Project", - "Sales", - "ServiceDesk", - "TimeExpense", - ] + agreement_type_flag: Annotated[bool | None, Field(alias="agreementTypeFlag")] = None + agreement_type_override: Annotated[str | None, Field(alias="agreementTypeOverride")] = None + agreement_type_param_id: Annotated[int | None, Field(alias="agreementTypeParamId")] = None """ - The Module Name. + Parameter unique identifier for the Custom Report's Agreement Type parameter """ - description: str + company_flag: Annotated[bool | None, Field(alias="companyFlag")] = None + company_override: Annotated[str | None, Field(alias="companyOverride")] = None + company_param_id: Annotated[int | None, Field(alias="companyParamId")] = None """ - Max length: 150; + Parameter unique identifier for the Custom Report's Company parameter """ - generated_flag: bool | None = Field(default=None, alias="generatedFlag") - parameter_prefix: str | None = Field(default=None, alias="parameterPrefix") + department_default_flag: Annotated[bool | None, Field(alias="departmentDefaultFlag")] = None + department_flag: Annotated[bool | None, Field(alias="departmentFlag")] = None + department_override: Annotated[str | None, Field(alias="departmentOverride")] = None + department_param_id: Annotated[int | None, Field(alias="departmentParamId")] = None """ - Max length: 50; + Parameter unique identifier for the Custom Report's Department parameter """ - parameter_separator: str | None = Field(default=None, alias="parameterSeparator") + description: str """ - Max length: 50; + Max length: 150; """ - parameter_name_separator: str | None = Field( - default=None, alias="parameterNameSeparator" - ) + end_date_flag: Annotated[bool | None, Field(alias="endDateFlag")] = None + end_date_override: Annotated[datetime | None, Field(alias="endDateOverride")] = None + end_date_param_id: Annotated[int | None, Field(alias="endDateParamId")] = None """ - Max length: 50; + Parameter unique identifier for the Custom Report's End Date parameter """ - parameter_suffix: str | None = Field(default=None, alias="parameterSuffix") + generated_flag: Annotated[bool | None, Field(alias="generatedFlag")] = None + id: int | None = None + invoice_flag: Annotated[bool | None, Field(alias="invoiceFlag")] = None + invoice_override: Annotated[str | None, Field(alias="invoiceOverride")] = None + invoice_param_id: Annotated[int | None, Field(alias="invoiceParamId")] = None """ - Max length: 50; + Parameter unique identifier for the Custom Report's Invoice Type parameter """ - location_flag: bool | None = Field(default=None, alias="locationFlag") - location_param_id: int | None = Field(default=None, alias="locationParamId") + location_default_flag: Annotated[bool | None, Field(alias="locationDefaultFlag")] = None + location_flag: Annotated[bool | None, Field(alias="locationFlag")] = None + location_override: Annotated[str | None, Field(alias="locationOverride")] = None + location_param_id: Annotated[int | None, Field(alias="locationParamId")] = None """ - Parameter unique identifier for the Custom Report's Location parameter. + Parameter unique identifier for the Custom Report's Location parameter """ - location_default_flag: bool | None = Field( - default=None, alias="locationDefaultFlag" - ) - location_override: str | None = Field(default=None, alias="locationOverride") - department_flag: bool | None = Field(default=None, alias="departmentFlag") - department_param_id: int | None = Field(default=None, alias="departmentParamId") + marketing_campaign_flag: Annotated[bool | None, Field(alias="marketingCampaignFlag")] = None + marketing_campaign_override: Annotated[str | None, Field(alias="marketingCampaignOverride")] = None + marketing_campaign_param_id: Annotated[int | None, Field(alias="marketingCampaignParamId")] = None """ - Parameter unique identifier for the Custom Report's Department parameter. + Parameter unique identifier for the Custom Report's Marketing Campaign parameter """ - department_default_flag: bool | None = Field( - default=None, alias="departmentDefaultFlag" - ) - department_override: str | None = Field(default=None, alias="departmentOverride") - territory_flag: bool | None = Field(default=None, alias="territoryFlag") - territory_param_id: int | None = Field(default=None, alias="territoryParamId") + member_flag: Annotated[bool | None, Field(alias="memberFlag")] = None + member_override: Annotated[str | None, Field(alias="memberOverride")] = None + member_param_id: Annotated[int | None, Field(alias="memberParamId")] = None """ - Parameter unique identifier for the Custom Report's Terriroty parameter. + Parameter unique identifier for the Custom Report's Member parameter """ - territory_default_flag: bool | None = Field( - default=None, alias="territoryDefaultFlag" - ) - territory_override: str | None = Field(default=None, alias="territoryOverride") - company_flag: bool | None = Field(default=None, alias="companyFlag") - company_param_id: int | None = Field(default=None, alias="companyParamId") + module: Literal[ + "Companies", "Finance", "Marketing", "Procurement", "Project", "Sales", "ServiceDesk", "TimeExpense" + ] """ - Parameter unique identifier for the Custom Report's Company parameter. + The Module Name """ - company_override: str | None = Field(default=None, alias="companyOverride") - member_flag: bool | None = Field(default=None, alias="memberFlag") - member_param_id: int | None = Field(default=None, alias="memberParamId") + name: str """ - Parameter unique identifier for the Custom Report's Member parameter. + Max length: 100; """ - member_override: str | None = Field(default=None, alias="memberOverride") - start_date_flag: bool | None = Field(default=None, alias="startDateFlag") - start_date_param_id: int | None = Field(default=None, alias="startDateParamId") + opp_type_flag: Annotated[bool | None, Field(alias="oppTypeFlag")] = None + opp_type_override: Annotated[str | None, Field(alias="oppTypeOverride")] = None + opp_type_param_id: Annotated[int | None, Field(alias="oppTypeParamId")] = None """ - Parameter unique identifier for the Custom Report's Start Date parameter. + Parameter unique identifier for the Custom Report's Opportunity Type parameter """ - start_date_override: str | None = Field(default=None, alias="startDateOverride") - end_date_flag: bool | None = Field(default=None, alias="endDateFlag") - end_date_param_id: int | None = Field(default=None, alias="endDateParamId") + opportunity_flag: Annotated[bool | None, Field(alias="opportunityFlag")] = None + opportunity_override: Annotated[str | None, Field(alias="opportunityOverride")] = None + opportunity_param_id: Annotated[int | None, Field(alias="opportunityParamId")] = None """ - Parameter unique identifier for the Custom Report's End Date parameter. + Parameter unique identifier for the Custom Report's Opportunity parameter """ - end_date_override: str | None = Field(default=None, alias="endDateOverride") - opp_type_flag: bool | None = Field(default=None, alias="oppTypeFlag") - opp_type_param_id: int | None = Field(default=None, alias="oppTypeParamId") + parameter_name_separator: Annotated[str | None, Field(alias="parameterNameSeparator")] = None """ - Parameter unique identifier for the Custom Report's Opportunity Type parameter. + Max length: 50; """ - opp_type_override: str | None = Field(default=None, alias="oppTypeOverride") - opportunity_flag: bool | None = Field(default=None, alias="opportunityFlag") - opportunity_param_id: int | None = Field(default=None, alias="opportunityParamId") + parameter_prefix: Annotated[str | None, Field(alias="parameterPrefix")] = None """ - Parameter unique identifier for the Custom Report's Opportunity parameter. + Max length: 50; """ - opportunity_override: str | None = Field(default=None, alias="opportunityOverride") - marketing_campaign_flag: bool | None = Field( - default=None, alias="marketingCampaignFlag" - ) - marketing_campaign_param_id: int | None = Field( - default=None, alias="marketingCampaignParamId" - ) + parameter_separator: Annotated[str | None, Field(alias="parameterSeparator")] = None """ - Parameter unique identifier for the Custom Report's Marketing Campaign parameter. + Max length: 50; """ - marketing_campaign_override: str | None = Field( - default=None, alias="marketingCampaignOverride" - ) - service_board_flag: bool | None = Field(default=None, alias="serviceBoardFlag") - service_board_param_id: int | None = Field( - default=None, alias="serviceBoardParamId" - ) + parameter_suffix: Annotated[str | None, Field(alias="parameterSuffix")] = None """ - Parameter unique identifier for the Custom Report's Service Board parameter. + Max length: 50; """ - service_board_default_flag: bool | None = Field( - default=None, alias="serviceBoardDefaultFlag" - ) - service_board_override: str | None = Field( - default=None, alias="serviceBoardOverride" - ) - service_type_flag: bool | None = Field(default=None, alias="serviceTypeFlag") - service_type_param_id: int | None = Field(default=None, alias="serviceTypeParamId") + project_flag: Annotated[bool | None, Field(alias="projectFlag")] = None + project_override: Annotated[str | None, Field(alias="projectOverride")] = None + project_param_id: Annotated[int | None, Field(alias="projectParamId")] = None """ - Parameter unique identifier for the Custom Report's Service Type parameter. + Parameter unique identifier for the Custom Report's Project parameter """ - service_type_override: str | None = Field(default=None, alias="serviceTypeOverride") - service_status_flag: bool | None = Field(default=None, alias="serviceStatusFlag") - service_status_param_id: int | None = Field( - default=None, alias="serviceStatusParamId" - ) + project_type_flag: Annotated[bool | None, Field(alias="projectTypeFlag")] = None + project_type_override: Annotated[str | None, Field(alias="projectTypeOverride")] = None + project_type_param_id: Annotated[int | None, Field(alias="projectTypeParamId")] = None """ - Parameter unique identifier for the Custom Report's Service Status parameter. + Parameter unique identifier for the Custom Report's Project Type parameter """ - service_status_override: str | None = Field( - default=None, alias="serviceStatusOverride" - ) - agreement_type_flag: bool | None = Field(default=None, alias="agreementTypeFlag") - agreement_type_param_id: int | None = Field( - default=None, alias="agreementTypeParamId" - ) + report_link: Annotated[str, Field(alias="reportLink")] + service_board_default_flag: Annotated[bool | None, Field(alias="serviceBoardDefaultFlag")] = None + service_board_flag: Annotated[bool | None, Field(alias="serviceBoardFlag")] = None + service_board_override: Annotated[str | None, Field(alias="serviceBoardOverride")] = None + service_board_param_id: Annotated[int | None, Field(alias="serviceBoardParamId")] = None """ - Parameter unique identifier for the Custom Report's Agreement Type parameter. + Parameter unique identifier for the Custom Report's Service Board parameter """ - agreement_type_override: str | None = Field( - default=None, alias="agreementTypeOverride" - ) - agreement_flag: bool | None = Field(default=None, alias="agreementFlag") - agreement_param_id: int | None = Field(default=None, alias="agreementParamId") + service_status_flag: Annotated[bool | None, Field(alias="serviceStatusFlag")] = None + service_status_override: Annotated[str | None, Field(alias="serviceStatusOverride")] = None + service_status_param_id: Annotated[int | None, Field(alias="serviceStatusParamId")] = None """ - Parameter unique identifier for the Custom Report's Agreement parameter. + Parameter unique identifier for the Custom Report's Service Status parameter """ - agreement_override: str | None = Field(default=None, alias="agreementOverride") - project_type_flag: bool | None = Field(default=None, alias="projectTypeFlag") - project_type_param_id: int | None = Field(default=None, alias="projectTypeParamId") + service_type_flag: Annotated[bool | None, Field(alias="serviceTypeFlag")] = None + service_type_override: Annotated[str | None, Field(alias="serviceTypeOverride")] = None + service_type_param_id: Annotated[int | None, Field(alias="serviceTypeParamId")] = None """ - Parameter unique identifier for the Custom Report's Project Type parameter. + Parameter unique identifier for the Custom Report's Service Type parameter """ - project_type_override: str | None = Field(default=None, alias="projectTypeOverride") - project_flag: bool | None = Field(default=None, alias="projectFlag") - project_param_id: int | None = Field(default=None, alias="projectParamId") + start_date_flag: Annotated[bool | None, Field(alias="startDateFlag")] = None + start_date_override: Annotated[datetime | None, Field(alias="startDateOverride")] = None + start_date_param_id: Annotated[int | None, Field(alias="startDateParamId")] = None """ - Parameter unique identifier for the Custom Report's Project parameter. + Parameter unique identifier for the Custom Report's Start Date parameter """ - project_override: str | None = Field(default=None, alias="projectOverride") - work_role_flag: bool | None = Field(default=None, alias="workRoleFlag") - work_role_param_id: int | None = Field(default=None, alias="workRoleParamId") + territory_default_flag: Annotated[bool | None, Field(alias="territoryDefaultFlag")] = None + territory_flag: Annotated[bool | None, Field(alias="territoryFlag")] = None + territory_override: Annotated[str | None, Field(alias="territoryOverride")] = None + territory_param_id: Annotated[int | None, Field(alias="territoryParamId")] = None """ - Parameter unique identifier for the Custom Report's Work Role parameter. + Parameter unique identifier for the Custom Report's Terriroty parameter """ - work_role_override: str | None = Field(default=None, alias="workRoleOverride") - work_type_flag: bool | None = Field(default=None, alias="workTypeFlag") - work_type_param_id: int | None = Field(default=None, alias="workTypeParamId") + work_role_flag: Annotated[bool | None, Field(alias="workRoleFlag")] = None + work_role_override: Annotated[str | None, Field(alias="workRoleOverride")] = None + work_role_param_id: Annotated[int | None, Field(alias="workRoleParamId")] = None """ - Parameter unique identifier for the Custom Report's Work Type parameter. + Parameter unique identifier for the Custom Report's Work Role parameter """ - work_type_override: str | None = Field(default=None, alias="workTypeOverride") - invoice_flag: bool | None = Field(default=None, alias="invoiceFlag") - invoice_param_id: int | None = Field(default=None, alias="invoiceParamId") + work_type_flag: Annotated[bool | None, Field(alias="workTypeFlag")] = None + work_type_override: Annotated[str | None, Field(alias="workTypeOverride")] = None + work_type_param_id: Annotated[int | None, Field(alias="workTypeParamId")] = None """ - Parameter unique identifier for the Custom Report's Invoice Type parameter. + Parameter unique identifier for the Custom Report's Work Type parameter """ - invoice_override: str | None = Field(default=None, alias="invoiceOverride") - info: dict[str, str] | None = Field(default=None, alias="_info") class CustomReportReference(ActivityReference): @@ -1426,45 +1273,38 @@ class CustomReportReference(ActivityReference): class CwTimeZone(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + daylight_savings_flag: Annotated[bool | None, Field(alias="daylightSavingsFlag")] = None + """ + Determined based on system library value for specified timeZone. + Not able to be used in query params at this time + """ + end_date: Annotated[datetime | None, Field(alias="endDate")] = None id: int | None = None name: str | None = None offset: float | None = None """ - The hours offset (+/-). - """ - start_date: str | None = Field(default=None, alias="startDate") - end_date: str | None = Field(default=None, alias="endDate") - daylight_savings_flag: bool | None = Field( - default=None, alias="daylightSavingsFlag" - ) + The hours offset (+/-) """ - Determined based on system library value for specified timeZone. - Not able to be used in query params at this time. - """ - info: dict[str, str] | None = Field(default=None, alias="_info") + start_date: Annotated[datetime | None, Field(alias="startDate")] = None class DeliveryMethod(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + email_flag: Annotated[bool | None, Field(alias="emailFlag")] = None id: int | None = None + integration_active_flag: Annotated[bool | None, Field(alias="integrationActiveFlag")] = None + integration_email_flag: Annotated[bool | None, Field(alias="integrationEmailFlag")] = None + integration_print_flag: Annotated[bool | None, Field(alias="integrationPrintFlag")] = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - email_flag: bool | None = Field(default=None, alias="emailFlag") - integration_email_flag: bool | None = Field( - default=None, alias="integrationEmailFlag" - ) - integration_print_flag: bool | None = Field( - default=None, alias="integrationPrintFlag" - ) - integration_active_flag: bool | None = Field( - default=None, alias="integrationActiveFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class Department(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None identifier: str """ @@ -1474,34 +1314,38 @@ class Department(ConnectWiseModel): """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class DepartmentInfo(ActivityReference): pass -class DirectionalSync(ContactRelationship): - pass - - -class DirectionalSyncInfo(ActivityReference): - pass - - -class DirectionalSyncReference(ActivityReference): - pass - - class DocumentFormData(ConnectWiseModel): file: bytes | None = None - record_id: int | None = Field(default=None, alias="recordId") - record_type: str | None = Field(default=None, alias="recordType") + is_avatar: Annotated[bool | None, Field(alias="isAvatar")] = None + private_flag: Annotated[bool | None, Field(alias="privateFlag")] = None + read_only_flay: Annotated[bool | None, Field(alias="readOnlyFlay")] = None + record_id: Annotated[int | None, Field(alias="recordId")] = None + record_type: Annotated[str | None, Field(alias="recordType")] = None title: str | None = None url: str | None = None - private_flag: bool | None = Field(default=None, alias="privateFlag") - read_only_flay: bool | None = Field(default=None, alias="readOnlyFlay") - is_avatar: bool | None = Field(default=None, alias="isAvatar") + + +class DocumentInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + file_name: Annotated[str | None, Field(alias="fileName")] = None + guid: Annotated[UUID | None, Field(example="00000000-0000-0000-0000-000000000000")] = None + html_template_flag: Annotated[bool | None, Field(alias="htmlTemplateFlag")] = None + id: int | None = None + image_flag: Annotated[bool | None, Field(alias="imageFlag")] = None + link_flag: Annotated[bool | None, Field(alias="linkFlag")] = None + owner: str | None = None + public_flag: Annotated[bool | None, Field(alias="publicFlag")] = None + read_only_flag: Annotated[bool | None, Field(alias="readOnlyFlag")] = None + server_file_name: Annotated[str | None, Field(alias="serverFileName")] = None + size: int | None = None + title: str | None = None + url_flag: Annotated[bool | None, Field(alias="urlFlag")] = None class DocumentReference(ActivityReference): @@ -1509,35 +1353,22 @@ class DocumentReference(ActivityReference): class DocumentSetup(ConnectWiseModel): - id: int | None = None - upload_as_link_flag: bool | None = Field(default=None, alias="uploadAsLinkFlag") - is_public_flag: bool | None = Field(default=None, alias="isPublicFlag") - doc_path: str | None = Field(default=None, alias="docPath") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + doc_path: Annotated[str | None, Field(alias="docPath")] = None """ Max length: 100; """ - template_path: str | None = Field(default=None, alias="templatePath") + id: int | None = None + is_public_flag: Annotated[bool | None, Field(alias="isPublicFlag")] = None + template_output_path: Annotated[str | None, Field(alias="templateOutputPath")] = None """ Max length: 200; """ - template_output_path: str | None = Field(default=None, alias="templateOutputPath") + template_path: Annotated[str | None, Field(alias="templatePath")] = None """ Max length: 200; """ - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class DocumentType(ConnectWiseModel): - id: int | None = None - file_extension: str | None = Field(default=None, alias="fileExtension") - icon: str | None = None - mime_type: str | None = Field(default=None, alias="mimeType") - description: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class DocumentTypeReference(ActivityReference): - pass + upload_as_link_flag: Annotated[bool | None, Field(alias="uploadAsLinkFlag")] = None class EmailConnectorParsingStyleReference(ActivityReference): @@ -1548,11 +1379,8 @@ class EmailConnectorParsingTypeReference(ActivityReference): pass -class EmailConnectorParsingVariableReference(ConnectWiseModel): - id: int | None = None - name: str | None = None - identifier: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") +class EmailConnectorParsingVariableReference(CatalogItemReference): + pass class EmailConnectorReference(ActivityReference): @@ -1560,19 +1388,19 @@ class EmailConnectorReference(ActivityReference): class EmailExclusion(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None description: str """ Max length: 100; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None class EmailOpened(ConnectWiseModel): + campaign_id: Annotated[int | None, Field(alias="campaignId")] = None + contact_id: Annotated[int, Field(alias="contactId")] + date_opened: Annotated[datetime | None, Field(alias="dateOpened")] = None id: int | None = None - campaign_id: int | None = Field(default=None, alias="campaignId") - contact_id: int = Field(..., alias="contactId") - date_opened: datetime | None = Field(default=None, alias="dateOpened") class EmailTemplateReference(ActivityReference): @@ -1580,31 +1408,29 @@ class EmailTemplateReference(ActivityReference): class EmailToken(ConnectWiseModel): + address_flag: Annotated[bool | None, Field(alias="addressFlag")] = None + agreement_flag: Annotated[bool | None, Field(alias="agreementFlag")] = None + company_flag: Annotated[bool | None, Field(alias="companyFlag")] = None + config_flag: Annotated[bool | None, Field(alias="configFlag")] = None + contact_flag: Annotated[bool | None, Field(alias="contactFlag")] = None + description: str | None = None id: int | None = None + invoice_flag: Annotated[bool | None, Field(alias="invoiceFlag")] = None + portal_password_flag: Annotated[bool | None, Field(alias="portalPasswordFlag")] = None + purchase_order_flag: Annotated[bool | None, Field(alias="purchaseOrderFlag")] = None + purchase_order_status_flag: Annotated[bool | None, Field(alias="purchaseOrderStatusFlag")] = None + rma_flag: Annotated[bool | None, Field(alias="rmaFlag")] = None + sales_flag: Annotated[bool | None, Field(alias="salesFlag")] = None + service_flag: Annotated[bool | None, Field(alias="serviceFlag")] = None token: str | None = None - description: str | None = None - address_flag: bool | None = Field(default=None, alias="addressFlag") - agreement_flag: bool | None = Field(default=None, alias="agreementFlag") - company_flag: bool | None = Field(default=None, alias="companyFlag") - config_flag: bool | None = Field(default=None, alias="configFlag") - contact_flag: bool | None = Field(default=None, alias="contactFlag") - invoice_flag: bool | None = Field(default=None, alias="invoiceFlag") - purchase_order_flag: bool | None = Field(default=None, alias="purchaseOrderFlag") - purchase_order_status_flag: bool | None = Field( - default=None, alias="purchaseOrderStatusFlag" - ) - rma_flag: bool | None = Field(default=None, alias="rmaFlag") - sales_flag: bool | None = Field(default=None, alias="salesFlag") - service_flag: bool | None = Field(default=None, alias="serviceFlag") - tracks_flag: bool | None = Field(default=None, alias="tracksFlag") - workflow_flag: bool | None = Field(default=None, alias="workflowFlag") - portal_password_flag: bool | None = Field(default=None, alias="portalPasswordFlag") + tracks_flag: Annotated[bool | None, Field(alias="tracksFlag")] = None + workflow_flag: Annotated[bool | None, Field(alias="workflowFlag")] = None class EntityType(ConnectWiseModel): + code: str | None = None id: int | None = None name: str | None = None - code: str | None = None class EntityTypeInfo(CorporateStructureLevel): @@ -1616,39 +1442,24 @@ class EntityTypeReference(ActivityReference): class ExpenseDetailReference(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None amount: float | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None class ExpenseReportReference(ActivityReference): pass -class ExpenseReportTierUpdate(ConnectWiseModel): - id: int | None = None - approval_type: Literal[ - "DataEntry", - "Tier1Update", - "Tier2Update", - "Billing", - "Service", - "Project", - "MonthlySummary", - "SalesActivity", - "Schedule", - ] | None = Field(default=None, alias="approvalType") - - class ExpenseRevenueReference(AgreementRevenueReference): pass class ExpenseTaxTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - name: str | None = None inactive: bool | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None class ExpenseTaxTypeReference(ActivityReference): @@ -1656,42 +1467,36 @@ class ExpenseTaxTypeReference(ActivityReference): class ExpenseType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + advanced_amount_flag: Annotated[bool | None, Field(alias="advancedAmountFlag")] = None + amount_caption: Annotated[str, Field(alias="amountCaption")] + bill_expenses: Annotated[Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"], Field(alias="billExpenses")] + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - name: str + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_x_ref: Annotated[str | None, Field(alias="integrationXRef")] = None """ - Max length: 30; + Max length: 50; """ - amount_caption: str = Field(..., alias="amountCaption") - reimbursement_rate: float | None = Field(default=None, alias="reimbursementRate") - bill_expenses: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] = Field( - ..., alias="billExpenses" - ) - invoice_markup_option: Literal["Amount", "Mile", "Percent"] = Field( - ..., alias="invoiceMarkupOption" - ) - invoice_markup_amount: float | None = Field( - default=None, alias="invoiceMarkupAmount" - ) - advanced_amount_flag: bool | None = Field(default=None, alias="advancedAmountFlag") - mileage_flag: bool | None = Field(default=None, alias="mileageFlag") - quantity_flag: bool | None = Field(default=None, alias="quantityFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - max_amount: float | None = Field(default=None, alias="maxAmount") - integration_x_ref: str | None = Field(default=None, alias="integrationXRef") + invoice_markup_amount: Annotated[float | None, Field(alias="invoiceMarkupAmount")] = None + invoice_markup_option: Annotated[Literal["Amount", "Mile", "Percent"], Field(alias="invoiceMarkupOption")] + max_amount: Annotated[float | None, Field(alias="maxAmount")] = None + mileage_flag: Annotated[bool | None, Field(alias="mileageFlag")] = None + name: str """ - Max length: 50; + Max length: 30; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + quantity_flag: Annotated[bool | None, Field(alias="quantityFlag")] = None + reimbursement_rate: Annotated[float | None, Field(alias="reimbursementRate")] = None class ExpenseTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + amount_caption: Annotated[str | None, Field(alias="amountCaption")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + mileage_flag: Annotated[bool | None, Field(alias="mileageFlag")] = None name: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - amount_caption: str | None = Field(default=None, alias="amountCaption") - mileage_flag: bool | None = Field(default=None, alias="mileageFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ExpenseTypeReference(ActivityReference): @@ -1699,118 +1504,91 @@ class ExpenseTypeReference(ActivityReference): class Experiment(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + description: str | None = None + experiment_id: Annotated[str | None, Field(alias="experimentId")] = None id: int | None = None - experiment_id: str | None = Field(default=None, alias="experimentId") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + member_inactive_flag: Annotated[bool | None, Field(alias="memberInactiveFlag")] = None name: str | None = None - description: str | None = None properties: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - member_inactive_flag: bool | None = Field(default=None, alias="memberInactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ExportAccountingBatchRequest(ConnectWiseModel): - batch_identifier: str | None = Field(default=None, alias="batchIdentifier") + batch_identifier: Annotated[str | None, Field(alias="batchIdentifier")] = None """ Max length: 50; """ - gl_interface_identifier: str | None = Field( - default=None, alias="glInterfaceIdentifier" - ) - thru_date: datetime | None = Field(default=None, alias="thruDate") - location_id: int | None = Field(default=None, alias="locationId") - summarize_invoices: Literal["Default", "Condensed", "Detailed"] | None = Field( - default=None, alias="summarizeInvoices" - ) - export_invoices_flag: bool | None = Field(default=None, alias="exportInvoicesFlag") + excluded_expense_ids: Annotated[list[int] | None, Field(alias="excludedExpenseIds")] = None + excluded_invoice_ids: Annotated[list[int] | None, Field(alias="excludedInvoiceIds")] = None + excluded_product_ids: Annotated[list[str] | None, Field(alias="excludedProductIds")] = None + export_expenses_flag: Annotated[bool | None, Field(alias="exportExpensesFlag")] = None """ - Batch export must include invoices, expenses, or products (procurement). + Batch export must include invoices, expenses, or products (procurement) """ - included_invoice_ids: list[int] | None = Field( - default=None, alias="includedInvoiceIds" - ) - excluded_invoice_ids: list[int] | None = Field( - default=None, alias="excludedInvoiceIds" - ) - export_expenses_flag: bool | None = Field(default=None, alias="exportExpensesFlag") + export_invoices_flag: Annotated[bool | None, Field(alias="exportInvoicesFlag")] = None """ - Batch export must include invoices, expenses, or products (procurement). + Batch export must include invoices, expenses, or products (procurement) """ - included_expense_ids: list[int] | None = Field( - default=None, alias="includedExpenseIds" - ) - excluded_expense_ids: list[int] | None = Field( - default=None, alias="excludedExpenseIds" - ) - export_payments_flag: bool | None = Field(default=None, alias="exportPaymentsFlag") + export_products_flag: Annotated[bool | None, Field(alias="exportProductsFlag")] = None """ - Batch export must include invoices, expenses, or products (procurement). + Batch export must include invoices, expenses, or products (procurement) """ - included_payment_ids: list[int] | None = Field( - default=None, alias="includedPaymentIds" - ) - export_products_flag: bool | None = Field(default=None, alias="exportProductsFlag") - """ - Batch export must include invoices, expenses, or products (procurement). - """ - included_product_ids: list[str] | None = Field( - default=None, alias="includedProductIds" - ) - excluded_product_ids: list[str] | None = Field( - default=None, alias="excludedProductIds" - ) + gl_interface_identifier: Annotated[str | None, Field(alias="glInterfaceIdentifier")] = None + included_expense_ids: Annotated[list[int] | None, Field(alias="includedExpenseIds")] = None + included_invoice_ids: Annotated[list[int] | None, Field(alias="includedInvoiceIds")] = None + included_product_ids: Annotated[list[str] | None, Field(alias="includedProductIds")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + summarize_invoices: Annotated[ + Literal["Default", "Condensed", "Detailed"] | None, Field(alias="summarizeInvoices") + ] = None + thru_date: Annotated[datetime | None, Field(alias="thruDate")] = None class FileUploadSetting(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + global_file_size_limit: Annotated[int | None, Field(alias="globalFileSizeLimit")] = None id: int | None = None - restrict_file_types_flag: bool = Field(..., alias="restrictFileTypesFlag") - global_file_size_limit: int | None = Field( - default=None, alias="globalFileSizeLimit" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + restrict_file_types_flag: Annotated[bool, Field(alias="restrictFileTypesFlag")] class FilterValues(ConnectWiseModel): - conditions: str | None = None - order_by: str | None = Field(default=None, alias="orderBy") childconditions: str | None = None + conditions: str | None = None customfieldconditions: str | None = None + order_by: Annotated[str | None, Field(alias="orderBy")] = None class FinanceCurrency(ConnectWiseModel): - id: int | None = None - currency_identifier: str = Field(..., alias="currencyIdentifier") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + currency_code: Annotated[CurrencyCodeReference | None, Field(alias="currencyCode")] = None + currency_identifier: Annotated[str, Field(alias="currencyIdentifier")] """ Max length: 10; """ + decimal_separator: Annotated[str | None, Field(alias="decimalSeparator")] = None + """ + Max length: 1; + """ + display_id_flag: Annotated[bool | None, Field(alias="displayIdFlag")] = None + display_symbol_flag: Annotated[bool | None, Field(alias="displaySymbolFlag")] = None + id: int | None = None name: str """ Max length: 50; """ + negative_parentheses_flag: Annotated[bool | None, Field(alias="negativeParenthesesFlag")] = None + number_of_decimals: Annotated[int | None, Field(alias="numberOfDecimals")] = None + report_format: Annotated[str | None, Field(alias="reportFormat")] = None + right_align: Annotated[bool | None, Field(alias="rightAlign")] = None symbol: str | None = None """ Max length: 10; """ - display_id_flag: bool | None = Field(default=None, alias="displayIdFlag") - display_symbol_flag: bool | None = Field(default=None, alias="displaySymbolFlag") - currency_code: CurrencyCodeReference | None = Field( - default=None, alias="currencyCode" - ) - thousands_separator: str | None = Field(default=None, alias="thousandsSeparator") - """ - Max length: 1; - """ - decimal_separator: str | None = Field(default=None, alias="decimalSeparator") + thousands_separator: Annotated[str | None, Field(alias="thousandsSeparator")] = None """ Max length: 1; """ - negative_parentheses_flag: bool | None = Field( - default=None, alias="negativeParenthesesFlag" - ) - right_align: bool | None = Field(default=None, alias="rightAlign") - number_of_decimals: int | None = Field(default=None, alias="numberOfDecimals") - report_format: str | None = Field(default=None, alias="reportFormat") - info: dict[str, str] | None = Field(default=None, alias="_info") class ForecastRevenueReference(AgreementRevenueReference): @@ -1818,171 +1596,154 @@ class ForecastRevenueReference(AgreementRevenueReference): class FormSubmitted(ConnectWiseModel): + campaign_id: Annotated[int | None, Field(alias="campaignId")] = None + contact_id: Annotated[int, Field(alias="contactId")] + date_submitted: Annotated[datetime | None, Field(alias="dateSubmitted")] = None id: int | None = None - campaign_id: int | None = Field(default=None, alias="campaignId") - contact_id: int = Field(..., alias="contactId") - date_submitted: datetime | None = Field(default=None, alias="dateSubmitted") + page_sub_type: Annotated[str | None, Field(alias="pageSubType")] = None + page_type: Annotated[str | None, Field(alias="pageType")] = None + query_string: Annotated[str | None, Field(alias="queryString")] = None + status: str | None = None + topic: str | None = None url: str """ Max length: 2083; """ - query_string: str | None = Field(default=None, alias="queryString") - page_type: str | None = Field(default=None, alias="pageType") - page_sub_type: str | None = Field(default=None, alias="pageSubType") - topic: str | None = None version: str | None = None - status: str | None = None - - -class GenericBoardTeamReference(ConnectWiseModel): - id: int | None = None - name: str | None = None - is_project_team_flag: bool | None = Field(default=None, alias="isProjectTeamFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class GenericIdIdentifierReference(AccountingPackage): - pass - - -class GenericNameIdDTO(AgreementApplicationAviablePer): - pass class GLCaption(ConnectWiseModel): - id: int | None = None - segment1: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + cogs1: str | None = None """ Max length: 255; """ - segment2: str | None = None + cogs10: str | None = None """ Max length: 255; """ - segment3: str | None = None + cogs2: str | None = None """ Max length: 255; """ - segment4: str | None = None + cogs3: str | None = None """ Max length: 255; """ - segment5: str | None = None + cogs4: str | None = None """ Max length: 255; """ - segment6: str | None = None + cogs5: str | None = None """ Max length: 255; """ - segment7: str | None = None + cogs6: str | None = None """ Max length: 255; """ - segment8: str | None = None + cogs7: str | None = None """ Max length: 255; """ - segment9: str | None = None + cogs8: str | None = None """ Max length: 255; """ - segment10: str | None = None + cogs9: str | None = None """ Max length: 255; """ - segment1type: Literal["Account", "Class"] | None = None - segment2type: Literal["Account", "Class"] | None = None - segment3type: Literal["Account", "Class"] | None = None - segment4type: Literal["Account", "Class"] | None = None - segment5type: Literal["Account", "Class"] | None = None - segment6type: Literal["Account", "Class"] | None = None - segment7type: Literal["Account", "Class"] | None = None - segment8type: Literal["Account", "Class"] | None = None - segment9type: Literal["Account", "Class"] | None = None - segment10type: Literal["Account", "Class"] | None = None - cogs1: str | None = None + id: int | None = None + segment1: str | None = None """ Max length: 255; """ - cogs2: str | None = None + segment10: str | None = None """ Max length: 255; """ - cogs3: str | None = None + segment10type: Literal["Account", "Class"] | None = None + segment1type: Literal["Account", "Class"] | None = None + segment2: str | None = None """ Max length: 255; """ - cogs4: str | None = None + segment2type: Literal["Account", "Class"] | None = None + segment3: str | None = None """ Max length: 255; """ - cogs5: str | None = None + segment3type: Literal["Account", "Class"] | None = None + segment4: str | None = None """ Max length: 255; """ - cogs6: str | None = None + segment4type: Literal["Account", "Class"] | None = None + segment5: str | None = None """ Max length: 255; """ - cogs7: str | None = None + segment5type: Literal["Account", "Class"] | None = None + segment6: str | None = None """ Max length: 255; """ - cogs8: str | None = None + segment6type: Literal["Account", "Class"] | None = None + segment7: str | None = None """ Max length: 255; """ - cogs9: str | None = None + segment7type: Literal["Account", "Class"] | None = None + segment8: str | None = None """ Max length: 255; """ - cogs10: str | None = None + segment8type: Literal["Account", "Class"] | None = None + segment9: str | None = None """ Max length: 255; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + segment9type: Literal["Account", "Class"] | None = None class GLExportCustomerTaxLevel(ConnectWiseModel): - tax_rate: float | None = Field(default=None, alias="taxRate") - tax_code_xref: str | None = Field(default=None, alias="taxCodeXref") - agency_xref: str | None = Field(default=None, alias="agencyXref") - tax_level: int | None = Field(default=None, alias="taxLevel") + agency_xref: Annotated[str | None, Field(alias="agencyXref")] = None + tax_code_xref: Annotated[str | None, Field(alias="taxCodeXref")] = None + tax_level: Annotated[int | None, Field(alias="taxLevel")] = None + tax_rate: Annotated[float | None, Field(alias="taxRate")] = None class GLExportExpenseBillDetail(ConnectWiseModel): - id: list[int] | None = None - document_date: str | None = Field(default=None, alias="documentDate") - gl_type_id: str | None = Field(default=None, alias="glTypeId") - memo: str | None = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + billable: bool | None = None company: CompanyReference | None = None - account_number: str | None = Field(default=None, alias="accountNumber") - expense_class: ClassificationReference | None = Field( - default=None, alias="expenseClass" - ) + company_advance: Annotated[bool | None, Field(alias="companyAdvance")] = None currency: CurrencyReference | None = None - total: float | None = None - billable: bool | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + expense_class: Annotated[ClassificationReference | None, Field(alias="expenseClass")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None + id: list[int] | None = None + memo: str | None = None reimbursable: bool | None = None - company_advance: bool | None = Field(default=None, alias="companyAdvance") + total: float | None = None class GLExportInventoryTransferOffset(ConnectWiseModel): + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + description: str | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None id: int | None = None - document_type: str | None = Field(default=None, alias="documentType") - document_date: str | None = Field(default=None, alias="documentDate") - account_number: str | None = Field(default=None, alias="accountNumber") - gl_class: str | None = Field(default=None, alias="glClass") - total: float | None = None memo: str | None = None - description: str | None = None - gl_type_id: str | None = Field(default=None, alias="glTypeId") + total: float | None = None class GLExportPurchaseTransactionTaxLevel(ConnectWiseModel): - tax_code_xref: str | None = Field(default=None, alias="taxCodeXref") - tax_level: int | None = Field(default=None, alias="taxLevel") + tax_code_xref: Annotated[str | None, Field(alias="taxCodeXref")] = None + tax_level: Annotated[int | None, Field(alias="taxLevel")] = None class GLExportSettings(ConnectWiseModel): @@ -1990,52 +1751,61 @@ class GLExportSettings(ConnectWiseModel): class GLExportTransactionDetailTaxLevel(ConnectWiseModel): - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - tax_level: int | None = Field(default=None, alias="taxLevel") + tax_level: Annotated[int | None, Field(alias="taxLevel")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None class GLExportTransactionTaxLevel(ConnectWiseModel): - tax_amount: float | None = Field(default=None, alias="taxAmount") - taxable_amount: float | None = Field(default=None, alias="taxableAmount") - tax_code_xref: str | None = Field(default=None, alias="taxCodeXref") - tax_level: int | None = Field(default=None, alias="taxLevel") + tax_amount: Annotated[float | None, Field(alias="taxAmount")] = None + tax_code_xref: Annotated[str | None, Field(alias="taxCodeXref")] = None + tax_level: Annotated[int | None, Field(alias="taxLevel")] = None + taxable_amount: Annotated[float | None, Field(alias="taxableAmount")] = None -class GoogleEmailSetup(ConnectWiseModel): +class GenericBoardTeamReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - name: str + is_project_team_flag: Annotated[bool | None, Field(alias="isProjectTeamFlag")] = None + name: str | None = None + + +class GenericIdIdentifierReference(AccountingPackage): + pass + + +class GoogleEmailSetup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + client_id: Annotated[str | None, Field(alias="clientId")] = None """ Max length: 200; """ - username: str + email_connector: Annotated[EmailConnectorReference | None, Field(alias="emailConnector")] = None + failed_folder: Annotated[str, Field(alias="failedFolder")] """ - Max length: 100; + Max length: 40; """ - inbox_folder: str = Field(..., alias="inboxFolder") + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + inbox_folder: Annotated[str, Field(alias="inboxFolder")] """ Max length: 40; """ - processed_folder: str = Field(..., alias="processedFolder") + name: str """ - Max length: 40; + Max length: 200; """ - failed_folder: str = Field(..., alias="failedFolder") + private_key: Annotated[str | None, Field(alias="privateKey")] = None """ - Max length: 40; + Max length: 4000; """ - client_id: str | None = Field(default=None, alias="clientId") + processed_folder: Annotated[str, Field(alias="processedFolder")] """ - Max length: 200; + Max length: 40; """ - private_key: str | None = Field(default=None, alias="privateKey") + username: str """ - Max length: 4000; + Max length: 100; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - email_connector: EmailConnectorReference | None = Field( - default=None, alias="emailConnector" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class GoogleEmailSetupReference(ActivityReference): @@ -2043,15 +1813,15 @@ class GoogleEmailSetupReference(ActivityReference): class Group(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str - public_description: str | None = Field(default=None, alias="publicDescription") + public_description: Annotated[str | None, Field(alias="publicDescription")] = None """ Max length: 255; """ - public_flag: bool | None = Field(default=None, alias="publicFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + public_flag: Annotated[bool | None, Field(alias="publicFlag")] = None class GroupInfo(ActivityReference): @@ -2074,25 +1844,36 @@ class HolidayListReference(ActivityReference): pass +class IRestIdentifiedItem(ConnectWiseModel): + id: int | None = None + + class IdCollection(ConnectWiseModel): ids: list[int] | None = None class Imap(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + email_connector: Annotated[EmailConnectorReference | None, Field(alias="emailConnector")] = None + failed_folder: Annotated[str, Field(alias="failedFolder")] """ - Max length: 200; + Max length: 40; """ - imap_name: str = Field(..., alias="imapName") + id: int | None = None + imap_name: Annotated[str, Field(alias="imapName")] """ Max length: 40; """ - processed_name: str = Field(..., alias="processedName") + name: str """ - Max length: 40; + Max length: 200; + """ + password: str | None = None + """ + Max length: 80; """ - failed_folder: str = Field(..., alias="failedFolder") + port: int + processed_name: Annotated[str, Field(alias="processedName")] """ Max length: 40; """ @@ -2100,29 +1881,18 @@ class Imap(ConnectWiseModel): """ Max length: 200; """ - user_name: str = Field(..., alias="userName") - """ - Max length: 80; - """ - password: str | None = None + ssl_flag: Annotated[bool | None, Field(alias="sslFlag")] = None + user_name: Annotated[str, Field(alias="userName")] """ Max length: 80; """ - port: int - ssl_flag: bool | None = Field(default=None, alias="sslFlag") - email_connector: EmailConnectorReference | None = Field( - default=None, alias="emailConnector" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class ImapInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + email_connector: Annotated[EmailConnectorReference | None, Field(alias="emailConnector")] = None id: int | None = None name: str | None = None - email_connector: EmailConnectorReference | None = Field( - default=None, alias="emailConnector" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class ImapSetupReference(ActivityReference): @@ -2130,57 +1900,57 @@ class ImapSetupReference(ActivityReference): class Impact(ConnectWiseModel): - id: int | None = None - name: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None description: str """ Max length: 200; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + name: str | None = None class ImportMassMaintenance(ConnectWiseModel): - deleted_contact_count: int | None = Field(default=None, alias="deletedContactCount") - deleted_company_count: int | None = Field(default=None, alias="deletedCompanyCount") + deleted_company_count: Annotated[int | None, Field(alias="deletedCompanyCount")] = None + deleted_contact_count: Annotated[int | None, Field(alias="deletedContactCount")] = None message: str | None = None success: bool | None = None -class InclusiveRevenueReference(AgreementRevenueReference): - pass - - class InOutType(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None description: str """ Max length: 30; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None class InOutTypeInfo(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None description: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None class InOutTypeReference(ActivityReference): pass +class InclusiveRevenueReference(AgreementRevenueReference): + pass + + class IntegratorLoginReference(ActivityReference): pass class IntegratorTag(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None text: str """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class IntegratorTagCollection(ConnectWiseModel): @@ -2192,666 +1962,443 @@ class InvoiceEmailTemplateInfo(ActivityReference): class InvoiceGroupingReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + description: str | None = None + group_parent_child_additions_flag: Annotated[bool | None, Field(alias="groupParentChildAdditionsFlag")] = None id: int | None = None name: str | None = None - description: str | None = None - show_price_flag: bool | None = Field(default=None, alias="showPriceFlag") - show_sub_items_flag: bool | None = Field(default=None, alias="showSubItemsFlag") - group_parent_child_additions_flag: bool | None = Field( - default=None, alias="groupParentChildAdditionsFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + show_price_flag: Annotated[bool | None, Field(alias="showPriceFlag")] = None + show_sub_items_flag: Annotated[bool | None, Field(alias="showSubItemsFlag")] = None class InvoiceReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + apply_to_type: Annotated[str | None, Field(alias="applyToType")] = None + billing_type: Annotated[str | None, Field(alias="billingType")] = None id: int | None = None identifier: str | None = None - billing_type: str | None = Field(default=None, alias="billingType") - apply_to_type: str | None = Field(default=None, alias="applyToType") - info: dict[str, str] | None = Field(default=None, alias="_info") class InvoiceTemplate(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + adjustment_agr_type_visible_flag: Annotated[bool | None, Field(alias="adjustmentAgrTypeVisibleFlag")] = None + adjustment_amount_caption: Annotated[str | None, Field(alias="adjustmentAmountCaption")] = None + """ + Max length: 50; + """ + adjustment_amount_visible_flag: Annotated[bool | None, Field(alias="adjustmentAmountVisibleFlag")] = None + adjustment_description_caption: Annotated[str | None, Field(alias="adjustmentDescriptionCaption")] = None + """ + Max length: 50; + """ + adjustment_description_visible_flag: Annotated[bool | None, Field(alias="adjustmentDescriptionVisibleFlag")] = None + adjustment_price_caption: Annotated[str | None, Field(alias="adjustmentPriceCaption")] = None + """ + Max length: 50; + """ + adjustment_price_visible_flag: Annotated[bool | None, Field(alias="adjustmentPriceVisibleFlag")] = None + adjustment_quantity_caption: Annotated[str | None, Field(alias="adjustmentQuantityCaption")] = None + """ + Max length: 50; + """ + adjustment_quantity_visible_flag: Annotated[bool | None, Field(alias="adjustmentQuantityVisibleFlag")] = None + adjustment_total_visible_flag: Annotated[bool | None, Field(alias="adjustmentTotalVisibleFlag")] = None + credit_credit_amount_caption: Annotated[str | None, Field(alias="creditCreditAmountCaption")] = None + """ + Max length: 50; + """ + credit_credit_amount_visible_flag: Annotated[bool | None, Field(alias="creditCreditAmountVisibleFlag")] = None + credit_remaining_amount_caption: Annotated[str | None, Field(alias="creditRemainingAmountCaption")] = None + """ + Max length: 50; + """ + credit_remaining_amount_visible_flag: Annotated[bool | None, Field(alias="creditRemainingAmountVisibleFlag")] = None + currency_id_visible_flag: Annotated[bool | None, Field(alias="currencyIdVisibleFlag")] = None + currency_symbol_visible_flag: Annotated[bool | None, Field(alias="currencySymbolVisibleFlag")] = None + expense_detail_agreement_ext_amount_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailAgreementExtAmountVisibleFlag") + ] = None + expense_detail_agreement_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailAgreementVisibleFlag") + ] = None + expense_detail_billable_visible_flag: Annotated[bool | None, Field(alias="expenseDetailBillableVisibleFlag")] = None + expense_detail_contacts_visible_flag: Annotated[bool | None, Field(alias="expenseDetailContactsVisibleFlag")] = None + expense_detail_ext_amount_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailExtAmountVisibleFlag") + ] = None + expense_detail_members_visible_flag: Annotated[bool | None, Field(alias="expenseDetailMembersVisibleFlag")] = None + expense_detail_nonbillable_caption: Annotated[str | None, Field(alias="expenseDetailNonbillableCaption")] = None + """ + Max length: 50; + """ + expense_detail_notes_visible_flag: Annotated[bool | None, Field(alias="expenseDetailNotesVisibleFlag")] = None + expense_detail_pm_phase_visible_flag: Annotated[bool | None, Field(alias="expenseDetailPmPhaseVisibleFlag")] = None + expense_detail_pm_summary_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailPmSummaryVisibleFlag") + ] = None + expense_detail_primary_sort_direction: Annotated[ + str | None, Field(alias="expenseDetailPrimarySortDirection") + ] = None + expense_detail_primary_sort_field: Annotated[str | None, Field(alias="expenseDetailPrimarySortField")] = None + expense_detail_secondary_sort_direction: Annotated[ + str | None, Field(alias="expenseDetailSecondarySortDirection") + ] = None + expense_detail_secondary_sort_field: Annotated[str | None, Field(alias="expenseDetailSecondarySortField")] = None + expense_detail_sr_address_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailSrAddressVisibleFlag") + ] = None + expense_detail_sr_contact_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailSrContactVisibleFlag") + ] = None + expense_detail_sr_ticket_summary_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailSrTicketSummaryVisibleFlag") + ] = None + expense_detail_subtotal_visible_flag: Annotated[bool | None, Field(alias="expenseDetailSubtotalVisibleFlag")] = None + expense_detail_ticket_number_visible_flag: Annotated[ + bool | None, Field(alias="expenseDetailTicketNumberVisibleFlag") + ] = None + expense_detail_visible_flag: Annotated[bool | None, Field(alias="expenseDetailVisibleFlag")] = None + expenses_amount_caption: Annotated[str | None, Field(alias="expensesAmountCaption")] = None + """ + Max length: 50; + """ + expenses_amount_visible_flag: Annotated[bool | None, Field(alias="expensesAmountVisibleFlag")] = None + expenses_collapsed_flag: Annotated[bool | None, Field(alias="expensesCollapsedFlag")] = None + expenses_staff_caption: Annotated[str | None, Field(alias="expensesStaffCaption")] = None + """ + Max length: 50; + """ + expenses_staff_visible_flag: Annotated[bool | None, Field(alias="expensesStaffVisibleFlag")] = None + expenses_total_visible_flag: Annotated[bool | None, Field(alias="expensesTotalVisibleFlag")] = None + expenses_type_caption: Annotated[str | None, Field(alias="expensesTypeCaption")] = None + """ + Max length: 50; + """ + expenses_type_visible_flag: Annotated[bool | None, Field(alias="expensesTypeVisibleFlag")] = None + header_account_caption: Annotated[str | None, Field(alias="headerAccountCaption")] = None + """ + Max length: 50; + """ + header_account_visible_flag: Annotated[bool | None, Field(alias="headerAccountVisibleFlag")] = None + header_address_position: Annotated[ + Literal["Center", "LeftSide", "RightSide"] | None, Field(alias="headerAddressPosition") + ] = None + header_due_date_caption: Annotated[str | None, Field(alias="headerDueDateCaption")] = None + """ + Max length: 50; + """ + header_due_date_visible_flag: Annotated[bool | None, Field(alias="headerDueDateVisibleFlag")] = None + header_hours_based_extended_amount_visible_flag: Annotated[ + bool | None, Field(alias="headerHoursBasedExtendedAmountVisibleFlag") + ] = None + header_logo_position: Annotated[ + Literal["Center", "LeftSide", "RightSide"] | None, Field(alias="headerLogoPosition") + ] = None + header_po_number_caption: Annotated[str | None, Field(alias="headerPoNumberCaption")] = None + """ + Max length: 50; + """ + header_po_number_visible_flag: Annotated[bool | None, Field(alias="headerPoNumberVisibleFlag")] = None + header_reference_caption: Annotated[str | None, Field(alias="headerReferenceCaption")] = None + """ + Max length: 50; + """ + header_reference_visible_flag: Annotated[bool | None, Field(alias="headerReferenceVisibleFlag")] = None + header_ship_to_caption: Annotated[str | None, Field(alias="headerShipToCaption")] = None + """ + Max length: 50; + """ + header_ship_to_visible_flag: Annotated[bool | None, Field(alias="headerShipToVisibleFlag")] = None + header_tax_id_caption: Annotated[str | None, Field(alias="headerTaxIdCaption")] = None + """ + Max length: 50; + """ + header_tax_id_visible_flag: Annotated[bool | None, Field(alias="headerTaxIdVisibleFlag")] = None + header_terms_caption: Annotated[str | None, Field(alias="headerTermsCaption")] = None + """ + Max length: 50; + """ + header_terms_visible_flag: Annotated[bool | None, Field(alias="headerTermsVisibleFlag")] = None + header_title_caption: Annotated[str | None, Field(alias="headerTitleCaption")] = None + """ + Max length: 50; + """ + header_title_font: Annotated[ + Literal["Regular", "RegularBold", "Large", "LargeBold", "ExtraLarge", "ExtraLargeBold"] | None, + Field(alias="headerTitleFont"), + ] = None + header_title_position: Annotated[ + Literal["Center", "LeftSide", "RightSide"] | None, Field(alias="headerTitlePosition") + ] = None + header_title_visible_flag: Annotated[bool | None, Field(alias="headerTitleVisibleFlag")] = None id: int | None = None + invoice_balance_due_caption: Annotated[str | None, Field(alias="invoiceBalanceDueCaption")] = None + """ + Max length: 50; + """ + invoice_balance_due_visible_flag: Annotated[bool | None, Field(alias="invoiceBalanceDueVisibleFlag")] = None + invoice_credit_amount_caption: Annotated[str | None, Field(alias="invoiceCreditAmountCaption")] = None + """ + Max length: 50; + """ + invoice_credit_amount_visible_flag: Annotated[bool | None, Field(alias="invoiceCreditAmountVisibleFlag")] = None + invoice_payment_amount_caption: Annotated[str | None, Field(alias="invoicePaymentAmountCaption")] = None + """ + Max length: 50; + """ + invoice_payment_amount_visible_flag: Annotated[bool | None, Field(alias="invoicePaymentAmountVisibleFlag")] = None + logo_visible_flag: Annotated[bool | None, Field(alias="logoVisibleFlag")] = None + margin_bottom: Annotated[float | None, Field(alias="marginBottom")] = None + margin_left: Annotated[float | None, Field(alias="marginLeft")] = None + margin_right: Annotated[float | None, Field(alias="marginRight")] = None + margin_top: Annotated[float | None, Field(alias="marginTop")] = None name: str """ Max length: 50; """ - margin_left: float | None = Field(default=None, alias="marginLeft") - margin_right: float | None = Field(default=None, alias="marginRight") - margin_top: float | None = Field(default=None, alias="marginTop") - margin_bottom: float | None = Field(default=None, alias="marginBottom") - logo_visible_flag: bool | None = Field(default=None, alias="logoVisibleFlag") - header_logo_position: Literal["Center", "LeftSide", "RightSide"] | None = Field( - default=None, alias="headerLogoPosition" - ) - remit_to_visible_flag: bool | None = Field(default=None, alias="remitToVisibleFlag") - header_address_position: Literal["Center", "LeftSide", "RightSide"] | None = Field( - default=None, alias="headerAddressPosition" - ) - header_title_visible_flag: bool | None = Field( - default=None, alias="headerTitleVisibleFlag" - ) - header_title_caption: str | None = Field(default=None, alias="headerTitleCaption") + other_charges_amount_caption: Annotated[str | None, Field(alias="otherChargesAmountCaption")] = None """ Max length: 50; """ - header_title_position: Literal["Center", "LeftSide", "RightSide"] | None = Field( - default=None, alias="headerTitlePosition" - ) - header_title_font: Literal[ - "Regular", "RegularBold", "Large", "LargeBold", "ExtraLarge", "ExtraLargeBold" - ] | None = Field(default=None, alias="headerTitleFont") - header_terms_visible_flag: bool | None = Field( - default=None, alias="headerTermsVisibleFlag" - ) - header_terms_caption: str | None = Field(default=None, alias="headerTermsCaption") + other_charges_amount_visible_flag: Annotated[bool | None, Field(alias="otherChargesAmountVisibleFlag")] = None + other_charges_collapsed_flag: Annotated[bool | None, Field(alias="otherChargesCollapsedFlag")] = None + other_charges_description_caption: Annotated[str | None, Field(alias="otherChargesDescriptionCaption")] = None """ Max length: 50; """ - header_due_date_visible_flag: bool | None = Field( - default=None, alias="headerDueDateVisibleFlag" - ) - header_due_date_caption: str | None = Field( - default=None, alias="headerDueDateCaption" - ) + other_charges_description_visible_flag: Annotated[ + bool | None, Field(alias="otherChargesDescriptionVisibleFlag") + ] = None + other_charges_display_six_decimals: Annotated[bool | None, Field(alias="otherChargesDisplaySixDecimals")] = None + other_charges_item_id_visible_flag: Annotated[bool | None, Field(alias="otherChargesItemIdVisibleFlag")] = None + other_charges_price_caption: Annotated[str | None, Field(alias="otherChargesPriceCaption")] = None """ Max length: 50; """ - header_po_number_visible_flag: bool | None = Field( - default=None, alias="headerPoNumberVisibleFlag" - ) - header_po_number_caption: str | None = Field( - default=None, alias="headerPoNumberCaption" - ) + other_charges_price_visible_flag: Annotated[bool | None, Field(alias="otherChargesPriceVisibleFlag")] = None + other_charges_quantity_caption: Annotated[str | None, Field(alias="otherChargesQuantityCaption")] = None """ Max length: 50; """ - header_reference_visible_flag: bool | None = Field( - default=None, alias="headerReferenceVisibleFlag" - ) - header_reference_caption: str | None = Field( - default=None, alias="headerReferenceCaption" - ) + other_charges_quantity_visible_flag: Annotated[bool | None, Field(alias="otherChargesQuantityVisibleFlag")] = None + other_charges_serial_number_visible_flag: Annotated[ + bool | None, Field(alias="otherChargesSerialNumberVisibleFlag") + ] = None + other_charges_total_visible_flag: Annotated[bool | None, Field(alias="otherChargesTotalVisibleFlag")] = None + payable_caption: Annotated[str | None, Field(alias="payableCaption")] = None + """ + Max length: 1000; + """ + portal_flag: Annotated[bool | None, Field(alias="portalFlag")] = None + project_header_amount_caption: Annotated[str | None, Field(alias="projectHeaderAmountCaption")] = None """ Max length: 50; """ - header_account_visible_flag: bool | None = Field( - default=None, alias="headerAccountVisibleFlag" - ) - header_account_caption: str | None = Field( - default=None, alias="headerAccountCaption" - ) + project_header_amount_visible_flag: Annotated[bool | None, Field(alias="projectHeaderAmountVisibleFlag")] = None + project_header_billing_method_caption: Annotated[ + str | None, Field(alias="projectHeaderBillingMethodCaption") + ] = None """ Max length: 50; """ - header_tax_id_visible_flag: bool | None = Field( - default=None, alias="headerTaxIdVisibleFlag" - ) - header_tax_id_caption: str | None = Field(default=None, alias="headerTaxIdCaption") + project_header_billing_method_visible_flag: Annotated[ + bool | None, Field(alias="projectHeaderBillingMethodVisibleFlag") + ] = None + project_header_billing_type_caption: Annotated[str | None, Field(alias="projectHeaderBillingTypeCaption")] = None """ Max length: 50; """ - header_ship_to_visible_flag: bool | None = Field( - default=None, alias="headerShipToVisibleFlag" - ) - header_ship_to_caption: str | None = Field( - default=None, alias="headerShipToCaption" - ) + project_header_billing_type_visible_flag: Annotated[ + bool | None, Field(alias="projectHeaderBillingTypeVisibleFlag") + ] = None + project_header_company_name_caption: Annotated[str | None, Field(alias="projectHeaderCompanyNameCaption")] = None """ Max length: 50; """ - header_hours_based_extended_amount_visible_flag: bool | None = Field( - default=None, alias="headerHoursBasedExtendedAmountVisibleFlag" - ) - payable_caption: str | None = Field(default=None, alias="payableCaption") + project_header_company_name_visible_flag: Annotated[ + bool | None, Field(alias="projectHeaderCompanyNameVisibleFlag") + ] = None + project_header_contact_name_caption: Annotated[str | None, Field(alias="projectHeaderContactNameCaption")] = None """ - Max length: 1000; + Max length: 50; + """ + project_header_contact_name_visible_flag: Annotated[ + bool | None, Field(alias="projectHeaderContactNameVisibleFlag") + ] = None + project_header_original_downpayment_caption: Annotated[ + str | None, Field(alias="projectHeaderOriginalDownpaymentCaption") + ] = None """ - service_header_ticket_number_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderTicketNumberVisibleFlag" - ) - service_header_ticket_number_caption: str | None = Field( - default=None, alias="serviceHeaderTicketNumberCaption" - ) + Max length: 50; + """ + project_header_original_downpayment_visible_flag: Annotated[ + bool | None, Field(alias="projectHeaderOriginalDownpaymentVisibleFlag") + ] = None + project_header_project_name_caption: Annotated[str | None, Field(alias="projectHeaderProjectNameCaption")] = None + """ + Max length: 50; + """ + project_header_project_name_visible_flag: Annotated[ + bool | None, Field(alias="projectHeaderProjectNameVisibleFlag") + ] = None + remit_to_visible_flag: Annotated[bool | None, Field(alias="remitToVisibleFlag")] = None + service_header_amount_caption: Annotated[str | None, Field(alias="serviceHeaderAmountCaption")] = None """ Max length: 50; """ - service_header_company_name_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderCompanyNameVisibleFlag" - ) - service_header_company_name_caption: str | None = Field( - default=None, alias="serviceHeaderCompanyNameCaption" - ) + service_header_amount_visible_flag: Annotated[bool | None, Field(alias="serviceHeaderAmountVisibleFlag")] = None + service_header_billing_method_caption: Annotated[ + str | None, Field(alias="serviceHeaderBillingMethodCaption") + ] = None """ Max length: 50; """ - service_header_summary_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderSummaryVisibleFlag" - ) - service_header_summary_caption: str | None = Field( - default=None, alias="serviceHeaderSummaryCaption" - ) + service_header_billing_method_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderBillingMethodVisibleFlag") + ] = None + service_header_bundled_tickets_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderBundledTicketsVisibleFlag") + ] = None + service_header_closed_tasks_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderClosedTasksVisibleFlag") + ] = None + service_header_company_name_caption: Annotated[str | None, Field(alias="serviceHeaderCompanyNameCaption")] = None """ Max length: 50; """ - service_header_contact_name_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderContactNameVisibleFlag" - ) - service_header_contact_name_caption: str | None = Field( - default=None, alias="serviceHeaderContactNameCaption" - ) + service_header_company_name_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderCompanyNameVisibleFlag") + ] = None + service_header_contact_name_caption: Annotated[str | None, Field(alias="serviceHeaderContactNameCaption")] = None """ Max length: 50; """ - service_header_detail_description_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderDetailDescriptionVisibleFlag" - ) - service_header_detail_description_caption: str | None = Field( - default=None, alias="serviceHeaderDetailDescriptionCaption" - ) + service_header_contact_name_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderContactNameVisibleFlag") + ] = None + service_header_detail_description_caption: Annotated[ + str | None, Field(alias="serviceHeaderDetailDescriptionCaption") + ] = None """ Max length: 50; """ - service_header_resolution_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderResolutionVisibleFlag" - ) - service_header_resolution_caption: str | None = Field( - default=None, alias="serviceHeaderResolutionCaption" - ) + service_header_detail_description_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderDetailDescriptionVisibleFlag") + ] = None + service_header_open_tasks_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderOpenTasksVisibleFlag") + ] = None + service_header_resolution_caption: Annotated[str | None, Field(alias="serviceHeaderResolutionCaption")] = None """ Max length: 50; """ - service_header_amount_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderAmountVisibleFlag" - ) - service_header_amount_caption: str | None = Field( - default=None, alias="serviceHeaderAmountCaption" - ) + service_header_resolution_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderResolutionVisibleFlag") + ] = None + service_header_summary_caption: Annotated[str | None, Field(alias="serviceHeaderSummaryCaption")] = None """ Max length: 50; """ - service_header_billing_method_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderBillingMethodVisibleFlag" - ) - service_header_billing_method_caption: str | None = Field( - default=None, alias="serviceHeaderBillingMethodCaption" - ) + service_header_summary_visible_flag: Annotated[bool | None, Field(alias="serviceHeaderSummaryVisibleFlag")] = None + service_header_ticket_number_caption: Annotated[str | None, Field(alias="serviceHeaderTicketNumberCaption")] = None """ Max length: 50; """ - service_header_closed_tasks_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderClosedTasksVisibleFlag" - ) - service_header_open_tasks_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderOpenTasksVisibleFlag" - ) - service_header_bundled_tickets_visible_flag: bool | None = Field( - default=None, alias="serviceHeaderBundledTicketsVisibleFlag" - ) - project_header_project_name_visible_flag: bool | None = Field( - default=None, alias="projectHeaderProjectNameVisibleFlag" - ) - project_header_project_name_caption: str | None = Field( - default=None, alias="projectHeaderProjectNameCaption" - ) + service_header_ticket_number_visible_flag: Annotated[ + bool | None, Field(alias="serviceHeaderTicketNumberVisibleFlag") + ] = None + services_amount_caption: Annotated[str | None, Field(alias="servicesAmountCaption")] = None """ Max length: 50; """ - project_header_company_name_visible_flag: bool | None = Field( - default=None, alias="projectHeaderCompanyNameVisibleFlag" - ) - project_header_company_name_caption: str | None = Field( - default=None, alias="projectHeaderCompanyNameCaption" - ) + services_amount_visible_flag: Annotated[bool | None, Field(alias="servicesAmountVisibleFlag")] = None + services_collapsed_flag: Annotated[bool | None, Field(alias="servicesCollapsedFlag")] = None + services_hours_caption: Annotated[str | None, Field(alias="servicesHoursCaption")] = None """ Max length: 50; """ - project_header_original_downpayment_visible_flag: bool | None = Field( - default=None, alias="projectHeaderOriginalDownpaymentVisibleFlag" - ) - project_header_original_downpayment_caption: str | None = Field( - default=None, alias="projectHeaderOriginalDownpaymentCaption" - ) + services_hours_visible_flag: Annotated[bool | None, Field(alias="servicesHoursVisibleFlag")] = None + services_member_name_caption: Annotated[str | None, Field(alias="servicesMemberNameCaption")] = None """ Max length: 50; """ - project_header_contact_name_visible_flag: bool | None = Field( - default=None, alias="projectHeaderContactNameVisibleFlag" - ) - project_header_contact_name_caption: str | None = Field( - default=None, alias="projectHeaderContactNameCaption" - ) + services_member_name_visible_flag: Annotated[bool | None, Field(alias="servicesMemberNameVisibleFlag")] = None + services_rate_caption: Annotated[str | None, Field(alias="servicesRateCaption")] = None """ Max length: 50; """ - project_header_amount_visible_flag: bool | None = Field( - default=None, alias="projectHeaderAmountVisibleFlag" - ) - project_header_amount_caption: str | None = Field( - default=None, alias="projectHeaderAmountCaption" - ) + services_rate_visible_flag: Annotated[bool | None, Field(alias="servicesRateVisibleFlag")] = None + services_staff_caption: Annotated[str | None, Field(alias="servicesStaffCaption")] = None """ Max length: 50; """ - project_header_billing_method_visible_flag: bool | None = Field( - default=None, alias="projectHeaderBillingMethodVisibleFlag" - ) - project_header_billing_method_caption: str | None = Field( - default=None, alias="projectHeaderBillingMethodCaption" - ) + services_staff_visible_flag: Annotated[bool | None, Field(alias="servicesStaffVisibleFlag")] = None + services_total_visible_flag: Annotated[bool | None, Field(alias="servicesTotalVisibleFlag")] = None + services_work_role_caption: Annotated[str | None, Field(alias="servicesWorkRoleCaption")] = None """ Max length: 50; """ - project_header_billing_type_visible_flag: bool | None = Field( - default=None, alias="projectHeaderBillingTypeVisibleFlag" - ) - project_header_billing_type_caption: str | None = Field( - default=None, alias="projectHeaderBillingTypeCaption" - ) + services_work_role_visible_flag: Annotated[bool | None, Field(alias="servicesWorkRoleVisibleFlag")] = None + services_work_type_caption: Annotated[str | None, Field(alias="servicesWorkTypeCaption")] = None """ Max length: 50; """ - invoice_payment_amount_visible_flag: bool | None = Field( - default=None, alias="invoicePaymentAmountVisibleFlag" - ) - invoice_payment_amount_caption: str | None = Field( - default=None, alias="invoicePaymentAmountCaption" - ) - """ - Max length: 50; - """ - invoice_credit_amount_visible_flag: bool | None = Field( - default=None, alias="invoiceCreditAmountVisibleFlag" - ) - invoice_credit_amount_caption: str | None = Field( - default=None, alias="invoiceCreditAmountCaption" - ) - """ - Max length: 50; - """ - invoice_balance_due_visible_flag: bool | None = Field( - default=None, alias="invoiceBalanceDueVisibleFlag" - ) - invoice_balance_due_caption: str | None = Field( - default=None, alias="invoiceBalanceDueCaption" - ) - """ - Max length: 50; - """ - credit_credit_amount_visible_flag: bool | None = Field( - default=None, alias="creditCreditAmountVisibleFlag" - ) - credit_credit_amount_caption: str | None = Field( - default=None, alias="creditCreditAmountCaption" - ) - """ - Max length: 50; - """ - credit_remaining_amount_visible_flag: bool | None = Field( - default=None, alias="creditRemainingAmountVisibleFlag" - ) - credit_remaining_amount_caption: str | None = Field( - default=None, alias="creditRemainingAmountCaption" - ) - """ - Max length: 50; - """ - time_detail_visible_flag: bool | None = Field( - default=None, alias="timeDetailVisibleFlag" - ) - time_detail_primary_sort_field: str | None = Field( - default=None, alias="timeDetailPrimarySortField" - ) - time_detail_primary_sort_direction: str | None = Field( - default=None, alias="timeDetailPrimarySortDirection" - ) - time_detail_secondary_sort_field: str | None = Field( - default=None, alias="timeDetailSecondarySortField" - ) - time_detail_secondary_sort_direction: str | None = Field( - default=None, alias="timeDetailSecondarySortDirection" - ) - time_detail_subtotal_visible_flag: bool | None = Field( - default=None, alias="timeDetailSubtotalVisibleFlag" - ) - time_detail_start_end_time_visible_flag: bool | None = Field( - default=None, alias="timeDetailStartEndTimeVisibleFlag" - ) - time_detail_hours_visible_flag: bool | None = Field( - default=None, alias="timeDetailHoursVisibleFlag" - ) - time_detail_members_visible_flag: bool | None = Field( - default=None, alias="timeDetailMembersVisibleFlag" - ) - time_detail_billable_visible_flag: bool | None = Field( - default=None, alias="timeDetailBillableVisibleFlag" - ) - time_detail_extended_amount_visible_flag: bool | None = Field( - default=None, alias="timeDetailExtendedAmountVisibleFlag" - ) - time_detail_dollar_amounts_on_hourse_based_visible_flag: bool | None = Field( - default=None, alias="timeDetailDollarAmountsOnHourseBasedVisibleFlag" - ) - time_detail_hourly_rate_visible_flag: bool | None = Field( - default=None, alias="timeDetailHourlyRateVisibleFlag" - ) - time_detail_contacts_visible_flag: bool | None = Field( - default=None, alias="timeDetailContactsVisibleFlag" - ) - time_detail_notes_visible_flag: bool | None = Field( - default=None, alias="timeDetailNotesVisibleFlag" - ) - time_detail_non_billable_caption: str | None = Field( - default=None, alias="timeDetailNonBillableCaption" - ) - """ - Max length: 50; - """ - time_detail_agreement_visible_flag: bool | None = Field( - default=None, alias="timeDetailAgreementVisibleFlag" - ) - time_detail_hours_based_hours_visible_flag: bool | None = Field( - default=None, alias="timeDetailHoursBasedHoursVisibleFlag" - ) - time_detail_hours_based_ext_amount_visible_flag: bool | None = Field( - default=None, alias="timeDetailHoursBasedExtAmountVisibleFlag" - ) - time_detail_hoursbased_hourly_rate_visible_flag: bool | None = Field( - default=None, alias="timeDetailHoursbasedHourlyRateVisibleFlag" - ) - time_detail_amount_based_hours_visible_flag: bool | None = Field( - default=None, alias="timeDetailAmountBasedHoursVisibleFlag" - ) - time_detail_amount_based_ext_amount_visible_flag: bool | None = Field( - default=None, alias="timeDetailAmountBasedExtAmountVisibleFlag" - ) - time_detail_amount_based_hourly_rate_visible_flag: bool | None = Field( - default=None, alias="timeDetailAmountBasedHourlyRateVisibleFlag" - ) - time_detail_sr_ticket_summary_visible_flag: bool | None = Field( - default=None, alias="timeDetailSRTicketSummaryVisibleFlag" - ) - time_detail_sr_contact_visible_flag: bool | None = Field( - default=None, alias="timeDetailSRContactVisibleFlag" - ) - time_detail_sr_address_visible_flag: bool | None = Field( - default=None, alias="timeDetailSRAddressVisibleFlag" - ) - time_detail_pm_phase_visible_flag: bool | None = Field( - default=None, alias="timeDetailPmPhaseVisibleFlag" - ) - time_detail_pm_summary_visible_flag: bool | None = Field( - default=None, alias="timeDetailPmSummaryVisibleFlag" - ) - time_detail_ticket_number_visible_flag: bool | None = Field( - default=None, alias="timeDetailTicketNumberVisibleFlag" - ) - time_detail_dates_visible_flag: bool | None = Field( - default=None, alias="timeDetailDatesVisibleFlag" - ) - services_staff_caption: str | None = Field( - default=None, alias="servicesStaffCaption" - ) - """ - Max length: 50; - """ - services_staff_visible_flag: bool | None = Field( - default=None, alias="servicesStaffVisibleFlag" - ) - services_amount_caption: str | None = Field( - default=None, alias="servicesAmountCaption" - ) - """ - Max length: 50; - """ - services_amount_visible_flag: bool | None = Field( - default=None, alias="servicesAmountVisibleFlag" - ) - services_hours_caption: str | None = Field( - default=None, alias="servicesHoursCaption" - ) - """ - Max length: 50; - """ - services_hours_visible_flag: bool | None = Field( - default=None, alias="servicesHoursVisibleFlag" - ) - services_rate_caption: str | None = Field(default=None, alias="servicesRateCaption") - """ - Max length: 50; - """ - services_rate_visible_flag: bool | None = Field( - default=None, alias="servicesRateVisibleFlag" - ) - services_work_role_caption: str | None = Field( - default=None, alias="servicesWorkRoleCaption" - ) - """ - Max length: 50; - """ - services_work_role_visible_flag: bool | None = Field( - default=None, alias="servicesWorkRoleVisibleFlag" - ) - services_work_type_caption: str | None = Field( - default=None, alias="servicesWorkTypeCaption" - ) - """ - Max length: 50; - """ - services_work_type_visible_flag: bool | None = Field( - default=None, alias="servicesWorkTypeVisibleFlag" - ) - services_total_visible_flag: bool | None = Field( - default=None, alias="servicesTotalVisibleFlag" - ) - services_member_name_visible_flag: bool | None = Field( - default=None, alias="servicesMemberNameVisibleFlag" - ) - services_member_name_caption: str | None = Field( - default=None, alias="servicesMemberNameCaption" - ) - """ - Max length: 50; - """ - currency_id_visible_flag: bool | None = Field( - default=None, alias="currencyIdVisibleFlag" - ) - currency_symbol_visible_flag: bool | None = Field( - default=None, alias="currencySymbolVisibleFlag" - ) - portal_flag: bool | None = Field(default=None, alias="portalFlag") - services_collapsed_flag: bool | None = Field( - default=None, alias="servicesCollapsedFlag" - ) - expenses_collapsed_flag: bool | None = Field( - default=None, alias="expensesCollapsedFlag" - ) - other_charges_collapsed_flag: bool | None = Field( - default=None, alias="otherChargesCollapsedFlag" - ) - expenses_type_caption: str | None = Field(default=None, alias="expensesTypeCaption") - """ - Max length: 50; - """ - expenses_staff_caption: str | None = Field( - default=None, alias="expensesStaffCaption" - ) - """ - Max length: 50; - """ - expenses_amount_caption: str | None = Field( - default=None, alias="expensesAmountCaption" - ) - """ - Max length: 50; - """ - expenses_type_visible_flag: bool | None = Field( - default=None, alias="expensesTypeVisibleFlag" - ) - expenses_staff_visible_flag: bool | None = Field( - default=None, alias="expensesStaffVisibleFlag" - ) - expenses_amount_visible_flag: bool | None = Field( - default=None, alias="expensesAmountVisibleFlag" - ) - expenses_total_visible_flag: bool | None = Field( - default=None, alias="expensesTotalVisibleFlag" - ) - expense_detail_subtotal_visible_flag: bool | None = Field( - default=None, alias="expenseDetailSubtotalVisibleFlag" - ) - expense_detail_members_visible_flag: bool | None = Field( - default=None, alias="expenseDetailMembersVisibleFlag" - ) - expense_detail_contacts_visible_flag: bool | None = Field( - default=None, alias="expenseDetailContactsVisibleFlag" - ) - expense_detail_billable_visible_flag: bool | None = Field( - default=None, alias="expenseDetailBillableVisibleFlag" - ) - expense_detail_ext_amount_visible_flag: bool | None = Field( - default=None, alias="expenseDetailExtAmountVisibleFlag" - ) - expense_detail_notes_visible_flag: bool | None = Field( - default=None, alias="expenseDetailNotesVisibleFlag" - ) - expense_detail_primary_sort_field: str | None = Field( - default=None, alias="expenseDetailPrimarySortField" - ) - expense_detail_primary_sort_direction: str | None = Field( - default=None, alias="expenseDetailPrimarySortDirection" - ) - expense_detail_secondary_sort_field: str | None = Field( - default=None, alias="expenseDetailSecondarySortField" - ) - expense_detail_secondary_sort_direction: str | None = Field( - default=None, alias="expenseDetailSecondarySortDirection" - ) - expense_detail_nonbillable_caption: str | None = Field( - default=None, alias="expenseDetailNonbillableCaption" - ) - """ - Max length: 50; - """ - expense_detail_visible_flag: bool | None = Field( - default=None, alias="expenseDetailVisibleFlag" - ) - expense_detail_agreement_visible_flag: bool | None = Field( - default=None, alias="expenseDetailAgreementVisibleFlag" - ) - expense_detail_agreement_ext_amount_visible_flag: bool | None = Field( - default=None, alias="expenseDetailAgreementExtAmountVisibleFlag" - ) - expense_detail_ticket_number_visible_flag: bool | None = Field( - default=None, alias="expenseDetailTicketNumberVisibleFlag" - ) - expense_detail_sr_ticket_summary_visible_flag: bool | None = Field( - default=None, alias="expenseDetailSrTicketSummaryVisibleFlag" - ) - expense_detail_sr_contact_visible_flag: bool | None = Field( - default=None, alias="expenseDetailSrContactVisibleFlag" - ) - expense_detail_sr_address_visible_flag: bool | None = Field( - default=None, alias="expenseDetailSrAddressVisibleFlag" - ) - expense_detail_pm_phase_visible_flag: bool | None = Field( - default=None, alias="expenseDetailPmPhaseVisibleFlag" - ) - expense_detail_pm_summary_visible_flag: bool | None = Field( - default=None, alias="expenseDetailPmSummaryVisibleFlag" - ) - other_charges_amount_caption: str | None = Field( - default=None, alias="otherChargesAmountCaption" - ) - """ - Max length: 50; - """ - other_charges_amount_visible_flag: bool | None = Field( - default=None, alias="otherChargesAmountVisibleFlag" - ) - other_charges_description_caption: str | None = Field( - default=None, alias="otherChargesDescriptionCaption" - ) - """ - Max length: 50; - """ - other_charges_description_visible_flag: bool | None = Field( - default=None, alias="otherChargesDescriptionVisibleFlag" - ) - other_charges_display_six_decimals: bool | None = Field( - default=None, alias="otherChargesDisplaySixDecimals" - ) - other_charges_item_id_visible_flag: bool | None = Field( - default=None, alias="otherChargesItemIdVisibleFlag" - ) - other_charges_price_caption: str | None = Field( - default=None, alias="otherChargesPriceCaption" - ) - """ - Max length: 50; - """ - other_charges_price_visible_flag: bool | None = Field( - default=None, alias="otherChargesPriceVisibleFlag" - ) - other_charges_quantity_caption: str | None = Field( - default=None, alias="otherChargesQuantityCaption" - ) - """ - Max length: 50; - """ - other_charges_quantity_visible_flag: bool | None = Field( - default=None, alias="otherChargesQuantityVisibleFlag" - ) - other_charges_serial_number_visible_flag: bool | None = Field( - default=None, alias="otherChargesSerialNumberVisibleFlag" - ) - other_charges_total_visible_flag: bool | None = Field( - default=None, alias="otherChargesTotalVisibleFlag" - ) - adjustment_description_visible_flag: bool | None = Field( - default=None, alias="adjustmentDescriptionVisibleFlag" - ) - adjustment_description_caption: str | None = Field( - default=None, alias="adjustmentDescriptionCaption" - ) - """ - Max length: 50; - """ - adjustment_quantity_visible_flag: bool | None = Field( - default=None, alias="adjustmentQuantityVisibleFlag" - ) - adjustment_quantity_caption: str | None = Field( - default=None, alias="adjustmentQuantityCaption" - ) - """ - Max length: 50; - """ - adjustment_amount_visible_flag: bool | None = Field( - default=None, alias="adjustmentAmountVisibleFlag" - ) - adjustment_amount_caption: str | None = Field( - default=None, alias="adjustmentAmountCaption" - ) - """ - Max length: 50; - """ - adjustment_agr_type_visible_flag: bool | None = Field( - default=None, alias="adjustmentAgrTypeVisibleFlag" - ) - adjustment_total_visible_flag: bool | None = Field( - default=None, alias="adjustmentTotalVisibleFlag" - ) - adjustment_price_visible_flag: bool | None = Field( - default=None, alias="adjustmentPriceVisibleFlag" - ) - adjustment_price_caption: str | None = Field( - default=None, alias="adjustmentPriceCaption" - ) + services_work_type_visible_flag: Annotated[bool | None, Field(alias="servicesWorkTypeVisibleFlag")] = None + time_detail_agreement_visible_flag: Annotated[bool | None, Field(alias="timeDetailAgreementVisibleFlag")] = None + time_detail_amount_based_ext_amount_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailAmountBasedExtAmountVisibleFlag") + ] = None + time_detail_amount_based_hourly_rate_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailAmountBasedHourlyRateVisibleFlag") + ] = None + time_detail_amount_based_hours_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailAmountBasedHoursVisibleFlag") + ] = None + time_detail_billable_visible_flag: Annotated[bool | None, Field(alias="timeDetailBillableVisibleFlag")] = None + time_detail_contacts_visible_flag: Annotated[bool | None, Field(alias="timeDetailContactsVisibleFlag")] = None + time_detail_dates_visible_flag: Annotated[bool | None, Field(alias="timeDetailDatesVisibleFlag")] = None + time_detail_dollar_amounts_on_hourse_based_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailDollarAmountsOnHourseBasedVisibleFlag") + ] = None + time_detail_extended_amount_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailExtendedAmountVisibleFlag") + ] = None + time_detail_hourly_rate_visible_flag: Annotated[bool | None, Field(alias="timeDetailHourlyRateVisibleFlag")] = None + time_detail_hours_based_ext_amount_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailHoursBasedExtAmountVisibleFlag") + ] = None + time_detail_hours_based_hours_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailHoursBasedHoursVisibleFlag") + ] = None + time_detail_hours_visible_flag: Annotated[bool | None, Field(alias="timeDetailHoursVisibleFlag")] = None + time_detail_hoursbased_hourly_rate_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailHoursbasedHourlyRateVisibleFlag") + ] = None + time_detail_members_visible_flag: Annotated[bool | None, Field(alias="timeDetailMembersVisibleFlag")] = None + time_detail_non_billable_caption: Annotated[str | None, Field(alias="timeDetailNonBillableCaption")] = None """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + time_detail_notes_visible_flag: Annotated[bool | None, Field(alias="timeDetailNotesVisibleFlag")] = None + time_detail_pm_phase_visible_flag: Annotated[bool | None, Field(alias="timeDetailPmPhaseVisibleFlag")] = None + time_detail_pm_summary_visible_flag: Annotated[bool | None, Field(alias="timeDetailPmSummaryVisibleFlag")] = None + time_detail_primary_sort_direction: Annotated[str | None, Field(alias="timeDetailPrimarySortDirection")] = None + time_detail_primary_sort_field: Annotated[str | None, Field(alias="timeDetailPrimarySortField")] = None + time_detail_sr_address_visible_flag: Annotated[bool | None, Field(alias="timeDetailSRAddressVisibleFlag")] = None + time_detail_sr_contact_visible_flag: Annotated[bool | None, Field(alias="timeDetailSRContactVisibleFlag")] = None + time_detail_sr_ticket_summary_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailSRTicketSummaryVisibleFlag") + ] = None + time_detail_secondary_sort_direction: Annotated[str | None, Field(alias="timeDetailSecondarySortDirection")] = None + time_detail_secondary_sort_field: Annotated[str | None, Field(alias="timeDetailSecondarySortField")] = None + time_detail_start_end_time_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailStartEndTimeVisibleFlag") + ] = None + time_detail_subtotal_visible_flag: Annotated[bool | None, Field(alias="timeDetailSubtotalVisibleFlag")] = None + time_detail_ticket_number_visible_flag: Annotated[ + bool | None, Field(alias="timeDetailTicketNumberVisibleFlag") + ] = None + time_detail_visible_flag: Annotated[bool | None, Field(alias="timeDetailVisibleFlag")] = None class InvoiceTemplateDetailReference(ActivityReference): @@ -2859,55 +2406,36 @@ class InvoiceTemplateDetailReference(ActivityReference): class InvoiceTemplateReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None """ - Gets or sets invoice Template Setup Id. + Invoice Template Setup Id """ name: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class InvoiceTemplateSetup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + custom_flag: Annotated[bool | None, Field(alias="customFlag")] = None id: int | None = None name: str | None = None - custom_flag: bool | None = Field(default=None, alias="customFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") -class IRestIdentifiedItem(ConnectWiseModel): +class IvItemReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - - -class IvItemReference(ConnectWiseModel): - id: int | None = None - identifier: str | None = None - serialized_flag: bool | None = Field(default=None, alias="serializedFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + identifier: str | None = None + serialized_flag: Annotated[bool | None, Field(alias="serializedFlag")] = None class KBCategoryReference(ActivityReference): pass -class KnowledgeBaseArticle(ConnectWiseModel): - id: int | None = None - title: str - issue: str - resolution: str - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - board: BoardReference | None = None - category_id: int | None = Field(default=None, alias="categoryId") - sub_category_id: int | None = Field(default=None, alias="subCategoryId") - date_created: str | None = Field(default=None, alias="dateCreated") - created_by: str | None = Field(default=None, alias="createdBy") - info: dict[str, str] | None = Field(default=None, alias="_info") - - class KPICategory(ConnectWiseModel): id: int | None = None name: str | None = None - sort_order: int | None = Field(default=None, alias="sortOrder") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class KPICategoryReference(ActivityReference): @@ -2918,7 +2446,27 @@ class KPIReference(ActivityReference): pass +class KnowledgeBaseArticle(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + category_id: Annotated[int | None, Field(alias="categoryId")] = None + created_by: Annotated[str | None, Field(alias="createdBy")] = None + date_created: Annotated[datetime | None, Field(alias="dateCreated")] = None + id: int | None = None + issue: str + location_id: Annotated[int | None, Field(alias="locationId")] = None + resolution: str + sub_category_id: Annotated[int | None, Field(alias="subCategoryId")] = None + title: str + + class LdapConfiguration(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + domain: str + """ + Domain Name of the server. Max length: 50; + """ id: int | None = None name: str """ @@ -2928,11 +2476,6 @@ class LdapConfiguration(ConnectWiseModel): """ FQDN of the Server. Max length: 200; """ - domain: str - """ - Domain Name of the server. Max length: 50; - """ - info: dict[str, str] | None = Field(default=None, alias="_info") class LdapConfigurationInfo(ActivityReference): @@ -2940,10 +2483,10 @@ class LdapConfigurationInfo(ActivityReference): class LdapConfigurationReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None server: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class LdapConfigurationTestLink(ConnectWiseModel): @@ -2954,13 +2497,13 @@ class LdapConfigurationTestLink(ConnectWiseModel): class LegacySubCategory(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class LegacySubCategoryInfo(CategoryInfo): @@ -2968,57 +2511,59 @@ class LegacySubCategoryInfo(CategoryInfo): class LicenseBit(ConnectWiseModel): + active_flag: Annotated[bool | None, Field(alias="activeFlag")] = None name: str | None = None - active_flag: bool | None = Field(default=None, alias="activeFlag") class Link(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str """ Max length: 50; """ - table_reference_id: int | None = Field(default=None, alias="tableReferenceId") + screen_link: Annotated[ + Literal["Company", "Contact", "Service", "Invoice", "PurchaseOrder", "SalesOrder"] | None, + Field(alias="screenLink"), + ] = None + table_reference_id: Annotated[int | None, Field(alias="tableReferenceId")] = None url: str | None = None """ Max length: 1000; """ - screen_link: Literal[ - "Company", "Contact", "Service", "Invoice", "PurchaseOrder", "SalesOrder" - ] | None = Field(default=None, alias="screenLink") - info: dict[str, str] | None = Field(default=None, alias="_info") class LinkClicked(ConnectWiseModel): + campaign_id: Annotated[int | None, Field(alias="campaignId")] = None + contact_id: Annotated[int, Field(alias="contactId")] + date_clicked: Annotated[datetime | None, Field(alias="dateClicked")] = None id: int | None = None - campaign_id: int | None = Field(default=None, alias="campaignId") - contact_id: int = Field(..., alias="contactId") - date_clicked: datetime | None = Field(default=None, alias="dateClicked") + query_string: Annotated[str | None, Field(alias="queryString")] = None url: str """ Max length: 2083; """ - query_string: str | None = Field(default=None, alias="queryString") class LinkInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None - screen_link: Literal[ - "Company", "Contact", "Service", "Invoice", "PurchaseOrder", "SalesOrder" - ] | None = Field(default=None, alias="screenLink") - info: dict[str, str] | None = Field(default=None, alias="_info") + screen_link: Annotated[ + Literal["Company", "Contact", "Service", "Invoice", "PurchaseOrder", "SalesOrder"] | None, + Field(alias="screenLink"), + ] = None class LinkResolveUrlInfo(ConnectWiseModel): - reference_id: int = Field(..., alias="referenceId") + reference_id: Annotated[int, Field(alias="referenceId")] url: str | None = None class LocaleInfo(ConnectWiseModel): id: int | None = None + locale_code: Annotated[str | None, Field(alias="localeCode")] = None name: str | None = None - locale_code: str | None = Field(default=None, alias="localeCode") class LocaleReference(ActivityReference): @@ -3026,131 +2571,23 @@ class LocaleReference(ActivityReference): class LocationInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - name: str | None = None location_flag: bool | None = None - structure_level: CorporateStructureLevelReference | None = Field( - default=None, alias="structureLevel" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None + structure_level: Annotated[CorporateStructureLevelReference | None, Field(alias="structureLevel")] = None class LostRevenueReference(AgreementRevenueReference): pass -class M365Contact(ConnectWiseModel): - id: int | None = None - user_principal_name: str | None = Field(default=None, alias="userPrincipalName") - display_name: str | None = Field(default=None, alias="displayName") - contact_rec_id: int | None = Field(default=None, alias="contactRecId") - tenant_id: str | None = Field(default=None, alias="tenantId") - m365_contact_id: str | None = Field(default=None, alias="m365ContactId") - department: str | None = None - employee_type: str | None = Field(default=None, alias="employeeType") - manager_id: str | None = Field(default=None, alias="managerId") - proxy_addresses: str | None = Field(default=None, alias="proxyAddresses") - proxy_addresses_plain: str | None = Field(default=None, alias="proxyAddressesPlain") - groups: str | None = None - directory_roles: str | None = Field(default=None, alias="directoryRoles") - assigned_licenses: str | None = Field(default=None, alias="assignedLicenses") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class M365ContactSync(ConnectWiseModel): - id: int | None = None - tenant_id: str | None = Field(default=None, alias="tenantId") - client_id: str | None = Field(default=None, alias="clientId") - client_secret: str | None = Field(default=None, alias="clientSecret") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - primary_domain: str | None = Field(default=None, alias="primaryDomain") - display_name: str | None = Field(default=None, alias="displayName") - authorized_flag: bool | None = Field(default=None, alias="authorizedFlag") - server_url: str | None = Field(default=None, alias="serverUrl") - username: str | None = None - password: str | None = None - domain: str | None = None - company_contacts_folder: str | None = Field( - default=None, alias="companyContactsFolder" - ) - service_account_email: str | None = Field(default=None, alias="serviceAccountEmail") - credential_file: str | None = Field(default=None, alias="credentialFile") - credential_file_name: str | None = Field(default=None, alias="credentialFileName") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class M365ContactSyncInfo(ActivityReference): - pass - - -class M365ContactSyncMonitoring(ConnectWiseModel): - id: int | None = None - monitoring_type_id: int | None = Field(default=None, alias="monitoringTypeId") - email_address: str | None = Field(default=None, alias="emailAddress") - service_board_id: int | None = Field(default=None, alias="serviceBoardId") - service_board_status_id: int | None = Field( - default=None, alias="serviceBoardStatusId" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class M365ContactSyncMonitoringNotificationInfo(ConnectWiseModel): - company_rec_id: int | None = Field(default=None, alias="companyRecId") - company_name: str | None = Field(default=None, alias="companyName") - address_rec_id: int | None = Field(default=None, alias="addressRecId") - primary_contact_rec_id: int | None = Field( - default=None, alias="primaryContactRecId" - ) - primary_contact_full_name: str | None = Field( - default=None, alias="primaryContactFullName" - ) - tenant_id: str | None = Field(default=None, alias="tenantId") - tenant_name: str | None = Field(default=None, alias="tenantName") - - -class M365ContactSyncProperty(ConnectWiseModel): - id: int | None = None - include_exclude_type: Literal["All", "M365Property", "None"] | None = Field( - default=None, alias="includeExcludeType" - ) - property_type: Literal[ - "City", - "DepartmentContactSync", - "Email", - "DistributionGroup", - "JobTitle", - "AssignedLicenses", - "DisplayName", - "OfficeLocation", - "ReportManager", - "State", - "EmployeeType", - "UserType", - ] | None = Field(default=None, alias="propertyType") - exclude_include_flag: bool | None = Field(default=None, alias="excludeIncludeFlag") - wild_card: str | None = Field(default=None, alias="wildCard") - company_rec_id: int | None = Field(default=None, alias="companyRecID") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class M365License(ConnectWiseModel): - id: str | None = None - description: str | None = None - - -class M365Tenant(ConnectWiseModel): - id: str | None = None - name: str | None = None - - class ManagedDevicesIntegrationInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + management_it_setup_type: Annotated[str | None, Field(alias="managementItSetupType")] = None name: str | None = None solution: str | None = None - management_it_setup_type: str | None = Field( - default=None, alias="managementItSetupType" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class ManagedDevicesIntegrationReference(ActivityReference): @@ -3158,199 +2595,150 @@ class ManagedDevicesIntegrationReference(ActivityReference): class ManagedInformation(ConnectWiseModel): - management_solution_name: str | None = Field( - default=None, alias="managementSolutionName" - ) - managed_identifier: str | None = Field(default=None, alias="managedIdentifier") - type: str | None = None + child_configurations_matching_on: Annotated[str | None, Field(alias="childConfigurationsMatchingOn")] = None + inactivate_configurations_matching_on: Annotated[ + str | None, Field(alias="inactivateConfigurationsMatchingOn") + ] = None + inactive_configuration_status_id: Annotated[int | None, Field(alias="inactiveConfigurationStatusId")] = None level: str | None = None - child_configurations_matching_on: str | None = Field( - default=None, alias="childConfigurationsMatchingOn" - ) - inactivate_configurations_matching_on: str | None = Field( - default=None, alias="inactivateConfigurationsMatchingOn" - ) - inactive_configuration_status_id: int | None = Field( - default=None, alias="inactiveConfigurationStatusId" - ) + managed_identifier: Annotated[str | None, Field(alias="managedIdentifier")] = None + management_solution_name: Annotated[str | None, Field(alias="managementSolutionName")] = None + type: str | None = None class Management(ConnectWiseModel): - id: int | None = None - run_time: datetime | None = Field(default=None, alias="runTime") - added_configuration_status: ConfigurationStatusReference | None = Field( - default=None, alias="addedConfigurationStatus" - ) - deleted_configuration_status: ConfigurationStatusReference | None = Field( - default=None, alias="deletedConfigurationStatus" - ) - integrator_login: IntegratorLoginReference | None = Field( - default=None, alias="integratorLogin" - ) - schedule_executive_summary_report_flag: bool = Field( - ..., alias="scheduleExecutiveSummaryReportFlag" - ) - executive_summary_report_schedule_day: int | None = Field( - default=None, alias="executiveSummaryReportScheduleDay" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + added_configuration_status: Annotated[ + ConfigurationStatusReference | None, Field(alias="addedConfigurationStatus") + ] = None + deleted_configuration_status: Annotated[ + ConfigurationStatusReference | None, Field(alias="deletedConfigurationStatus") + ] = None + executive_summary_report_schedule_day: Annotated[ + int | None, Field(alias="executiveSummaryReportScheduleDay") + ] = None """ - Gets or sets - this is only required when scheduleExecutiveSummaryReportFlag = true. + This is only required when scheduleExecutiveSummaryReportFlag = true """ - executive_summary_report_schedule_hour: int | None = Field( - default=None, alias="executiveSummaryReportScheduleHour" - ) + executive_summary_report_schedule_hour: Annotated[ + int | None, Field(alias="executiveSummaryReportScheduleHour") + ] = None """ - Gets or sets - this is only required when scheduleExecutiveSummaryReportFlag = true. Input should be in 24 hour format, ie 2pm is 14. + This is only required when scheduleExecutiveSummaryReportFlag = true. Input should be in 24 hour format, ie 2pm is 14 """ - executive_summary_report_schedule_minute: int | None = Field( - default=None, alias="executiveSummaryReportScheduleMinute" - ) + executive_summary_report_schedule_minute: Annotated[ + int | None, Field(alias="executiveSummaryReportScheduleMinute") + ] = None """ - Gets or sets - this is only required when scheduleExecutiveSummaryReportFlag = true. + This is only required when scheduleExecutiveSummaryReportFlag = true """ - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + integrator_login: Annotated[IntegratorLoginReference | None, Field(alias="integratorLogin")] = None + run_time: Annotated[datetime | None, Field(alias="runTime")] = None + schedule_executive_summary_report_flag: Annotated[bool, Field(alias="scheduleExecutiveSummaryReportFlag")] class ManagementBackup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + billing_level: Annotated[Literal["Detail", "Summary"], Field(alias="billingLevel")] id: int | None = None - type: AgreementTypeReference | None = None item: CatalogItemReference | None = None - billing_level: Literal["Detail", "Summary"] = Field(..., alias="billingLevel") - info: dict[str, str] | None = Field(default=None, alias="_info") + type: AgreementTypeReference | None = None class ManagementItSolution(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + continuum_api_password: Annotated[str | None, Field(alias="continuumApiPassword")] = None """ - Max length: 30; + This is only required for Continuum solution Max length: 100; """ - management_it_solution_type: Literal[ - "LevelPlatforms", "NAble", "Continuum", "Custom" - ] = Field(..., alias="managementItSolutionType") - management_solution_name: str | None = Field( - default=None, alias="managementSolutionName" - ) + continuum_api_username: Annotated[str | None, Field(alias="continuumApiUsername")] = None """ - Gets or sets - this is only required when managementItSolutionType is Custom. Max length: 30; + This is only required for Continuum solution Max length: 100; """ - management_server_url: str | None = Field(default=None, alias="managementServerUrl") + global_login_flag: Annotated[bool | None, Field(alias="globalLoginFlag")] = None + global_login_password: Annotated[str | None, Field(alias="globalLoginPassword")] = None """ - Gets or sets - this is only required for Level Platforms. Max length: 200; + This is only required when globalLoginFlag = true Max length: 50; """ - webservice_override_url: str | None = Field( - default=None, alias="webserviceOverrideUrl" - ) + global_login_username: Annotated[str | None, Field(alias="globalLoginUsername")] = None """ - Gets or sets - this is only required for Level Platforms when overrideWebServiceLocationFlag is true. Max length: 200; + This is only required when globalLoginFlag = true Max length: 50; """ - portal_override_login_url: str | None = Field( - default=None, alias="portalOverrideLoginUrl" - ) + id: int | None = None + level_api_password: Annotated[str | None, Field(alias="levelApiPassword")] = None """ - Gets or sets - this is only required for Level Platforms when overrideLoginLocationFlag is true. Max length: 200; + This is only required for Level Platforms solution Max length: 100; """ - global_login_flag: bool | None = Field(default=None, alias="globalLoginFlag") - global_login_username: str | None = Field(default=None, alias="globalLoginUsername") + level_api_username: Annotated[str | None, Field(alias="levelApiUsername")] = None """ - Gets or sets - this is only required when globalLoginFlag = true. Max length: 50; + This is only required for Level Platforms solution Max length: 100; """ - global_login_password: str | None = Field(default=None, alias="globalLoginPassword") + level_var_domain: Annotated[str | None, Field(alias="levelVarDomain")] = None """ - Gets or sets - this is only required when globalLoginFlag = true. Max length: 50; + This is only required for Level Platforms solution Max length: 100; """ - using_ssl_flag: bool | None = Field(default=None, alias="usingSslFlag") - n_able_username: str | None = Field(default=None, alias="nAbleUsername") + management_it_solution_type: Annotated[ + Literal["LevelPlatforms", "NAble", "Continuum", "Custom"], Field(alias="managementItSolutionType") + ] + management_server_url: Annotated[str | None, Field(alias="managementServerUrl")] = None """ - Gets or sets - this is only required for N-Able solution. Max length: 50; + This is only required for Level Platforms Max length: 200; """ - n_able_password: str | None = Field(default=None, alias="nAblePassword") + management_solution_name: Annotated[str | None, Field(alias="managementSolutionName")] = None """ - Gets or sets - this is only required for N-Able solution. Max length: 50; + This is only required when managementItSolutionType is Custom Max length: 30; """ - override_web_service_location_flag: bool | None = Field( - default=None, alias="overrideWebServiceLocationFlag" - ) - override_login_location_flag: bool | None = Field( - default=None, alias="overrideLoginLocationFlag" - ) - continuum_api_username: str | None = Field( - default=None, alias="continuumApiUsername" - ) + n_able_password: Annotated[str | None, Field(alias="nAblePassword")] = None """ - Gets or sets - this is only required for Continuum solution. Max length: 100; + This is only required for N-Able solution Max length: 50; """ - continuum_api_password: str | None = Field( - default=None, alias="continuumApiPassword" - ) + n_able_username: Annotated[str | None, Field(alias="nAbleUsername")] = None """ - Gets or sets - this is only required for Continuum solution. Max length: 100; + This is only required for N-Able solution Max length: 50; """ - level_api_username: str | None = Field(default=None, alias="levelApiUsername") + name: str """ - Gets or sets - this is only required for Level Platforms solution. Max length: 100; + Max length: 30; """ - level_api_password: str | None = Field(default=None, alias="levelApiPassword") + no_display_flag: Annotated[bool | None, Field(alias="noDisplayFlag")] = None + override_login_location_flag: Annotated[bool | None, Field(alias="overrideLoginLocationFlag")] = None + override_web_service_location_flag: Annotated[bool | None, Field(alias="overrideWebServiceLocationFlag")] = None + portal_override_login_url: Annotated[str | None, Field(alias="portalOverrideLoginUrl")] = None """ - Gets or sets - this is only required for Level Platforms solution. Max length: 100; + This is only required for Level Platforms when overrideLoginLocationFlag is true Max length: 200; """ - level_var_domain: str | None = Field(default=None, alias="levelVarDomain") + using_ssl_flag: Annotated[bool | None, Field(alias="usingSslFlag")] = None + webservice_override_url: Annotated[str | None, Field(alias="webserviceOverrideUrl")] = None """ - Gets or sets - this is only required for Level Platforms solution. Max length: 100; + This is only required for Level Platforms when overrideWebServiceLocationFlag is true Max length: 200; """ - no_display_flag: bool | None = Field(default=None, alias="noDisplayFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ManagementItSolutionAgreementInterfaceParameter(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_type: Annotated[AgreementTypeReference | None, Field(alias="agreementType")] = None id: int | None = None - managed_devices_integration: ManagedDevicesIntegrationReference | None = Field( - default=None, alias="managedDevicesIntegration" - ) - agreement_type: AgreementTypeReference | None = Field( - default=None, alias="agreementType" - ) - server_product: IvItemReference | None = Field(default=None, alias="serverProduct") - workstation_product: IvItemReference | None = Field( - default=None, alias="workstationProduct" - ) - spam_stats_product: IvItemReference | None = Field( - default=None, alias="spamStatsProduct" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + managed_devices_integration: Annotated[ + ManagedDevicesIntegrationReference | None, Field(alias="managedDevicesIntegration") + ] = None + server_product: Annotated[IvItemReference | None, Field(alias="serverProduct")] = None + spam_stats_product: Annotated[IvItemReference | None, Field(alias="spamStatsProduct")] = None + workstation_product: Annotated[IvItemReference | None, Field(alias="workstationProduct")] = None class ManagementLogDocumentInfo(ConnectWiseModel): - full_path_file_name: str | None = Field(default=None, alias="fullPathFileName") - file_size: str | None = Field(default=None, alias="fileSize") + file_size: Annotated[str | None, Field(alias="fileSize")] = None + full_path_file_name: Annotated[str | None, Field(alias="fullPathFileName")] = None class ManagementNetworkSecurity(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str """ Max length: 30; """ - username: str | None = None - """ - Max length: 50; - """ password: str | None = None """ Max length: 50; @@ -3359,64 +2747,23 @@ class ManagementNetworkSecurity(ConnectWiseModel): """ Max length: 100; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + username: str | None = None + """ + Max length: 50; + """ class ManagementReportSetup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - scheduled_report_disabled_flag: bool = Field( - ..., alias="scheduledReportDisabledFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + scheduled_report_disabled_flag: Annotated[bool, Field(alias="scheduledReportDisabledFlag")] class ManagementSolutionReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None - setup_name: str | None = Field(default=None, alias="setupName") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class Manager(ConnectWiseModel): - manager_id: str | None = None - user_type: str | None = Field(default=None, alias="userType") - microsoft_365_contact_rec_id: int | None = Field( - default=None, alias="microsoft_365_Contact_RecID" - ) - principal_name: str | None = Field(default=None, alias="principalName") - display_name: str | None = Field(default=None, alias="displayName") - contact_rec_id: int | None = Field(default=None, alias="contact_RecID") - tenant_id: str | None = Field(default=None, alias="tenant_ID") - id: str | None = None - department: str | None = None - manager_id_1: str | None = Field(default=None, alias="manager_ID") - employee_type: str | None = Field(default=None, alias="employeeType") - manager: Manager | None = None - date_entered_utc: datetime | None = Field(default=None, alias="date_Entered_UTC") - entered_by: str | None = Field(default=None, alias="entered_By") - last_update_utc: datetime | None = Field(default=None, alias="last_Update_UTC") - updated_by: str | None = Field(default=None, alias="updated_By") - first_name: str | None = Field(default=None, alias="firstName") - last_name: str | None = Field(default=None, alias="lastName") - groups: list[str] | None = None - directory_roles: list[str] | None = Field(default=None, alias="directoryRoles") - proxy_addresses: list[str] | None = Field(default=None, alias="proxyAddresses") - mail_nickname: str | None = Field(default=None, alias="mailNickname") - mail: str | None = None - country: str | None = None - state: str | None = None - city: str | None = None - address: str | None = None - fax: str | None = None - title: str | None = None - mobile_phone: str | None = Field(default=None, alias="mobilePhone") - office: str | None = None - phone_number: str | None = Field(default=None, alias="phoneNumber") - language: str | None = None - usage_location: str | None = Field(default=None, alias="usageLocation") - postal_code: str | None = Field(default=None, alias="postalCode") - licenses: list[M365License] | None = None - account_enabled: bool | None = Field(default=None, alias="accountEnabled") + setup_name: Annotated[str | None, Field(alias="setupName")] = None class Manufacturer(LegacySubCategory): @@ -3436,34 +2783,36 @@ class MappedRecordReference(CorporateStructureLevel): class MappedType(ConnectWiseModel): + gl_type: Annotated[ + Literal[ + "AP", + "AR", + "EE", + "EI", + "EO", + "IA", + "IT", + "P", + "PF", + "R", + "RA", + "RD", + "RE", + "RP", + "ST", + "SD", + "ET", + "FT", + "PT", + ] + | None, + Field(alias="glType"), + ] = None id: int | None = None name: str | None = None + rec_id_field: Annotated[str | None, Field(alias="recIdField")] = None + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None table: str | None = None - rec_id_field: str | None = Field(default=None, alias="recIdField") - gl_type: Literal[ - "AP", - "AR", - "EE", - "EI", - "EO", - "IA", - "IT", - "P", - "PF", - "R", - "RA", - "RD", - "RE", - "RP", - "ST", - "SD", - "ET", - "FT", - "PT", - "WP", - "WR", - ] | None = Field(default=None, alias="glType") - sort_order: int | None = Field(default=None, alias="sortOrder") class MappedTypeReference(ActivityReference): @@ -3483,91 +2832,97 @@ class MarketDescriptionReference(ActivityReference): class MarketingCompany(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_contacts_flag: Annotated[bool | None, Field(alias="allContactsFlag")] = None + default_contact_flag: Annotated[bool | None, Field(alias="defaultContactFlag")] = None + group_id: Annotated[int | None, Field(alias="groupId")] = None id: int | None = None - group_id: int | None = Field(default=None, alias="groupId") - default_contact_flag: bool | None = Field(default=None, alias="defaultContactFlag") - all_contacts_flag: bool | None = Field(default=None, alias="allContactsFlag") - unsubscribe_flag: bool | None = Field(default=None, alias="unsubscribeFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + unsubscribe_flag: Annotated[bool | None, Field(alias="unsubscribeFlag")] = None class MarketingContact(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + group_id: Annotated[int | None, Field(alias="groupId")] = None id: int | None = None - group_id: int | None = Field(default=None, alias="groupId") note: str | None = None """ Max length: 50; """ - unsubscribe_flag: bool | None = Field(default=None, alias="unsubscribeFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + unsubscribe_flag: Annotated[bool | None, Field(alias="unsubscribeFlag")] = None class MarketplaceImport(ConnectWiseModel): id: int | None = None - marketplace_import_type: Literal[ - "Agreements", - "Configurations", - "CRMSurveys", - "CustomReports", - "CustomerPortalTypes", - "HTMLEmailTemplates", - "Products", - "ProjectBoards", - "ProjectTemplates", - "ReportWriterReports", - "ServiceBoards", - "TicketTemplates", - "Views", - ] | None = Field(default=None, alias="marketplaceImportType") - marketplace_object: list | None = Field(default=None, alias="marketplaceObject") - required_fields: list[str] | None = Field(default=None, alias="requiredFields") + marketplace_import_type: Annotated[ + Literal[ + "Agreements", + "Configurations", + "CRMSurveys", + "CustomReports", + "CustomerPortalTypes", + "HTMLEmailTemplates", + "Products", + "ProjectBoards", + "ProjectTemplates", + "ReportWriterReports", + "ServiceBoards", + "TicketTemplates", + "Views", + ] + | None, + Field(alias="marketplaceImportType"), + ] = None + marketplace_object: Annotated[list | None, Field(alias="marketplaceObject")] = None + required_fields: Annotated[list[str] | None, Field(alias="requiredFields")] = None class MemberInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_email: Annotated[str | None, Field(alias="defaultEmail")] = None + first_name: Annotated[str | None, Field(alias="firstName")] = None + full_name: Annotated[str | None, Field(alias="fullName")] = None id: int | None = None identifier: str | None = None - first_name: str | None = Field(default=None, alias="firstName") - middle_initial: str | None = Field(default=None, alias="middleInitial") - last_name: str | None = Field(default=None, alias="lastName") - full_name: str | None = Field(default=None, alias="fullName") - default_email: str | None = Field(default=None, alias="defaultEmail") - photo: DocumentReference | None = None - license_class: Literal["A", "C", "F", "X"] | None = Field( - default=None, alias="licenseClass" - ) + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + last_name: Annotated[str | None, Field(alias="lastName")] = None + license_class: Annotated[Literal["A", "C", "F", "X"] | None, Field(alias="licenseClass")] = None """ F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + middle_initial: Annotated[str | None, Field(alias="middleInitial")] = None + photo: DocumentReference | None = None class MemberLinkSsoUser(ConnectWiseModel): - sso_user_id: str | None = Field(default=None, alias="ssoUserId") + sso_user_id: Annotated[str | None, Field(alias="ssoUserId")] = None """ Max length: 100; """ class MemberNotificationSetting(ConnectWiseModel): - id: int | None = None - notification_type: Literal["Email", "Push"] = Field(..., alias="notificationType") - notification_trigger: Literal[ - "ActivityStatusReq", - "CustomerUpdated", - "ExpenseReport", - "TicketStatusChange", - "TicketStatusRequest", - "TimeNagApprover", - "TimeNagMember", - "TimeSheet", - "WorkflowRules", - ] = Field(..., alias="notificationTrigger") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class MemberOffice365(M365Tenant): - pass + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + id: int | None = None + notification_trigger: Annotated[ + Literal[ + "ActivityStatusReq", + "CustomerUpdated", + "ExpenseReport", + "TicketStatusChange", + "TicketStatusRequest", + "TimeNagApprover", + "TimeNagMember", + "TimeSheet", + "WorkflowRules", + ], + Field(alias="notificationTrigger"), + ] + notification_type: Annotated[Literal["Email", "Push"], Field(alias="notificationType")] + + +class MemberOffice365(ConnectWiseModel): + id: str | None = None + name: str | None = None class MemberReference(CatalogItemReference): @@ -3575,11 +2930,11 @@ class MemberReference(CatalogItemReference): class MemberSsoSettingsReference(ConnectWiseModel): - id: int | None = None - sso_user_id: str | None = Field(default=None, alias="ssoUserId") - user_name: str | None = Field(default=None, alias="userName") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None email: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + sso_user_id: Annotated[str | None, Field(alias="ssoUserId")] = None + user_name: Annotated[str | None, Field(alias="userName")] = None class MemberSsoToken(ConnectWiseModel): @@ -3587,13 +2942,13 @@ class MemberSsoToken(ConnectWiseModel): class MemberType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 30; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class MemberTypeInfo(CategoryInfo): @@ -3609,61 +2964,53 @@ class MenuLocationReference(ActivityReference): class MySecurity(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="addLevel")] = None + custom_flag: Annotated[bool | None, Field(alias="customFlag")] = None + delete_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="deleteLevel")] = None + edit_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="editLevel")] = None id: int | None = None - add_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="addLevel" - ) - edit_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="editLevel" - ) - delete_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="deleteLevel" - ) - inquire_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="inquireLevel" - ) - module_function_name: str | None = Field(default=None, alias="moduleFunctionName") - module_function_description: str | None = Field( - default=None, alias="moduleFunctionDescription" - ) - my_all_flag: bool | None = Field(default=None, alias="myAllFlag") - module_function_identifier: str | None = Field( - default=None, alias="moduleFunctionIdentifier" - ) - report_flag: bool | None = Field(default=None, alias="reportFlag") - restrict_flag: bool | None = Field(default=None, alias="restrictFlag") - custom_flag: bool | None = Field(default=None, alias="customFlag") - module_description: str | None = Field(default=None, alias="moduleDescription") - module_identifier: str | None = Field(default=None, alias="moduleIdentifier") - module_name: str | None = Field(default=None, alias="moduleName") - sort_order: int | None = Field(default=None, alias="sortOrder") + inquire_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="inquireLevel")] = None member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + module_description: Annotated[str | None, Field(alias="moduleDescription")] = None + module_function_description: Annotated[str | None, Field(alias="moduleFunctionDescription")] = None + module_function_identifier: Annotated[str | None, Field(alias="moduleFunctionIdentifier")] = None + module_function_name: Annotated[str | None, Field(alias="moduleFunctionName")] = None + module_identifier: Annotated[str | None, Field(alias="moduleIdentifier")] = None + module_name: Annotated[str | None, Field(alias="moduleName")] = None + my_all_flag: Annotated[bool | None, Field(alias="myAllFlag")] = None + report_flag: Annotated[bool | None, Field(alias="reportFlag")] = None + restrict_flag: Annotated[bool | None, Field(alias="restrictFlag")] = None + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class MySecurityCustomizeItem(ConnectWiseModel): - id: int | None = None - customize_identifier: Literal[ - "CompanyReports", - "FinanceReports", - "MarketingReports", - "ProcurementReports", - "ProjectReports", - "SalesReports", - "ServiceReports", - "SystemReports", - "TimeAndExpenseReports", - "CompanyConfigurations", - "FinanceAgreements", - "ProjectScheduling", - "ServiceResourceScheduling", - "SystemManageHostedApi", - "SystemMyAccount", - "SystemCustomMenuEntry", - "SystemMassMaintenance", - "SystemTableSetup", - ] | None = Field(default=None, alias="customizeIdentifier") - item_identifier: str | None = Field(default=None, alias="itemIdentifier") + customize_identifier: Annotated[ + Literal[ + "CompanyReports", + "FinanceReports", + "MarketingReports", + "ProcurementReports", + "ProjectReports", + "SalesReports", + "ServiceReports", + "SystemReports", + "TimeAndExpenseReports", + "CompanyConfigurations", + "FinanceAgreements", + "ProjectScheduling", + "ServiceResourceScheduling", + "SystemManageHostedApi", + "SystemMyAccount", + "SystemCustomMenuEntry", + "SystemMassMaintenance", + "SystemTableSetup", + ] + | None, + Field(alias="customizeIdentifier"), + ] = None + id: int | None = None + item_identifier: Annotated[str | None, Field(alias="itemIdentifier")] = None class NoteTypeReference(ActivityReference): @@ -3671,22 +3018,22 @@ class NoteTypeReference(ActivityReference): class NotificationRecipient(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_flag: Annotated[bool | None, Field(alias="agreementFlag")] = None + config_flag: Annotated[bool | None, Field(alias="configFlag")] = None + external_flag: Annotated[bool | None, Field(alias="externalFlag")] = None id: int | None = None identifier: str | None = None + invoice_flag: Annotated[bool | None, Field(alias="invoiceFlag")] = None + knowledge_base_flag: Annotated[bool | None, Field(alias="knowledgeBaseFlag")] = None + member_flag: Annotated[bool | None, Field(alias="memberFlag")] = None + msp_flag: Annotated[bool | None, Field(alias="mspFlag")] = None name: str | None = None - external_flag: bool | None = Field(default=None, alias="externalFlag") - service_flag: bool | None = Field(default=None, alias="serviceFlag") - sales_flag: bool | None = Field(default=None, alias="salesFlag") - invoice_flag: bool | None = Field(default=None, alias="invoiceFlag") - agreement_flag: bool | None = Field(default=None, alias="agreementFlag") - member_flag: bool | None = Field(default=None, alias="memberFlag") - config_flag: bool | None = Field(default=None, alias="configFlag") - msp_flag: bool | None = Field(default=None, alias="mspFlag") - track_flag: bool | None = Field(default=None, alias="trackFlag") - project_flag: bool | None = Field(default=None, alias="projectFlag") - procurement_flag: bool | None = Field(default=None, alias="procurementFlag") - knowledge_base_flag: bool | None = Field(default=None, alias="knowledgeBaseFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + procurement_flag: Annotated[bool | None, Field(alias="procurementFlag")] = None + project_flag: Annotated[bool | None, Field(alias="projectFlag")] = None + sales_flag: Annotated[bool | None, Field(alias="salesFlag")] = None + service_flag: Annotated[bool | None, Field(alias="serviceFlag")] = None + track_flag: Annotated[bool | None, Field(alias="trackFlag")] = None class NotificationRecipientReference(CatalogItemReference): @@ -3698,46 +3045,43 @@ class NotifyTypeReference(CatalogItemReference): class Office365EmailSetup(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + authorized_flag: Annotated[bool | None, Field(alias="authorizedFlag")] = None + client_id: Annotated[str | None, Field(alias="clientId")] = None """ - Max length: 200; + Max length: 36; """ - username: str + client_secret: Annotated[str | None, Field(alias="clientSecret")] = None """ - Max length: 100; + Max length: 4000; """ - inbox_folder: str = Field(..., alias="inboxFolder") + email_connector: Annotated[EmailConnectorReference | None, Field(alias="emailConnector")] = None + failed_folder: Annotated[str, Field(alias="failedFolder")] """ Max length: 40; """ - processed_folder: str = Field(..., alias="processedFolder") + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + inbox_folder: Annotated[str, Field(alias="inboxFolder")] """ Max length: 40; """ - failed_folder: str = Field(..., alias="failedFolder") + name: str """ - Max length: 40; + Max length: 200; """ - tenant_id: str | None = Field(default=None, alias="tenantId") + processed_folder: Annotated[str, Field(alias="processedFolder")] """ - Max length: 36; + Max length: 40; """ - client_id: str | None = Field(default=None, alias="clientId") + tenant_id: Annotated[str | None, Field(alias="tenantId")] = None """ Max length: 36; """ - client_secret: str | None = Field(default=None, alias="clientSecret") + username: str """ - Max length: 4000; + Max length: 100; """ - authorized_flag: bool | None = Field(default=None, alias="authorizedFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - source: int | None = None - email_connector: EmailConnectorReference | None = Field( - default=None, alias="emailConnector" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class Office365EmailSetupReference(ActivityReference): @@ -3745,15 +3089,9 @@ class Office365EmailSetupReference(ActivityReference): class OnHandSerialNumberReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - serial_number: str | None = Field(default=None, alias="serialNumber") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class OnPremiseSearchSetting(ConnectWiseModel): - id: int | None = None - password: str - info: dict[str, str] | None = Field(default=None, alias="_info") + serial_number: Annotated[str | None, Field(alias="serialNumber")] = None class OpenRevenueReference(AgreementRevenueReference): @@ -3761,14 +3099,14 @@ class OpenRevenueReference(AgreementRevenueReference): class OpportunityNote(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None + flagged: bool | None = None id: int | None = None - opportunity_id: int | None = Field(default=None, alias="opportunityId") - type: NoteTypeReference | None = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + opportunity_id: Annotated[int | None, Field(alias="opportunityId")] = None text: str - flagged: bool | None = None - entered_by: str | None = Field(default=None, alias="enteredBy") - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - info: dict[str, str] | None = Field(default=None, alias="_info") + type: NoteTypeReference | None = None class OpportunityPriorityReference(ActivityReference): @@ -3780,20 +3118,20 @@ class OpportunityProbabilityReference(ActivityReference): class OpportunityRating(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str """ Max length: 50; """ - sort_order: int | None = Field(default=None, alias="sortOrder") - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class OpportunityRatingInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None - sort_order: int | None = Field(default=None, alias="sortOrder") - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class OpportunityRatingReference(ActivityReference): @@ -3809,27 +3147,27 @@ class OpportunitySalesRoleReference(ActivityReference): class OpportunityStage(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + color: str | None = None + """ + Max length: 25; + """ id: int | None = None name: str """ Max length: 50; """ probability: OpportunityProbabilityReference | None = None - color: str | None = None - """ - Max length: 25; - """ - sequence_number: int | None = Field(default=None, alias="sequenceNumber") - info: dict[str, str] | None = Field(default=None, alias="_info") + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None class OpportunityStageInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + color: str | None = None id: int | None = None name: str | None = None probability: OpportunityProbabilityReference | None = None - color: str | None = None - sequence_number: int | None = Field(default=None, alias="sequenceNumber") - info: dict[str, str] | None = Field(default=None, alias="_info") + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None class OpportunityStageReference(ActivityReference): @@ -3837,27 +3175,27 @@ class OpportunityStageReference(ActivityReference): class OpportunityStatus(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + lost_flag: Annotated[bool | None, Field(alias="lostFlag")] = None name: str """ Max length: 30; """ - won_flag: bool | None = Field(default=None, alias="wonFlag") - lost_flag: bool | None = Field(default=None, alias="lostFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - entered_by: str | None = Field(default=None, alias="enteredBy") - date_entered: datetime | None = Field(default=None, alias="dateEntered") - info: dict[str, str] | None = Field(default=None, alias="_info") + won_flag: Annotated[bool | None, Field(alias="wonFlag")] = None class OpportunityStatusInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None id: int | None = None - closed_flag: bool | None = Field(default=None, alias="closedFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class OpportunityStatusReference(ActivityReference): @@ -3865,91 +3203,61 @@ class OpportunityStatusReference(ActivityReference): class OpportunityToAgreementConversion(ConnectWiseModel): - agreement_id: int | None = Field(default=None, alias="agreementId") + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None + bill_cycle_id: Annotated[int | None, Field(alias="billCycleId")] = None + bill_one_time_flag: Annotated[bool | None, Field(alias="billOneTimeFlag")] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + end_date: Annotated[datetime | None, Field(alias="endDate")] = None + include_all_documents_flag: Annotated[bool | None, Field(alias="includeAllDocumentsFlag")] = None + include_all_notes_flag: Annotated[bool | None, Field(alias="includeAllNotesFlag")] = None + include_all_products_flag: Annotated[bool | None, Field(alias="includeAllProductsFlag")] = None + include_document_ids: Annotated[list[int] | None, Field(alias="includeDocumentIds")] = None + include_note_ids: Annotated[list[int] | None, Field(alias="includeNoteIds")] = None + include_product_ids: Annotated[list[int] | None, Field(alias="includeProductIds")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None name: str | None = None + no_ending_date_flag: Annotated[bool | None, Field(alias="noEndingDateFlag")] = None + start_date: Annotated[datetime | None, Field(alias="startDate")] = None type: AgreementTypeReference | None = None - start_date: str | None = Field(default=None, alias="startDate") - end_date: str | None = Field(default=None, alias="endDate") - no_ending_date_flag: bool | None = Field(default=None, alias="noEndingDateFlag") - bill_cycle_id: int | None = Field(default=None, alias="billCycleId") - bill_one_time_flag: bool | None = Field(default=None, alias="billOneTimeFlag") - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - include_all_notes_flag: bool | None = Field( - default=None, alias="includeAllNotesFlag" - ) - include_all_documents_flag: bool | None = Field( - default=None, alias="includeAllDocumentsFlag" - ) - include_all_products_flag: bool | None = Field( - default=None, alias="includeAllProductsFlag" - ) - include_note_ids: list[int] | None = Field(default=None, alias="includeNoteIds") - include_document_ids: list[int] | None = Field( - default=None, alias="includeDocumentIds" - ) - include_product_ids: list[int] | None = Field( - default=None, alias="includeProductIds" - ) class OpportunityToSalesOrderConversion(ConnectWiseModel): - sales_order_id: int | None = Field(default=None, alias="salesOrderId") + include_all_documents_flag: Annotated[bool | None, Field(alias="includeAllDocumentsFlag")] = None + include_all_notes_flag: Annotated[bool | None, Field(alias="includeAllNotesFlag")] = None + include_all_products_flag: Annotated[bool | None, Field(alias="includeAllProductsFlag")] = None + include_document_ids: Annotated[list[int] | None, Field(alias="includeDocumentIds")] = None + include_note_ids: Annotated[list[int] | None, Field(alias="includeNoteIds")] = None + include_product_ids: Annotated[list[int] | None, Field(alias="includeProductIds")] = None name: str | None = None - include_all_notes_flag: bool | None = Field( - default=None, alias="includeAllNotesFlag" - ) - include_all_documents_flag: bool | None = Field( - default=None, alias="includeAllDocumentsFlag" - ) - include_all_products_flag: bool | None = Field( - default=None, alias="includeAllProductsFlag" - ) - include_note_ids: list[int] | None = Field(default=None, alias="includeNoteIds") - include_document_ids: list[int] | None = Field( - default=None, alias="includeDocumentIds" - ) - include_product_ids: list[int] | None = Field( - default=None, alias="includeProductIds" - ) + sales_order_id: Annotated[int | None, Field(alias="salesOrderId")] = None class OpportunityToServiceTicketConversion(ConnectWiseModel): - ticket_id: int | None = Field(default=None, alias="ticketId") + include_all_documents_flag: Annotated[bool | None, Field(alias="includeAllDocumentsFlag")] = None + include_all_notes_flag: Annotated[bool | None, Field(alias="includeAllNotesFlag")] = None + include_all_products_flag: Annotated[bool | None, Field(alias="includeAllProductsFlag")] = None + include_document_ids: Annotated[list[int] | None, Field(alias="includeDocumentIds")] = None + include_note_ids: Annotated[list[int] | None, Field(alias="includeNoteIds")] = None + include_product_ids: Annotated[list[int] | None, Field(alias="includeProductIds")] = None summary: str | None = None - include_all_notes_flag: bool | None = Field( - default=None, alias="includeAllNotesFlag" - ) - include_all_documents_flag: bool | None = Field( - default=None, alias="includeAllDocumentsFlag" - ) - include_all_products_flag: bool | None = Field( - default=None, alias="includeAllProductsFlag" - ) - include_note_ids: list[int] | None = Field(default=None, alias="includeNoteIds") - include_document_ids: list[int] | None = Field( - default=None, alias="includeDocumentIds" - ) - include_product_ids: list[int] | None = Field( - default=None, alias="includeProductIds" - ) + ticket_id: Annotated[int | None, Field(alias="ticketId")] = None class OpportunityType(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None description: str """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None class OpportunityTypeInfo(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None description: str | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None class OpportunityTypeReference(ActivityReference): @@ -3969,10 +3277,10 @@ class OrderStatusReference(ActivityReference): class OsGradeWeight(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - os_grade_weight: float | None = Field(default=None, alias="osGradeWeight") - os_name: str | None = Field(default=None, alias="osName") - info: dict[str, str] | None = Field(default=None, alias="_info") + os_grade_weight: Annotated[float | None, Field(alias="osGradeWeight")] = None + os_name: Annotated[str | None, Field(alias="osName")] = None class Other1RevenueReference(AgreementRevenueReference): @@ -3983,17 +3291,30 @@ class Other2RevenueReference(AgreementRevenueReference): pass -class OwnerLevelReference(ActivityReference): - pass - - class OwnershipType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + core_entity_ownership_type: Annotated[ + Literal[ + "CharitableOrganization", + "Clinic", + "Government", + "Hospital", + "PrivateSchoolForProfit", + "PrivateSchoolNonProfit", + "PublicCompany", + "PublicSchool", + "Regulator", + "Reseller", + "SmallBusiness", + ] + | None, + Field(alias="coreEntityOwnershipType"), + ] = None id: int | None = None name: str """ Max length: 200; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class OwnershipTypeInfo(ActivityReference): @@ -4006,23 +3327,23 @@ class OwnershipTypeReference(ActivityReference): class PageValues(ConnectWiseModel): page: int | None = None - page_size: int | None = Field(default=None, alias="pageSize") - page_id: int | None = Field(default=None, alias="pageId") + page_id: Annotated[int | None, Field(alias="pageId")] = None + page_size: Annotated[int | None, Field(alias="pageSize")] = None class ParsingType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str | None = None - parse_rule: str | None = Field(default=None, alias="parseRule") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + parse_rule: Annotated[str | None, Field(alias="parseRule")] = None class ParsingVariable(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + code: str | None = None id: int | None = None name: str | None = None - code: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class PatchOperation(ConnectWiseModel): @@ -4031,20 +3352,31 @@ class PatchOperation(ConnectWiseModel): value: dict[str, Any] | None = None +class Payment(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + amount: float | None = None + applied_by: Annotated[str | None, Field(alias="appliedBy")] = None + credit: InvoiceReference | None = None + id: int | None = None + invoice: InvoiceReference | None = None + payment_date: Annotated[datetime | None, Field(alias="paymentDate")] = None + type: str | None = None + + class PaymentMethodReference(ActivityReference): pass class PaymentType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + classification: ClassificationReference | None = None + company_flag: Annotated[bool | None, Field(alias="companyFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str """ Max length: 30; """ - classification: ClassificationReference | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - company_flag: bool | None = Field(default=None, alias="companyFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class PaymentTypeInfo(AddressFormatInfo): @@ -4060,262 +3392,184 @@ class PhaseStatusReference(ActivityReference): class PortalCalendar(ConnectWiseModel): - id: int | None = None - week_start: Literal[ - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" - ] = Field(..., alias="weekStart") - adjust1_start: str | None = Field(default=None, alias="adjust1Start") - adjust1_end: str | None = Field(default=None, alias="adjust1End") - adjust1_hours: float | None = Field(default=None, alias="adjust1Hours") - adjust2_start: str | None = Field(default=None, alias="adjust2Start") - adjust2_end: str | None = Field(default=None, alias="adjust2End") - adjust2_hours: float | None = Field(default=None, alias="adjust2Hours") - adjust3_start: str | None = Field(default=None, alias="adjust3Start") - adjust3_end: str | None = Field(default=None, alias="adjust3End") - adjust3_hours: float | None = Field(default=None, alias="adjust3Hours") - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + adjust1_end: Annotated[str | None, Field(alias="adjust1End")] = None + adjust1_hours: Annotated[float | None, Field(alias="adjust1Hours")] = None + adjust1_start: Annotated[str | None, Field(alias="adjust1Start")] = None + adjust2_end: Annotated[str | None, Field(alias="adjust2End")] = None + adjust2_hours: Annotated[float | None, Field(alias="adjust2Hours")] = None + adjust2_start: Annotated[str | None, Field(alias="adjust2Start")] = None + adjust3_end: Annotated[str | None, Field(alias="adjust3End")] = None + adjust3_hours: Annotated[float | None, Field(alias="adjust3Hours")] = None + adjust3_start: Annotated[str | None, Field(alias="adjust3Start")] = None + id: int | None = None + week_start: Annotated[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Field(alias="weekStart") + ] class PortalConfiguration(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_type_ids: Annotated[list[int] | None, Field(alias="agreementTypeIds")] = None + board_ids: Annotated[list[int] | None, Field(alias="boardIds")] = None + button_color: Annotated[str | None, Field(alias="buttonColor")] = None """ - Gets or sets and Sets - An existing Portal Configuration id is required when copying a Portal Configuration. - """ - name: str - """ - Max length: 150; + Max length: 7; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") company: CompanyReference | None = None - login_background_color: str | None = Field( - default=None, alias="loginBackgroundColor" - ) + config_type_ids: Annotated[list[int] | None, Field(alias="configTypeIds")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + display_vendor_flag: Annotated[bool | None, Field(alias="displayVendorFlag")] = None + header_color: Annotated[str | None, Field(alias="headerColor")] = None """ Max length: 7; """ - portal_background_color: str | None = Field( - default=None, alias="portalBackgroundColor" - ) + id: int | None = None """ - Max length: 7; + An existing Portal Configuration id is required when copying a Portal Configuration. """ - menu_color: str | None = Field(default=None, alias="menuColor") + language: Literal[ + "English", + "Spanish", + "French", + "British", + "Australian", + "BrazilianPortuguese", + "CanadianFrench", + "German", + "NewZealand", + "Dutch", + ] | None = None + location_ids: Annotated[list[int] | None, Field(alias="locationIds")] = None + login_background_color: Annotated[str | None, Field(alias="loginBackgroundColor")] = None """ Max length: 7; """ - button_color: str | None = Field(default=None, alias="buttonColor") + menu_color: Annotated[str | None, Field(alias="menuColor")] = None """ Max length: 7; """ - header_color: str | None = Field(default=None, alias="headerColor") + name: str + """ + Max length: 150; + """ + portal_background_color: Annotated[str | None, Field(alias="portalBackgroundColor")] = None """ Max length: 7; """ + portal_image_copy_success_flag: Annotated[bool | None, Field(alias="portalImageCopySuccessFlag")] = None url: str | None = None """ Max length: 1000; """ - language: Literal[ - "English", - "Spanish", - "French", - "British", - "Australian", - "BrazilianPortuguese", - "CanadianFrench", - "German", - "NewZealand", - "Dutch", - ] | None = None - welcome_text: str | None = Field(default=None, alias="welcomeText") + welcome_text: Annotated[str | None, Field(alias="welcomeText")] = None """ Max length: 4000; """ - board_ids: list[int] | None = Field(default=None, alias="boardIds") - agreement_type_ids: list[int] | None = Field(default=None, alias="agreementTypeIds") - config_type_ids: list[int] | None = Field(default=None, alias="configTypeIds") - location_ids: list[int] | None = Field(default=None, alias="locationIds") - portal_image_copy_success_flag: bool | None = Field( - default=None, alias="portalImageCopySuccessFlag" - ) - display_vendor_flag: bool | None = Field(default=None, alias="displayVendorFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class PortalConfigurationOpportunitySetup(ConnectWiseModel): - id: int | None = None - opportunity_status_rec_i_ds: list[int] | None = Field( - default=None, alias="opportunityStatusRecIDs" - ) - add_all_opportunity_statuses: bool | None = Field( - default=None, alias="addAllOpportunityStatuses" - ) - remove_all_opportunity_statuses: bool | None = Field( - default=None, alias="removeAllOpportunityStatuses" - ) - opportunity_type_rec_i_ds: list[int] | None = Field( - default=None, alias="opportunityTypeRecIDs" - ) - add_all_opportunity_types: bool | None = Field( - default=None, alias="addAllOpportunityTypes" - ) - remove_all_opportunity_types: bool | None = Field( - default=None, alias="removeAllOpportunityTypes" - ) - restrict_view_by_opportunity_status_flag: bool | None = Field( - default=None, alias="restrictViewByOpportunityStatusFlag" - ) - restrict_view_by_opportunity_type_flag: bool | None = Field( - default=None, alias="restrictViewByOpportunityTypeFlag" - ) - acceptance_change_status_flag: bool | None = Field( - default=None, alias="acceptanceChangeStatusFlag" - ) - acceptance_create_activity_flag: bool | None = Field( - default=None, alias="acceptanceCreateActivityFlag" - ) - acceptance_opportunity_status: OpportunityStatusReference | None = Field( - default=None, alias="acceptanceOpportunityStatus" - ) - acceptance_send_email_flag: bool | None = Field( - default=None, alias="acceptanceSendEmailFlag" - ) - acceptance_email_from_first_name: str | None = Field( - default=None, alias="acceptanceEmailFromFirstName" - ) - acceptance_email_from_last_name: str | None = Field( - default=None, alias="acceptanceEmailFromLastName" - ) - acceptance_email_subject: str | None = Field( - default=None, alias="acceptanceEmailSubject" - ) - acceptance_email_body: str | None = Field(default=None, alias="acceptanceEmailBody") - acceptance_from_email: str | None = Field(default=None, alias="acceptanceFromEmail") - """ - Gets or sets - required when acceptanceSendEmailFlag is true. - """ - acceptance_email_activity_type: ActivityTypeReference | None = Field( - default=None, alias="acceptanceEmailActivityType" - ) - acceptance_email_assigned_by_member: MemberReference | None = Field( - default=None, alias="acceptanceEmailAssignedByMember" - ) - rejection_change_status_flag: bool | None = Field( - default=None, alias="rejectionChangeStatusFlag" - ) - rejection_create_activity_flag: bool | None = Field( - default=None, alias="rejectionCreateActivityFlag" - ) - rejection_opportunity_status: OpportunityStatusReference | None = Field( - default=None, alias="rejectionOpportunityStatus" - ) - rejection_send_email_flag: bool | None = Field( - default=None, alias="rejectionSendEmailFlag" - ) - rejection_email_from_first_name: str | None = Field( - default=None, alias="rejectionEmailFromFirstName" - ) - rejection_email_from_last_name: str | None = Field( - default=None, alias="rejectionEmailFromLastName" - ) - rejection_from_email: str | None = Field(default=None, alias="rejectionFromEmail") - """ - Gets or sets - required when rejectionSendEmailFlag is true. - """ - rejection_email_subject: str | None = Field( - default=None, alias="rejectionEmailSubject" - ) - rejection_email_body: str | None = Field(default=None, alias="rejectionEmailBody") - rejection_email_activity_type: ActivityTypeReference | None = Field( - default=None, alias="rejectionEmailActivityType" - ) - rejection_email_assigned_by_member: MemberReference | None = Field( - default=None, alias="rejectionEmailAssignedByMember" - ) - confirmation_send_email_flag: bool | None = Field( - default=None, alias="confirmationSendEmailFlag" - ) - confirmation_email_use_default_company_email_address_flag: bool | None = Field( - default=None, alias="confirmationEmailUseDefaultCompanyEmailAddressFlag" - ) - confirmation_email_from_first_name: str | None = Field( - default=None, alias="confirmationEmailFromFirstName" - ) - confirmation_email_from_last_name: str | None = Field( - default=None, alias="confirmationEmailFromLastName" - ) - confirmation_from_email: str | None = Field( - default=None, alias="confirmationFromEmail" - ) - """ - Gets or sets - required when confirmationSendEmailFlag is true. - """ - confirmation_email_subject: str | None = Field( - default=None, alias="confirmationEmailSubject" - ) - confirmation_email_body: str | None = Field( - default=None, alias="confirmationEmailBody" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + acceptance_change_status_flag: Annotated[bool | None, Field(alias="acceptanceChangeStatusFlag")] = None + acceptance_create_activity_flag: Annotated[bool | None, Field(alias="acceptanceCreateActivityFlag")] = None + acceptance_email_activity_type: Annotated[ + ActivityTypeReference | None, Field(alias="acceptanceEmailActivityType") + ] = None + acceptance_email_assigned_by_member: Annotated[ + MemberReference | None, Field(alias="acceptanceEmailAssignedByMember") + ] = None + acceptance_email_body: Annotated[str | None, Field(alias="acceptanceEmailBody")] = None + acceptance_email_from_first_name: Annotated[str | None, Field(alias="acceptanceEmailFromFirstName")] = None + acceptance_email_from_last_name: Annotated[str | None, Field(alias="acceptanceEmailFromLastName")] = None + acceptance_email_subject: Annotated[str | None, Field(alias="acceptanceEmailSubject")] = None + acceptance_from_email: Annotated[str | None, Field(alias="acceptanceFromEmail")] = None + """ + Required when acceptanceSendEmailFlag is true + """ + acceptance_opportunity_status: Annotated[ + OpportunityStatusReference | None, Field(alias="acceptanceOpportunityStatus") + ] = None + acceptance_send_email_flag: Annotated[bool | None, Field(alias="acceptanceSendEmailFlag")] = None + add_all_opportunity_statuses: Annotated[bool | None, Field(alias="addAllOpportunityStatuses")] = None + add_all_opportunity_types: Annotated[bool | None, Field(alias="addAllOpportunityTypes")] = None + confirmation_email_body: Annotated[str | None, Field(alias="confirmationEmailBody")] = None + confirmation_email_from_first_name: Annotated[str | None, Field(alias="confirmationEmailFromFirstName")] = None + confirmation_email_from_last_name: Annotated[str | None, Field(alias="confirmationEmailFromLastName")] = None + confirmation_email_subject: Annotated[str | None, Field(alias="confirmationEmailSubject")] = None + confirmation_email_use_default_company_email_address_flag: Annotated[ + bool | None, Field(alias="confirmationEmailUseDefaultCompanyEmailAddressFlag") + ] = None + confirmation_from_email: Annotated[str | None, Field(alias="confirmationFromEmail")] = None + """ + Required when confirmationSendEmailFlag is true + """ + confirmation_send_email_flag: Annotated[bool | None, Field(alias="confirmationSendEmailFlag")] = None + id: int | None = None + opportunity_status_rec_i_ds: Annotated[list[int] | None, Field(alias="opportunityStatusRecIDs")] = None + opportunity_type_rec_i_ds: Annotated[list[int] | None, Field(alias="opportunityTypeRecIDs")] = None + rejection_change_status_flag: Annotated[bool | None, Field(alias="rejectionChangeStatusFlag")] = None + rejection_create_activity_flag: Annotated[bool | None, Field(alias="rejectionCreateActivityFlag")] = None + rejection_email_activity_type: Annotated[ + ActivityTypeReference | None, Field(alias="rejectionEmailActivityType") + ] = None + rejection_email_assigned_by_member: Annotated[ + MemberReference | None, Field(alias="rejectionEmailAssignedByMember") + ] = None + rejection_email_body: Annotated[str | None, Field(alias="rejectionEmailBody")] = None + rejection_email_from_first_name: Annotated[str | None, Field(alias="rejectionEmailFromFirstName")] = None + rejection_email_from_last_name: Annotated[str | None, Field(alias="rejectionEmailFromLastName")] = None + rejection_email_subject: Annotated[str | None, Field(alias="rejectionEmailSubject")] = None + rejection_from_email: Annotated[str | None, Field(alias="rejectionFromEmail")] = None + """ + Required when rejectionSendEmailFlag is true + """ + rejection_opportunity_status: Annotated[ + OpportunityStatusReference | None, Field(alias="rejectionOpportunityStatus") + ] = None + rejection_send_email_flag: Annotated[bool | None, Field(alias="rejectionSendEmailFlag")] = None + remove_all_opportunity_statuses: Annotated[bool | None, Field(alias="removeAllOpportunityStatuses")] = None + remove_all_opportunity_types: Annotated[bool | None, Field(alias="removeAllOpportunityTypes")] = None + restrict_view_by_opportunity_status_flag: Annotated[ + bool | None, Field(alias="restrictViewByOpportunityStatusFlag") + ] = None + restrict_view_by_opportunity_type_flag: Annotated[ + bool | None, Field(alias="restrictViewByOpportunityTypeFlag") + ] = None class PortalConfigurationPasswordEmailSetup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - valid_password_email_use_custom_email_flag: bool | None = Field( - default=None, alias="validPasswordEmailUseCustomEmailFlag" - ) - valid_password_email_from_first_name: str | None = Field( - default=None, alias="validPasswordEmailFromFirstName" - ) - valid_password_email_from_last_name: str | None = Field( - default=None, alias="validPasswordEmailFromLastName" - ) - valid_password_email_from_email: str | None = Field( - default=None, alias="validPasswordEmailFromEmail" - ) - """ - Gets or sets - required when validPasswordEmailUseCustomEmailFlag is true. - """ - valid_password_email_subject: str | None = Field( - default=None, alias="validPasswordEmailSubject" - ) - valid_password_email_body: str | None = Field( - default=None, alias="validPasswordEmailBody" - ) - invalid_password_email_use_custom_email_flag: bool | None = Field( - default=None, alias="invalidPasswordEmailUseCustomEmailFlag" - ) - invalid_password_email_from_first_name: str | None = Field( - default=None, alias="invalidPasswordEmailFromFirstName" - ) - invalid_password_email_from_last_name: str | None = Field( - default=None, alias="invalidPasswordEmailFromLastName" - ) - invalid_password_email_from_email: str | None = Field( - default=None, alias="invalidPasswordEmailFromEmail" - ) - """ - Gets or sets - required when invalidPasswordEmailUseCustomEmailFlag is true. - """ - invalid_password_email_subject: str | None = Field( - default=None, alias="invalidPasswordEmailSubject" - ) - invalid_password_email_body: str | None = Field( - default=None, alias="invalidPasswordEmailBody" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + invalid_password_email_body: Annotated[str | None, Field(alias="invalidPasswordEmailBody")] = None + invalid_password_email_from_email: Annotated[str | None, Field(alias="invalidPasswordEmailFromEmail")] = None + """ + Required when invalidPasswordEmailUseCustomEmailFlag is true + """ + invalid_password_email_from_first_name: Annotated[ + str | None, Field(alias="invalidPasswordEmailFromFirstName") + ] = None + invalid_password_email_from_last_name: Annotated[str | None, Field(alias="invalidPasswordEmailFromLastName")] = None + invalid_password_email_subject: Annotated[str | None, Field(alias="invalidPasswordEmailSubject")] = None + invalid_password_email_use_custom_email_flag: Annotated[ + bool | None, Field(alias="invalidPasswordEmailUseCustomEmailFlag") + ] = None + valid_password_email_body: Annotated[str | None, Field(alias="validPasswordEmailBody")] = None + valid_password_email_from_email: Annotated[str | None, Field(alias="validPasswordEmailFromEmail")] = None + """ + Required when validPasswordEmailUseCustomEmailFlag is true + """ + valid_password_email_from_first_name: Annotated[str | None, Field(alias="validPasswordEmailFromFirstName")] = None + valid_password_email_from_last_name: Annotated[str | None, Field(alias="validPasswordEmailFromLastName")] = None + valid_password_email_subject: Annotated[str | None, Field(alias="validPasswordEmailSubject")] = None + valid_password_email_use_custom_email_flag: Annotated[ + bool | None, Field(alias="validPasswordEmailUseCustomEmailFlag") + ] = None class PortalConfigurationPaymentProcessor(ConnectWiseModel): id: int | None = None name: str | None = None - test_url: str | None = Field(default=None, alias="testURL") + test_url: Annotated[str | None, Field(alias="testURL")] = None class PortalConfigurationPaymentProcessorReference(ActivityReference): @@ -4327,86 +3581,78 @@ class PortalConfigurationReference(ActivityReference): class PortalReport(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + custom_flag: Annotated[bool | None, Field(alias="customFlag")] = None + display_flag: Annotated[bool | None, Field(alias="displayFlag")] = None id: int | None = None - portal_configuration: PortalConfigurationReference | None = Field( - default=None, alias="portalConfiguration" - ) name: str """ Max length: 255; """ + open_same_window_flag: Annotated[bool | None, Field(alias="openSameWindowFlag")] = None + portal_configuration: Annotated[PortalConfigurationReference | None, Field(alias="portalConfiguration")] = None url: str """ Max length: 255; """ - open_same_window_flag: bool | None = Field(default=None, alias="openSameWindowFlag") - custom_flag: bool | None = Field(default=None, alias="customFlag") - display_flag: bool | None = Field(default=None, alias="displayFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class PortalSecurity(ConnectWiseModel): - identifier: str | None = None enabled: bool | None = None + identifier: str | None = None class PortalSecurityLevel(ConnectWiseModel): - id: int | None = None - caption_identifier: str | None = Field(default=None, alias="captionIdentifier") - is_default_flag: bool | None = Field(default=None, alias="isDefaultFlag") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None caption: str | None = None """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + caption_identifier: Annotated[str | None, Field(alias="captionIdentifier")] = None + id: int | None = None + is_default_flag: Annotated[bool | None, Field(alias="isDefaultFlag")] = None class PortalSecuritySetting(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + function_description: Annotated[str | None, Field(alias="functionDescription")] = None + function_identifier: Annotated[str | None, Field(alias="functionIdentifier")] = None id: int | None = None - function_identifier: str | None = Field(default=None, alias="functionIdentifier") - function_description: str | None = Field(default=None, alias="functionDescription") - level_one: bool | None = Field(default=None, alias="levelOne") - level_two: bool | None = Field(default=None, alias="levelTwo") - level_three: bool | None = Field(default=None, alias="levelThree") - level_four: bool | None = Field(default=None, alias="levelFour") - level_five: bool | None = Field(default=None, alias="levelFive") - level_six: bool | None = Field(default=None, alias="levelSix") - info: dict[str, str] | None = Field(default=None, alias="_info") + level_five: Annotated[bool | None, Field(alias="levelFive")] = None + level_four: Annotated[bool | None, Field(alias="levelFour")] = None + level_one: Annotated[bool | None, Field(alias="levelOne")] = None + level_six: Annotated[bool | None, Field(alias="levelSix")] = None + level_three: Annotated[bool | None, Field(alias="levelThree")] = None + level_two: Annotated[bool | None, Field(alias="levelTwo")] = None class PricingBreak(ConnectWiseModel): - id: int | None = None - detail_id: int | None = Field(default=None, alias="detailId") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None amount: float | None = None - quantity_start: float = Field(..., alias="quantityStart") - quantity_end: float | None = Field(default=None, alias="quantityEnd") + detail_id: Annotated[int | None, Field(alias="detailId")] = None + id: int | None = None + price_method: Annotated[ + Literal["FlatRateForRange", "PercentMarkupFromCost", "PercentMarkdownFromPrice", "PricePerUnit"], + Field(alias="priceMethod"), + ] + quantity_end: Annotated[float | None, Field(alias="quantityEnd")] = None + quantity_start: Annotated[float, Field(alias="quantityStart")] unlimited: bool | None = None - price_method: Literal[ - "FlatRateForRange", - "PercentMarkupFromCost", - "PercentMarkdownFromPrice", - "PricePerUnit", - ] = Field(..., alias="priceMethod") - info: dict[str, str] | None = Field(default=None, alias="_info") class PricingSchedule(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + companies: list[int] | None = None + currency: CurrencyReference | None = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 30; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - currency: CurrencyReference | None = None - companies: list[int] | None = None - set_all_companies_flag: bool | None = Field( - default=None, alias="setAllCompaniesFlag" - ) - remove_all_companies_flag: bool | None = Field( - default=None, alias="removeAllCompaniesFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + remove_all_companies_flag: Annotated[bool | None, Field(alias="removeAllCompaniesFlag")] = None + set_all_companies_flag: Annotated[bool | None, Field(alias="setAllCompaniesFlag")] = None class PricingScheduleReference(ActivityReference): @@ -4414,32 +3660,18 @@ class PricingScheduleReference(ActivityReference): class Priority(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + color: Literal[ + "Black", "Blue", "Cyan", "Gray", "Green", "Lime", "Orange", "Pink", "Purple", "Red", "White", "Yellow", "Custom" + ] + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + image_link: Annotated[str | None, Field(alias="imageLink")] = None name: str """ Max length: 50; """ - color: Literal[ - "Black", - "Blue", - "Cyan", - "Gray", - "Green", - "Lime", - "Orange", - "Pink", - "Purple", - "Red", - "White", - "Yellow", - "Custom", - ] - sort_order: int | None = Field(default=None, alias="sortOrder") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - image_link: str | None = Field(default=None, alias="imageLink") - urgency_sort_order: str | None = Field(default=None, alias="urgencySortOrder") - level: Literal["Critical", "High", "Medium", "Low"] | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class PriorityInfo(OpportunityRatingInfo): @@ -4447,64 +3679,41 @@ class PriorityInfo(OpportunityRatingInfo): class PriorityReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None sort: int | None = None - level: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ProcurementSetting(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + auto_approve_purchase_order_flag: Annotated[bool | None, Field(alias="autoApprovePurchaseOrderFlag")] = None + auto_close_purchase_order_flag: Annotated[bool | None, Field(alias="autoClosePurchaseOrderFlag")] = None + auto_close_purchase_order_item_flag: Annotated[bool | None, Field(alias="autoClosePurchaseOrderItemFlag")] = None + costing_method: Annotated[Literal["FIFO", "LIFO", "AverageCosting"], Field(alias="costingMethod")] + default_product_taxable_flag: Annotated[bool | None, Field(alias="defaultProductTaxableFlag")] = None + disable_auto_pick_flag: Annotated[bool | None, Field(alias="disableAutoPickFlag")] = None + disable_cost_updates_flag: Annotated[bool | None, Field(alias="disableCostUpdatesFlag")] = None + disable_negative_inventory_flag: Annotated[bool | None, Field(alias="disableNegativeInventoryFlag")] = None + eori_number: Annotated[str | None, Field(alias="eoriNumber")] = None + """ + Max length: 50; + """ id: int | None = None - starting_purchase_order_num: int = Field(..., alias="startingPurchaseOrderNum") - purchase_order_prefix: str | None = Field(default=None, alias="purchaseOrderPrefix") + num_decimal_places: Annotated[int | None, Field(alias="numDecimalPlaces")] = None + prefix_suffix_type: Annotated[Literal["Prefix", "Suffix"] | None, Field(alias="prefixSuffixType")] = None + purchase_order_prefix: Annotated[str | None, Field(alias="purchaseOrderPrefix")] = None """ Max length: 5; """ - purchase_order_suffix: str | None = Field(default=None, alias="purchaseOrderSuffix") + purchase_order_suffix: Annotated[str | None, Field(alias="purchaseOrderSuffix")] = None """ Max length: 5; """ - prefix_suffix_type: Literal["Prefix", "Suffix"] | None = Field( - default=None, alias="prefixSuffixType" - ) - disable_cost_updates_flag: bool | None = Field( - default=None, alias="disableCostUpdatesFlag" - ) - disable_negative_inventory_flag: bool | None = Field( - default=None, alias="disableNegativeInventoryFlag" - ) - costing_method: Literal["FIFO", "LIFO", "AverageCosting"] = Field( - ..., alias="costingMethod" - ) - auto_close_purchase_order_flag: bool | None = Field( - default=None, alias="autoClosePurchaseOrderFlag" - ) - auto_close_purchase_order_item_flag: bool | None = Field( - default=None, alias="autoClosePurchaseOrderItemFlag" - ) - auto_approve_purchase_order_flag: bool | None = Field( - default=None, alias="autoApprovePurchaseOrderFlag" - ) - tax_purchase_order_flag: bool | None = Field( - default=None, alias="taxPurchaseOrderFlag" - ) - tax_freight_flag: bool | None = Field(default=None, alias="taxFreightFlag") - use_vendor_tax_code_flag: bool | None = Field( - default=None, alias="useVendorTaxCodeFlag" - ) - num_decimal_places: int | None = Field(default=None, alias="numDecimalPlaces") - disable_auto_pick_flag: bool | None = Field( - default=None, alias="disableAutoPickFlag" - ) - default_product_taxable_flag: bool | None = Field( - default=None, alias="defaultProductTaxableFlag" - ) - eori_number: str | None = Field(default=None, alias="eoriNumber") - """ - Max length: 50; - """ - info: dict[str, str] | None = Field(default=None, alias="_info") + starting_purchase_order_num: Annotated[int, Field(alias="startingPurchaseOrderNum")] + tax_freight_flag: Annotated[bool | None, Field(alias="taxFreightFlag")] = None + tax_purchase_order_flag: Annotated[bool | None, Field(alias="taxPurchaseOrderFlag")] = None + use_vendor_tax_code_flag: Annotated[bool | None, Field(alias="useVendorTaxCodeFlag")] = None class ProductCategoryReference(ActivityReference): @@ -4512,21 +3721,17 @@ class ProductCategoryReference(ActivityReference): class ProductDemand(ConnectWiseModel): - product_rec_id: int | None = Field(default=None, alias="productRecId") - quantity: int | None = None cost: float | None = None + product_rec_id: Annotated[int | None, Field(alias="productRecId")] = None + quantity: int | None = None class ProductDetach(ConnectWiseModel): - remove_from_ticket: bool | None = Field(default=None, alias="removeFromTicket") - remove_from_invoice: bool | None = Field(default=None, alias="removeFromInvoice") - remove_from_opportunity: bool | None = Field( - default=None, alias="removeFromOpportunity" - ) - remove_from_sales_order: bool | None = Field( - default=None, alias="removeFromSalesOrder" - ) - remove_from_project: bool | None = Field(default=None, alias="removeFromProject") + remove_from_invoice: Annotated[bool | None, Field(alias="removeFromInvoice")] = None + remove_from_opportunity: Annotated[bool | None, Field(alias="removeFromOpportunity")] = None + remove_from_project: Annotated[bool | None, Field(alias="removeFromProject")] = None + remove_from_sales_order: Annotated[bool | None, Field(alias="removeFromSalesOrder")] = None + remove_from_ticket: Annotated[bool | None, Field(alias="removeFromTicket")] = None class ProductItemReference(ActivityReference): @@ -4534,19 +3739,17 @@ class ProductItemReference(ActivityReference): class ProductRecurring(ConnectWiseModel): - recurring_revenue: float | None = Field(default=None, alias="recurringRevenue") - recurring_cost: float | None = Field(default=None, alias="recurringCost") - start_date: str | None = Field(default=None, alias="startDate") - end_date: str | None = Field(default=None, alias="endDate") + bill_cycle_id: Annotated[int | None, Field(alias="billCycleId")] = None + cycle_type: Annotated[Literal["ContractYear", "CalendarYear"] | None, Field(alias="cycleType")] = None + cycles: int | None = None + end_date: Annotated[datetime | None, Field(alias="endDate")] = None """ The Recurring End Date is calculated based on the start date, number of cycles, and cycle type. """ - bill_cycle_id: int | None = Field(default=None, alias="billCycleId") - cycles: int | None = None - cycle_type: Literal["ContractYear", "CalendarYear"] | None = Field( - default=None, alias="cycleType" - ) + recurring_cost: Annotated[float | None, Field(alias="recurringCost")] = None + recurring_revenue: Annotated[float | None, Field(alias="recurringRevenue")] = None + start_date: Annotated[datetime | None, Field(alias="startDate")] = None class ProductReference(InOutTypeInfo): @@ -4562,17 +3765,17 @@ class ProductSubCategoryReference(ActivityReference): class ProductType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - type_xref: Literal[ - "InventoryPart", "NonInventoryPart", "OtherCharge", "Service" - ] | None = Field(default=None, alias="typeXref") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + type_xref: Annotated[ + Literal["InventoryPart", "NonInventoryPart", "OtherCharge", "Service"] | None, Field(alias="typeXref") + ] = None class ProductTypeInfo(CategoryInfo): @@ -4592,19 +3795,19 @@ class ProjectBoardTeamInfo(ActivityReference): class ProjectContact(ConnectWiseModel): - id: int | None = None - project_id: int | None = Field(default=None, alias="projectId") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None contact: ContactReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + project_id: Annotated[int | None, Field(alias="projectId")] = None class ProjectNote(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + flagged: bool | None = None id: int | None = None - project_id: int | None = Field(default=None, alias="projectId") + project_id: Annotated[int | None, Field(alias="projectId")] = None text: str type: NoteTypeReference | None = None - flagged: bool | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ProjectPhaseReference(ActivityReference): @@ -4620,36 +3823,28 @@ class ProjectRoleReference(AdjustmentTypeReference): class ProjectSecurityRole(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_contact_flag: Annotated[bool | None, Field(alias="defaultContactFlag")] = None id: int | None = None + manager_role_flag: Annotated[bool | None, Field(alias="managerRoleFlag")] = None name: str """ Max length: 30; """ - manager_role_flag: bool | None = Field(default=None, alias="managerRoleFlag") - default_contact_flag: bool | None = Field(default=None, alias="defaultContactFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ProjectSecurityRoleSetting(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="addLevel")] = None + delete_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="deleteLevel")] = None + edit_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="editLevel")] = None id: int | None = None - add_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="addLevel" - ) - edit_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="editLevel" - ) - delete_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="deleteLevel" - ) - inquire_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="inquireLevel" - ) - module_identifier: str | None = Field(default=None, alias="moduleIdentifier") + inquire_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="inquireLevel")] = None + module_identifier: Annotated[str | None, Field(alias="moduleIdentifier")] = None """ Max length: 50; """ - my_flag: bool | None = Field(default=None, alias="myFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + my_flag: Annotated[bool | None, Field(alias="myFlag")] = None class ProjectStatusInfo(CategoryInfo): @@ -4660,36 +3855,19 @@ class ProjectStatusReference(ActivityReference): pass -class ProjectTemplateWorkPlan(ConnectWiseModel): - tree_id: str | None = Field(default=None, alias="treeID") - i_d: int | None = Field(default=None, alias="iD") - rec_id: int | None = Field(default=None, alias="recID") - display_id: str | None = Field(default=None, alias="displayID") - s_r_service_rec_id: int | None = Field(default=None, alias="sR_Service_RecID") - description: str | None = None - project_name: str | None = Field(default=None, alias="projectName") - budget_amount: float | None = Field(default=None, alias="budgetAmount") - is_project: bool | None = Field(default=None, alias="isProject") - is_phase: bool | None = Field(default=None, alias="isPhase") - is_ticket: bool | None = Field(default=None, alias="isTicket") - is_new_item: bool | None = Field(default=None, alias="isNewItem") - wbs_code: str | None = Field(default=None, alias="wbsCode") - parent_phase_rec_id: int | None = Field(default=None, alias="parentPhaseRecID") - - class ProjectType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - name: str + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_xref: Annotated[str | None, Field(alias="integrationXref")] = None """ - Max length: 30; + Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - integration_xref: str | None = Field(default=None, alias="integrationXref") + name: str """ - Max length: 50; + Max length: 30; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ProjectTypeInfo(ActivityReference): @@ -4741,35 +3919,35 @@ class ReportCardReference(ActivityReference): class ReportColumnDefinition(ConnectWiseModel): + identity_column: Annotated[bool | None, Field(alias="identityColumn")] = None + is_nullable: Annotated[bool | None, Field(alias="isNullable")] = None type: str | None = None - is_nullable: bool | None = Field(default=None, alias="isNullable") - identity_column: bool | None = Field(default=None, alias="identityColumn") class ReportDataResponse(ConnectWiseModel): - column_definitions: list[dict[str, ReportColumnDefinition]] | None = None - row_values: list[list[dict[str, Any]]] | None = None + column_definitions: list[list] | None = None + row_values: list[list] | None = None class ReportingService(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - reporting_user_name: str | None = Field(default=None, alias="reportingUserName") + reporting_domain: Annotated[str | None, Field(alias="reportingDomain")] = None """ Max length: 50; """ - reporting_password: str | None = Field(default=None, alias="reportingPassword") + reporting_password: Annotated[str | None, Field(alias="reportingPassword")] = None """ To blank out the password, enter an empty string here. Max length: 50; """ - reporting_domain: str | None = Field(default=None, alias="reportingDomain") + reporting_url: Annotated[str | None, Field(alias="reportingUrl")] = None """ - Max length: 50; + Max length: 100; """ - reporting_url: str | None = Field(default=None, alias="reportingUrl") + reporting_user_name: Annotated[str | None, Field(alias="reportingUserName")] = None """ - Max length: 100; + Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class RequestPasswordRequest(ConnectWiseModel): @@ -4777,13 +3955,13 @@ class RequestPasswordRequest(ConnectWiseModel): class RmaAction(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class RmaActionInfo(ActivityReference): @@ -4822,20 +4000,56 @@ class Role(ContactRelationship): pass +class SLA(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + application_order: Annotated[int | None, Field(alias="applicationOrder")] = None + based_on: Annotated[Literal["AllHours", "Customer", "MyCalendar", "Custom"], Field(alias="basedOn")] + custom_calendar: Annotated[CalendarReference | None, Field(alias="customCalendar")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + hi_impact_hi_urgency: Annotated[PriorityReference | None, Field(alias="hiImpactHiUrgency")] = None + hi_impact_low_urgency: Annotated[PriorityReference | None, Field(alias="hiImpactLowUrgency")] = None + hi_impact_med_urgency: Annotated[PriorityReference | None, Field(alias="hiImpactMedUrgency")] = None + id: int | None = None + low_impact_hi_urgency: Annotated[PriorityReference | None, Field(alias="lowImpactHiUrgency")] = None + low_impact_low_urgency: Annotated[PriorityReference | None, Field(alias="lowImpactLowUrgency")] = None + low_impact_med_urgency: Annotated[PriorityReference | None, Field(alias="lowImpactMedUrgency")] = None + med_impact_hi_urgency: Annotated[PriorityReference | None, Field(alias="medImpactHiUrgency")] = None + med_impact_low_urgency: Annotated[PriorityReference | None, Field(alias="medImpactLowUrgency")] = None + med_impact_med_urgency: Annotated[PriorityReference | None, Field(alias="medImpactMedUrgency")] = None + name: str + """ + Max length: 25; + """ + plan_within: Annotated[float | None, Field(alias="planWithin")] = None + plan_within_percent: Annotated[int | None, Field(alias="planWithinPercent")] = None + resolution_hours: Annotated[float | None, Field(alias="resolutionHours")] = None + resolution_percent: Annotated[int | None, Field(alias="resolutionPercent")] = None + respond_hours: Annotated[float | None, Field(alias="respondHours")] = None + respond_percent: Annotated[int | None, Field(alias="respondPercent")] = None + + +class SLAInfo(ActivityReference): + pass + + +class SLAReference(ActivityReference): + pass + + class SalesOrderReference(AdjustmentTypeReference): pass class SalesProbability(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None probability: int - info: dict[str, str] | None = Field(default=None, alias="_info") class SalesProbabilityInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None probability: int | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class SalesTeamReference(AdjustmentTypeReference): @@ -4843,20 +4057,20 @@ class SalesTeamReference(AdjustmentTypeReference): class ScheduleColor(ConnectWiseModel): - id: int | None = None - start_percent: int | None = Field(default=None, alias="startPercent") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + color: str """ - A startPercent (0 or higher) is required if endPercent has value. + Must be a valid Hexadecimal Color Code """ - end_percent: int | None = Field(default=None, alias="endPercent") + end_percent: Annotated[int | None, Field(alias="endPercent")] = None """ - A endPercent is required if startPercent has value. + A endPercent is required if startPercent has value """ - color: str + id: int | None = None + start_percent: Annotated[int | None, Field(alias="startPercent")] = None """ - Must be a valid Hexadecimal Color Code. + A startPercent (0 or higher) is required if endPercent has value """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ScheduleEntryReference(InOutTypeInfo): @@ -4864,17 +4078,17 @@ class ScheduleEntryReference(InOutTypeInfo): class ScheduleReminderTime(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - time: int | None = None - """ - Time is calculated in minutes. - """ name: str | None = None """ Max length: 10; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + time: int | None = None + """ + Time is calculated in minutes + """ class ScheduleSpanReference(AdjustmentTypeReference): @@ -4882,16 +4096,14 @@ class ScheduleSpanReference(AdjustmentTypeReference): class ScheduleStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str """ Max length: 30; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - show_as_tentative_flag: bool | None = Field( - default=None, alias="showAsTentativeFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + show_as_tentative_flag: Annotated[bool | None, Field(alias="showAsTentativeFlag")] = None class ScheduleStatusReference(ActivityReference): @@ -4903,38 +4115,30 @@ class ScheduleTypeReference(AdjustmentTypeReference): class SchedulingMemberInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_email: Annotated[str | None, Field(alias="defaultEmail")] = None + first_name: Annotated[str | None, Field(alias="firstName")] = None + full_name: Annotated[str | None, Field(alias="fullName")] = None id: int | None = None identifier: str | None = None - first_name: str | None = Field(default=None, alias="firstName") - middle_initial: str | None = Field(default=None, alias="middleInitial") - last_name: str | None = Field(default=None, alias="lastName") - full_name: str | None = Field(default=None, alias="fullName") - default_email: str | None = Field(default=None, alias="defaultEmail") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + last_name: Annotated[str | None, Field(alias="lastName")] = None + middle_initial: Annotated[str | None, Field(alias="middleInitial")] = None class SecurityRole(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + admin_flag: Annotated[bool | None, Field(alias="adminFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 30; """ - role_type: str | None = Field(default=None, alias="roleType") - """ - Max length: 30; - """ - admin_flag: bool | None = Field(default=None, alias="adminFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") -class SecurityRoleInfo(ConnectWiseModel): - id: int | None = None - name: str | None = None - role_type: str | None = Field(default=None, alias="roleType") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") +class SecurityRoleInfo(CategoryInfo): + pass class SecurityRoleReference(ActivityReference): @@ -4942,80 +4146,56 @@ class SecurityRoleReference(ActivityReference): class SecurityRoleSetting(ConnectWiseModel): - id: int | None = None - add_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="addLevel" - ) - edit_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="editLevel" - ) - delete_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="deleteLevel" - ) - inquire_level: Literal["None", "My", "All"] | None = Field( - default=None, alias="inquireLevel" - ) - module_function_name: str | None = Field(default=None, alias="moduleFunctionName") - module_function_description: str | None = Field( - default=None, alias="moduleFunctionDescription" - ) - my_all_flag: bool | None = Field(default=None, alias="myAllFlag") - module_function_identifier: str | None = Field( - default=None, alias="moduleFunctionIdentifier" - ) - report_flag: bool | None = Field(default=None, alias="reportFlag") - restrict_flag: bool | None = Field(default=None, alias="restrictFlag") - custom_flag: bool | None = Field(default=None, alias="customFlag") - module_description: str | None = Field(default=None, alias="moduleDescription") - module_identifier: str | None = Field(default=None, alias="moduleIdentifier") - module_name: str | None = Field(default=None, alias="moduleName") - sort_order: int | None = Field(default=None, alias="sortOrder") - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="addLevel")] = None + custom_flag: Annotated[bool | None, Field(alias="customFlag")] = None + delete_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="deleteLevel")] = None + edit_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="editLevel")] = None + id: int | None = None + inquire_level: Annotated[Literal["None", "My", "All"] | None, Field(alias="inquireLevel")] = None + module_description: Annotated[str | None, Field(alias="moduleDescription")] = None + module_function_description: Annotated[str | None, Field(alias="moduleFunctionDescription")] = None + module_function_identifier: Annotated[str | None, Field(alias="moduleFunctionIdentifier")] = None + module_function_name: Annotated[str | None, Field(alias="moduleFunctionName")] = None + module_identifier: Annotated[str | None, Field(alias="moduleIdentifier")] = None + module_name: Annotated[str | None, Field(alias="moduleName")] = None + my_all_flag: Annotated[bool | None, Field(alias="myAllFlag")] = None + report_flag: Annotated[bool | None, Field(alias="reportFlag")] = None + restrict_flag: Annotated[bool | None, Field(alias="restrictFlag")] = None + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class Service(ConnectWiseModel): - id: int | None = None - sr_notify: Literal[ - "All", "NewAndClosedRequests", "ClosedRequestsOnly", "NewRequestsOnly", "None" - ] = Field(..., alias="srNotify") - schedule_span: Literal["Standard", "OfficeHours", "Overnight"] = Field( - ..., alias="scheduleSpan" - ) - hide_delimiter_flag: bool | None = Field(default=None, alias="hideDelimiterFlag") - allow_cc_flag: bool | None = Field(default=None, alias="allowCCFlag") - allow_to_flag: bool | None = Field(default=None, alias="allowTOFlag") - header_color: str | None = Field(default=None, alias="headerColor") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + allow_cc_flag: Annotated[bool | None, Field(alias="allowCCFlag")] = None + allow_to_flag: Annotated[bool | None, Field(alias="allowTOFlag")] = None + calendar_setup: Annotated[CalendarSetupReference | None, Field(alias="calendarSetup")] = None + contact_color: Annotated[str | None, Field(alias="contactColor")] = None """ Max length: 50; """ - member_color: str | None = Field(default=None, alias="memberColor") + contact_color_disable_flag: Annotated[bool | None, Field(alias="contactColorDisableFlag")] = None + header_color: Annotated[str | None, Field(alias="headerColor")] = None """ Max length: 50; """ - contact_color: str | None = Field(default=None, alias="contactColor") + header_color_disable_flag: Annotated[bool | None, Field(alias="headerColorDisableFlag")] = None + hide_delimiter_flag: Annotated[bool | None, Field(alias="hideDelimiterFlag")] = None + id: int | None = None + member_color: Annotated[str | None, Field(alias="memberColor")] = None """ Max length: 50; """ - unknown_color: str | None = Field(default=None, alias="unknownColor") + member_color_disable_flag: Annotated[bool | None, Field(alias="memberColorDisableFlag")] = None + schedule_span: Annotated[Literal["Standard", "OfficeHours", "Overnight"], Field(alias="scheduleSpan")] + sr_notify: Annotated[ + Literal["All", "NewAndClosedRequests", "ClosedRequestsOnly", "NewRequestsOnly", "None"], Field(alias="srNotify") + ] + unknown_color: Annotated[str | None, Field(alias="unknownColor")] = None """ Max length: 50; """ - calendar_setup: CalendarSetupReference | None = Field( - default=None, alias="calendarSetup" - ) - header_color_disable_flag: bool | None = Field( - default=None, alias="headerColorDisableFlag" - ) - member_color_disable_flag: bool | None = Field( - default=None, alias="memberColorDisableFlag" - ) - contact_color_disable_flag: bool | None = Field( - default=None, alias="contactColorDisableFlag" - ) - unknown_color_disable_flag: bool | None = Field( - default=None, alias="unknownColorDisableFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + unknown_color_disable_flag: Annotated[bool | None, Field(alias="unknownColorDisableFlag")] = None class ServiceCodeReference(ActivityReference): @@ -5023,20 +4203,20 @@ class ServiceCodeReference(ActivityReference): class ServiceEmailTemplateReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None identifier: str | None = None name: str | None = None type: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ServiceInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + contact_color: Annotated[str | None, Field(alias="contactColor")] = None + header_color: Annotated[str | None, Field(alias="headerColor")] = None id: int | None = None - header_color: str | None = Field(default=None, alias="headerColor") - member_color: str | None = Field(default=None, alias="memberColor") - contact_color: str | None = Field(default=None, alias="contactColor") - unknown_color: str | None = Field(default=None, alias="unknownColor") - info: dict[str, str] | None = Field(default=None, alias="_info") + member_color: Annotated[str | None, Field(alias="memberColor")] = None + unknown_color: Annotated[str | None, Field(alias="unknownColor")] = None class ServiceItemReference(ActivityReference): @@ -5044,14 +4224,14 @@ class ServiceItemReference(ActivityReference): class ServiceLocation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str """ Max length: 30; """ where: Literal["OnSite", "Remote", "InHouse"] - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ServiceLocationInfo(AddressFormatInfo): @@ -5063,30 +4243,22 @@ class ServiceLocationReference(ActivityReference): class ServiceNote(ConnectWiseModel): - id: int | None = None - ticket_id: int | None = Field(default=None, alias="ticketId") - text: str | None = None - detail_description_flag: bool | None = Field( - default=None, alias="detailDescriptionFlag" - ) - internal_analysis_flag: bool | None = Field( - default=None, alias="internalAnalysisFlag" - ) - resolution_flag: bool | None = Field(default=None, alias="resolutionFlag") - issue_flag: bool | None = Field(default=None, alias="issueFlag") - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None contact: ContactReference | None = None - customer_updated_flag: bool | None = Field( - default=None, alias="customerUpdatedFlag" - ) - process_notifications: bool | None = Field( - default=None, alias="processNotifications" - ) - date_created: str | None = Field(default=None, alias="dateCreated") - created_by: str | None = Field(default=None, alias="createdBy") - internal_flag: bool | None = Field(default=None, alias="internalFlag") - external_flag: bool | None = Field(default=None, alias="externalFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + created_by: Annotated[str | None, Field(alias="createdBy")] = None + customer_updated_flag: Annotated[bool | None, Field(alias="customerUpdatedFlag")] = None + date_created: Annotated[datetime | None, Field(alias="dateCreated")] = None + detail_description_flag: Annotated[bool | None, Field(alias="detailDescriptionFlag")] = None + external_flag: Annotated[bool | None, Field(alias="externalFlag")] = None + id: int | None = None + internal_analysis_flag: Annotated[bool | None, Field(alias="internalAnalysisFlag")] = None + internal_flag: Annotated[bool | None, Field(alias="internalFlag")] = None + issue_flag: Annotated[bool | None, Field(alias="issueFlag")] = None + member: MemberReference | None = None + process_notifications: Annotated[bool | None, Field(alias="processNotifications")] = None + resolution_flag: Annotated[bool | None, Field(alias="resolutionFlag")] = None + text: str | None = None + ticket_id: Annotated[int | None, Field(alias="ticketId")] = None class ServiceRevenueReference(AgreementRevenueReference): @@ -5094,115 +4266,93 @@ class ServiceRevenueReference(AgreementRevenueReference): class ServiceSignoff(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + billing_methods_text: Annotated[str | None, Field(alias="billingMethodsText")] = None + """ + Max length: 2000; + """ + billing_methods_text_flag: Annotated[bool | None, Field(alias="billingMethodsTextFlag")] = None + """ + On add/post, if billingMethodsText.Length > 0, this is set to true + """ + billing_terms_flag: Annotated[bool | None, Field(alias="billingTermsFlag")] = None + company_info_flag: Annotated[bool | None, Field(alias="companyInfoFlag")] = None + configurations_flag: Annotated[bool | None, Field(alias="configurationsFlag")] = None + credit_card_fields_flag: Annotated[bool | None, Field(alias="creditCardFieldsFlag")] = None + customer_signoff_fields_flag: Annotated[bool | None, Field(alias="customerSignoffFieldsFlag")] = None + customer_signoff_text: Annotated[str | None, Field(alias="customerSignoffText")] = None + """ + Max length: 4000; + """ + customer_signoff_text_flag: Annotated[bool | None, Field(alias="customerSignoffTextFlag")] = None + """ + On add/post, if customerSignoffText.Length > 0, this is set to true + """ + default_ff_flag: Annotated[bool | None, Field(alias="defaultFFFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + discussion_flag: Annotated[bool | None, Field(alias="discussionFlag")] = None + expense_agreement_flag: Annotated[bool | None, Field(alias="expenseAgreementFlag")] = None + expense_amount_flag: Annotated[bool | None, Field(alias="expenseAmountFlag")] = None + expense_bill_flag: Annotated[bool | None, Field(alias="expenseBillFlag")] = None + expense_date_flag: Annotated[bool | None, Field(alias="expenseDateFlag")] = None + expense_flag: Annotated[bool | None, Field(alias="expenseFlag")] = None + """ + On add/post, if any expense related flag is set to true, this is also set to true + """ + expense_manual_entry: Annotated[int | None, Field(alias="expenseManualEntry")] = None + expense_manual_flag: Annotated[bool | None, Field(alias="expenseManualFlag")] = None + expense_member_flag: Annotated[bool | None, Field(alias="expenseMemberFlag")] = None + expense_notes_flag: Annotated[bool | None, Field(alias="expenseNotesFlag")] = None + expense_tax_flag: Annotated[bool | None, Field(alias="expenseTaxFlag")] = None + expense_type_flag: Annotated[bool | None, Field(alias="expenseTypeFlag")] = None id: int | None = None + internal_notes_flag: Annotated[bool | None, Field(alias="internalNotesFlag")] = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - visible_logo_flag: bool | None = Field(default=None, alias="visibleLogoFlag") - company_info_flag: bool | None = Field(default=None, alias="companyInfoFlag") - billing_terms_flag: bool | None = Field(default=None, alias="billingTermsFlag") - summary_flag: bool | None = Field(default=None, alias="summaryFlag") - discussion_flag: bool | None = Field(default=None, alias="discussionFlag") - task_flag: bool | None = Field(default=None, alias="taskFlag") + product_agreement_flag: Annotated[bool | None, Field(alias="productAgreementFlag")] = None + product_bill_flag: Annotated[bool | None, Field(alias="productBillFlag")] = None + product_description_flag: Annotated[bool | None, Field(alias="productDescriptionFlag")] = None + product_extended_amount_flag: Annotated[bool | None, Field(alias="productExtendedAmountFlag")] = None + product_flag: Annotated[bool | None, Field(alias="productFlag")] = None """ - On add/post, if this is set to true but no value is set for task, task is defaulted to ServiceTasks.All. + On add/post, if any product related flag is set to true, this is also set to true """ + product_manual_entry: Annotated[int | None, Field(alias="productManualEntry")] = None + product_manual_flag: Annotated[bool | None, Field(alias="productManualFlag")] = None + product_price_flag: Annotated[bool | None, Field(alias="productPriceFlag")] = None + product_quantity_flag: Annotated[bool | None, Field(alias="productQuantityFlag")] = None + product_tax_flag: Annotated[bool | None, Field(alias="productTaxFlag")] = None + resolution_flag: Annotated[bool | None, Field(alias="resolutionFlag")] = None + summary_flag: Annotated[bool | None, Field(alias="summaryFlag")] = None task: Literal["All", "Closed", "Open"] | None = None """ - On add/post, if this is set but no value is set for taskFlag, taskFlag is set to true. - """ - configurations_flag: bool | None = Field(default=None, alias="configurationsFlag") - internal_notes_flag: bool | None = Field(default=None, alias="internalNotesFlag") - resolution_flag: bool | None = Field(default=None, alias="resolutionFlag") - time_flag: bool | None = Field(default=None, alias="timeFlag") - """ - On add/post, if any time related flag is set to true, this is also set to true. - """ - time_member_flag: bool | None = Field(default=None, alias="timeMemberFlag") - time_date_flag: bool | None = Field(default=None, alias="timeDateFlag") - time_start_end_flag: bool | None = Field(default=None, alias="timeStartEndFlag") - time_bill_flag: bool | None = Field(default=None, alias="timeBillFlag") - time_hours_flag: bool | None = Field(default=None, alias="timeHoursFlag") - time_rate_flag: bool | None = Field(default=None, alias="timeRateFlag") - time_extended_amount_flag: bool | None = Field( - default=None, alias="timeExtendedAmountFlag" - ) - time_work_type_flag: bool | None = Field(default=None, alias="timeWorkTypeFlag") - time_agreement_flag: bool | None = Field(default=None, alias="timeAgreementFlag") - time_notes_flag: bool | None = Field(default=None, alias="timeNotesFlag") - time_manual_flag: bool | None = Field(default=None, alias="timeManualFlag") - time_manual_entry: int | None = Field(default=None, alias="timeManualEntry") - time_tax_flag: bool | None = Field(default=None, alias="timeTaxFlag") - expense_flag: bool | None = Field(default=None, alias="expenseFlag") - """ - On add/post, if any expense related flag is set to true, this is also set to true. - """ - expense_date_flag: bool | None = Field(default=None, alias="expenseDateFlag") - expense_member_flag: bool | None = Field(default=None, alias="expenseMemberFlag") - expense_type_flag: bool | None = Field(default=None, alias="expenseTypeFlag") - expense_bill_flag: bool | None = Field(default=None, alias="expenseBillFlag") - expense_amount_flag: bool | None = Field(default=None, alias="expenseAmountFlag") - expense_agreement_flag: bool | None = Field( - default=None, alias="expenseAgreementFlag" - ) - expense_notes_flag: bool | None = Field(default=None, alias="expenseNotesFlag") - expense_tax_flag: bool | None = Field(default=None, alias="expenseTaxFlag") - expense_manual_flag: bool | None = Field(default=None, alias="expenseManualFlag") - expense_manual_entry: int | None = Field(default=None, alias="expenseManualEntry") - product_flag: bool | None = Field(default=None, alias="productFlag") - """ - On add/post, if any product related flag is set to true, this is also set to true. - """ - product_description_flag: bool | None = Field( - default=None, alias="productDescriptionFlag" - ) - product_bill_flag: bool | None = Field(default=None, alias="productBillFlag") - product_quantity_flag: bool | None = Field( - default=None, alias="productQuantityFlag" - ) - product_price_flag: bool | None = Field(default=None, alias="productPriceFlag") - product_extended_amount_flag: bool | None = Field( - default=None, alias="productExtendedAmountFlag" - ) - product_agreement_flag: bool | None = Field( - default=None, alias="productAgreementFlag" - ) - product_manual_flag: bool | None = Field(default=None, alias="productManualFlag") - product_manual_entry: int | None = Field(default=None, alias="productManualEntry") - product_tax_flag: bool | None = Field(default=None, alias="productTaxFlag") - technician_signoff_flag: bool | None = Field( - default=None, alias="technicianSignoffFlag" - ) - customer_signoff_text_flag: bool | None = Field( - default=None, alias="customerSignoffTextFlag" - ) - """ - On add/post, if customerSignoffText.Length > 0, this is set to true. - """ - customer_signoff_text: str | None = Field(default=None, alias="customerSignoffText") + On add/post, if this is set but no value is set for taskFlag, taskFlag is set to true """ - Max length: 4000; - """ - customer_signoff_fields_flag: bool | None = Field( - default=None, alias="customerSignoffFieldsFlag" - ) - billing_methods_text_flag: bool | None = Field( - default=None, alias="billingMethodsTextFlag" - ) + task_flag: Annotated[bool | None, Field(alias="taskFlag")] = None """ - On add/post, if billingMethodsText.Length > 0, this is set to true. + On add/post, if this is set to true but no value is set for task, task is defaulted to ServiceTasks.All """ - billing_methods_text: str | None = Field(default=None, alias="billingMethodsText") + technician_signoff_flag: Annotated[bool | None, Field(alias="technicianSignoffFlag")] = None + time_agreement_flag: Annotated[bool | None, Field(alias="timeAgreementFlag")] = None + time_bill_flag: Annotated[bool | None, Field(alias="timeBillFlag")] = None + time_date_flag: Annotated[bool | None, Field(alias="timeDateFlag")] = None + time_extended_amount_flag: Annotated[bool | None, Field(alias="timeExtendedAmountFlag")] = None + time_flag: Annotated[bool | None, Field(alias="timeFlag")] = None """ - Max length: 2000; + On add/post, if any time related flag is set to true, this is also set to true """ - credit_card_fields_flag: bool | None = Field( - default=None, alias="creditCardFieldsFlag" - ) - default_ff_flag: bool | None = Field(default=None, alias="defaultFFFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + time_hours_flag: Annotated[bool | None, Field(alias="timeHoursFlag")] = None + time_manual_entry: Annotated[int | None, Field(alias="timeManualEntry")] = None + time_manual_flag: Annotated[bool | None, Field(alias="timeManualFlag")] = None + time_member_flag: Annotated[bool | None, Field(alias="timeMemberFlag")] = None + time_notes_flag: Annotated[bool | None, Field(alias="timeNotesFlag")] = None + time_rate_flag: Annotated[bool | None, Field(alias="timeRateFlag")] = None + time_start_end_flag: Annotated[bool | None, Field(alias="timeStartEndFlag")] = None + time_tax_flag: Annotated[bool | None, Field(alias="timeTaxFlag")] = None + time_work_type_flag: Annotated[bool | None, Field(alias="timeWorkTypeFlag")] = None + visible_logo_flag: Annotated[bool | None, Field(alias="visibleLogoFlag")] = None class ServiceSignoffInfo(AddressFormatInfo): @@ -5217,11 +4367,8 @@ class ServiceSourceReference(ActivityReference): pass -class ServiceStatusReference(ConnectWiseModel): - id: int | None = None - name: str | None = None - sort: int | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") +class ServiceStatusReference(ActivityReference): + pass class ServiceSubTypeReference(ActivityReference): @@ -5229,46 +4376,36 @@ class ServiceSubTypeReference(ActivityReference): class ServiceSurvey(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + footer_text: Annotated[str | None, Field(alias="footerText")] = None """ - Max length: 50; + Max length: 500; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - header_include_logo_flag: bool | None = Field( - default=None, alias="headerIncludeLogoFlag" - ) - header_text: str | None = Field(default=None, alias="headerText") + footer_text_visible_flag: Annotated[bool | None, Field(alias="footerTextVisibleFlag")] = None + header_include_logo_flag: Annotated[bool | None, Field(alias="headerIncludeLogoFlag")] = None + header_text: Annotated[str | None, Field(alias="headerText")] = None """ Max length: 4000; """ - header_text_visible_flag: bool | None = Field( - default=None, alias="headerTextVisibleFlag" - ) - footer_text: str | None = Field(default=None, alias="footerText") + header_text_visible_flag: Annotated[bool | None, Field(alias="headerTextVisibleFlag")] = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + name: str """ - Max length: 500; + Max length: 50; """ - footer_text_visible_flag: bool | None = Field( - default=None, alias="footerTextVisibleFlag" - ) - thank_you_text: str | None = Field(default=None, alias="thankYouText") + notify_member: Annotated[MemberReference | None, Field(alias="notifyMember")] = None + notify_who: Annotated[GenericIdIdentifierReference | None, Field(alias="notifyWho")] = None + notify_who_visible_flag: Annotated[bool | None, Field(alias="notifyWhoVisibleFlag")] = None + thank_you_text: Annotated[str | None, Field(alias="thankYouText")] = None """ Max length: 4000; """ - notify_who: GenericIdIdentifierReference | None = Field( - default=None, alias="notifyWho" - ) - notify_who_visible_flag: bool | None = Field( - default=None, alias="notifyWhoVisibleFlag" - ) - notify_member: MemberReference | None = Field(default=None, alias="notifyMember") - info: dict[str, str] | None = Field(default=None, alias="_info") class ServiceSurveyQuestionOption(ConnectWiseModel): - include_flag: bool | None = Field(default=None, alias="includeFlag") caption: str | None = None + include_flag: Annotated[bool | None, Field(alias="includeFlag")] = None points: int | None = None @@ -5281,27 +4418,28 @@ class ServiceTeamReference(ActivityReference): class ServiceTemplateInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None - template_flag: bool | None = Field(default=None, alias="templateFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + template_flag: Annotated[bool | None, Field(alias="templateFlag")] = None class ServiceTemplateReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None summary: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ServiceTicketLink(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + enabled_flag: Annotated[bool | None, Field(alias="enabledFlag")] = None id: int | None = None - name: str + link_text: Annotated[str, Field(alias="linkText")] """ Max length: 50; """ - enabled_flag: bool | None = Field(default=None, alias="enabledFlag") - link_text: str = Field(..., alias="linkText") + name: str """ Max length: 50; """ @@ -5309,15 +4447,14 @@ class ServiceTicketLink(ConnectWiseModel): """ Max length: 1000; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ServiceTicketLinkInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + link_text: Annotated[str | None, Field(alias="linkText")] = None name: str | None = None - link_text: str | None = Field(default=None, alias="linkText") url: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ServiceTypeReference(ActivityReference): @@ -5325,14 +4462,14 @@ class ServiceTypeReference(ActivityReference): class SetupScreen(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None category: str | None = None - name: str | None = None description: str | None = None - module_description: str | None = Field(default=None, alias="moduleDescription") - module_identifier: str | None = Field(default=None, alias="moduleIdentifier") - module_name: str | None = Field(default=None, alias="moduleName") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + module_description: Annotated[str | None, Field(alias="moduleDescription")] = None + module_identifier: Annotated[str | None, Field(alias="moduleIdentifier")] = None + module_name: Annotated[str | None, Field(alias="moduleName")] = None + name: str | None = None class Severity(Impact): @@ -5340,17 +4477,17 @@ class Severity(Impact): class ShipmentMethod(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - tracking_url: str | None = Field(default=None, alias="trackingUrl") + tracking_url: Annotated[str | None, Field(alias="trackingUrl")] = None """ Max length: 200; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ShipmentMethodInfo(ActivityReference): @@ -5385,74 +4522,16 @@ class SkillReference(ActivityReference): pass -class SLA(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 25; - """ - based_on: Literal["AllHours", "Customer", "MyCalendar", "Custom"] = Field( - ..., alias="basedOn" - ) - custom_calendar: CalendarReference | None = Field( - default=None, alias="customCalendar" - ) - default_flag: bool | None = Field(default=None, alias="defaultFlag") - application_order: int | None = Field(default=None, alias="applicationOrder") - hi_impact_hi_urgency: PriorityReference | None = Field( - default=None, alias="hiImpactHiUrgency" - ) - hi_impact_med_urgency: PriorityReference | None = Field( - default=None, alias="hiImpactMedUrgency" - ) - hi_impact_low_urgency: PriorityReference | None = Field( - default=None, alias="hiImpactLowUrgency" - ) - med_impact_hi_urgency: PriorityReference | None = Field( - default=None, alias="medImpactHiUrgency" - ) - med_impact_med_urgency: PriorityReference | None = Field( - default=None, alias="medImpactMedUrgency" - ) - med_impact_low_urgency: PriorityReference | None = Field( - default=None, alias="medImpactLowUrgency" - ) - low_impact_hi_urgency: PriorityReference | None = Field( - default=None, alias="lowImpactHiUrgency" - ) - low_impact_med_urgency: PriorityReference | None = Field( - default=None, alias="lowImpactMedUrgency" - ) - low_impact_low_urgency: PriorityReference | None = Field( - default=None, alias="lowImpactLowUrgency" - ) - respond_hours: float | None = Field(default=None, alias="respondHours") - respond_percent: int | None = Field(default=None, alias="respondPercent") - plan_within: float | None = Field(default=None, alias="planWithin") - plan_within_percent: int | None = Field(default=None, alias="planWithinPercent") - resolution_hours: float | None = Field(default=None, alias="resolutionHours") - resolution_percent: int | None = Field(default=None, alias="resolutionPercent") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class SLAInfo(ActivityReference): - pass - - -class SLAReference(ActivityReference): - pass - - class Source(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None id: int | None = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - entered_by: str | None = Field(default=None, alias="enteredBy") - date_entered: datetime | None = Field(default=None, alias="dateEntered") - info: dict[str, str] | None = Field(default=None, alias="_info") class SourceInfo(ActivityReference): @@ -5460,105 +4539,95 @@ class SourceInfo(ActivityReference): class SsoConfiguration(ConnectWiseModel): - id: int | None = None - """ - Unique identifier of the SSO Configuration + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_members_submitted: Annotated[bool | None, Field(alias="allMembersSubmitted")] = None + client_id: Annotated[str | None, Field(alias="clientId")] = None """ - name: str - """ - Descriptor of the SSO Configuration Max length: 100; + Client identity for this configuration of ConnectWise SSO Max length: 1000; """ - sso_type: Literal["CWSSO", "SAML"] = Field(..., alias="ssoType") + id: int | None = None """ - Type of SSO Configuration + Unique identifier of the SSO Configuration """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None """ Whether the SSO configuration is not active """ - saml_entity_id: str | None = Field(default=None, alias="samlEntityId") + is_sso_on_by_default: Annotated[bool | None, Field(alias="isSsoOnByDefault")] = None + location_ids: Annotated[list[int], Field(alias="locationIds")] """ - SAML Identity Provider Id Max length: 1000; + The locations where the SAML Idp Configuration is used """ - saml_sign_in_url: str | None = Field(default=None, alias="samlSignInUrl") + name: str """ - Sign in url for the SAML Identity Provider Max length: 1000; + Descriptor of the SSO Configuration Max length: 100; """ - saml_idp_certificate: str | None = Field(default=None, alias="samlIdpCertificate") + saml_certificate_issued_to: Annotated[str | None, Field(alias="samlCertificateIssuedTo")] = None """ - Public certificate for Identity Provider signatures + Who the SAML certificate was issued to. Metadata on SAML_Idp_Certificate """ - saml_certificate_name: str | None = Field(default=None, alias="samlCertificateName") + saml_certificate_name: Annotated[str | None, Field(alias="samlCertificateName")] = None """ Name of the SAML certificate. Metadata on SAML_Idp_Certificate """ - saml_certificate_issued_to: str | None = Field( - default=None, alias="samlCertificateIssuedTo" - ) - """ - Who the SAML certificate was issued to. Metadata on SAML_Idp_Certificate - """ - saml_certificate_thumbprint: str | None = Field( - default=None, alias="samlCertificateThumbprint" - ) + saml_certificate_thumbprint: Annotated[str | None, Field(alias="samlCertificateThumbprint")] = None """ Thumbprint of the SAML certificate. Metadata on SAML_Idp_Certificate """ - saml_certificate_valid_from: datetime | None = Field( - default=None, alias="samlCertificateValidFrom" - ) + saml_certificate_valid_from: Annotated[datetime | None, Field(alias="samlCertificateValidFrom")] = None """ Date when the SAML certificate becomes valid. Metadata on SAML_Idp_Certificate """ - saml_certificate_valid_to: datetime | None = Field( - default=None, alias="samlCertificateValidTo" - ) + saml_certificate_valid_to: Annotated[datetime | None, Field(alias="samlCertificateValidTo")] = None """ Date when the SAML certificate is no longer valid. Metadata on SAML_Idp_Certificate """ - location_ids: list[int] = Field(..., alias="locationIds") + saml_entity_id: Annotated[str | None, Field(alias="samlEntityId")] = None """ - The locations where the SAML Idp Configuration is used + SAML Identity Provider Id Max length: 1000; """ - client_id: str | None = Field(default=None, alias="clientId") + saml_idp_certificate: Annotated[str | None, Field(alias="samlIdpCertificate")] = None """ - Client identity for this configuration of ConnectWise SSO Max length: 1000; + Public certificate for Identity Provider signatures + """ + saml_sign_in_url: Annotated[str | None, Field(alias="samlSignInUrl")] = None + """ + Sign in url for the SAML Identity Provider Max length: 1000; """ - sts_base_url: str | None = Field(default=None, alias="stsBaseUrl") + sso_type: Annotated[Literal["CWSSO", "SAML"], Field(alias="ssoType")] + """ + Type of SSO Configuration + """ + sts_base_url: Annotated[str | None, Field(alias="stsBaseUrl")] = None """ Sign in URL for ConnectWise SSO """ - sts_user_admin_url: str | None = Field(default=None, alias="stsUserAdminUrl") + sts_user_admin_url: Annotated[str | None, Field(alias="stsUserAdminUrl")] = None """ User Admin Url for ConnectWise SSO """ + submitted_member_count: Annotated[int | None, Field(alias="submittedMemberCount")] = None token: str | None = None - submitted_member_count: int | None = Field( - default=None, alias="submittedMemberCount" - ) - all_members_submitted: bool | None = Field( - default=None, alias="allMembersSubmitted" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - is_sso_on_by_default: bool | None = Field(default=None, alias="isSsoOnByDefault") class SsoUser(ConnectWiseModel): - id: int | None = None - sso_user_id: str | None = Field(default=None, alias="ssoUserId") - user_name: str | None = Field(default=None, alias="userName") - first_name: str | None = Field(default=None, alias="firstName") - last_name: str | None = Field(default=None, alias="lastName") + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None + disabled_flag: Annotated[bool | None, Field(alias="disabledFlag")] = None email: str | None = None - email_confirmed: bool | None = Field(default=None, alias="emailConfirmed") - disabled_flag: bool | None = Field(default=None, alias="disabledFlag") - linked_flag: bool | None = Field(default=None, alias="linkedFlag") - date_entered: str | None = Field(default=None, alias="dateEntered") - last_updated: str | None = Field(default=None, alias="lastUpdated") - linked_member: MemberReference | None = Field(default=None, alias="linkedMember") + email_confirmed: Annotated[bool | None, Field(alias="emailConfirmed")] = None + first_name: Annotated[str | None, Field(alias="firstName")] = None + id: int | None = None + last_name: Annotated[str | None, Field(alias="lastName")] = None + last_updated: Annotated[datetime | None, Field(alias="lastUpdated")] = None + linked_flag: Annotated[bool | None, Field(alias="linkedFlag")] = None + linked_member: Annotated[MemberReference | None, Field(alias="linkedMember")] = None + sso_user_id: Annotated[str | None, Field(alias="ssoUserId")] = None + user_name: Annotated[str | None, Field(alias="userName")] = None class State(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + country: CountryReference | None = None id: int | None = None identifier: str """ @@ -5568,16 +4637,14 @@ class State(ConnectWiseModel): """ Max length: 50; """ - country: CountryReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class StateInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + country: CountryReference | None = None id: int | None = None - name: str | None = None identifier: str | None = None - country: CountryReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None class StateReference(CatalogItemReference): @@ -5585,12 +4652,12 @@ class StateReference(CatalogItemReference): class StatusIndicator(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + color: str | None = None + icon: str | None = None id: int | None = None identifier: str | None = None name: str | None = None - color: str | None = None - icon: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class StatusIndicatorReference(CatalogItemReference): @@ -5602,46 +4669,46 @@ class StructureReference(ActivityReference): class SubCategory(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + category: ProductCategoryReference + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - name: str + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_xref: Annotated[str | None, Field(alias="integrationXref")] = None """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - integration_xref: str | None = Field(default=None, alias="integrationXref") + name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - category: ProductCategoryReference - info: dict[str, str] | None = Field(default=None, alias="_info") class SubCategoryInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + category: ProductCategoryReference | None = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None - category: ProductCategoryReference | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class SuccessResponse(ConnectWiseModel): - success: bool | None = None message: str | None = None + success: bool | None = None class Survey(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - name: str - """ - Max length: 50; - """ + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None instructions: str | None = None """ Max length: 1000; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str + """ + Max length: 50; + """ class SurveyInfo(CategoryInfo): @@ -5649,14 +4716,14 @@ class SurveyInfo(CategoryInfo): class SurveyOption(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None caption: str """ Max length: 100; """ + id: int | None = None points: int visibleflag: bool | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class SurveyQuestionReference(ConfigurationTypeQuestionReference): @@ -5668,11 +4735,11 @@ class SurveyReference(ActivityReference): class SurveyResultDetail(ConnectWiseModel): - question_id: int | None = Field(default=None, alias="questionId") answer: dict[str, Any] | None = None """ - If question type is Selection, this should be the option array index. + If question type is Selection, this should be the option array index """ + question_id: Annotated[int | None, Field(alias="questionId")] = None class SystemDepartmentReference(CatalogItemReference): @@ -5688,353 +4755,230 @@ class SystemMenuEntryReference(ActivityReference): class SystemSetting(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None description: str | None = None + id: int | None = None value: str - value_type: str | None = Field(default=None, alias="valueType") - info: dict[str, str] | None = Field(default=None, alias="_info") + value_type: Annotated[str | None, Field(alias="valueType")] = None class Task(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + child_schedule_action: Annotated[ + Literal["Transfer", "Delete", "Done"] | None, Field(alias="childScheduleAction") + ] = None + child_ticket_id: Annotated[int | None, Field(alias="childTicketId")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + code: ServiceCodeReference | None = None id: int | None = None - ticket_id: int | None = Field(default=None, alias="ticketId") notes: str | None = None - closed_flag: bool | None = Field(default=None, alias="closedFlag") priority: int | None = None - schedule: ScheduleEntryReference | None = None - code: ServiceCodeReference | None = None resolution: str | None = None - child_schedule_action: Literal["Transfer", "Delete", "Done"] | None = Field( - default=None, alias="childScheduleAction" - ) - child_ticket_id: int | None = Field(default=None, alias="childTicketId") - summary: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + schedule: ScheduleEntryReference | None = None + ticket_id: Annotated[int | None, Field(alias="ticketId")] = None class TaxCode(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_expense_types: Annotated[bool | None, Field(alias="addAllExpenseTypes")] = None + add_all_product_types: Annotated[bool | None, Field(alias="addAllProductTypes")] = None + add_all_work_roles: Annotated[bool | None, Field(alias="addAllWorkRoles")] = None + canada_calculate_gst_flag: Annotated[bool | None, Field(alias="canadaCalculateGSTFlag")] = None + cancel_date: Annotated[datetime | None, Field(alias="cancelDate")] = None + country: CountryReference | None = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + description: str + """ + Max length: 50; + """ + display_on_invoice_flag: Annotated[bool | None, Field(alias="displayOnInvoiceFlag")] = None + effective_date: Annotated[datetime, Field(alias="effectiveDate")] + expense_type_ids: Annotated[list[int] | None, Field(alias="expenseTypeIds")] = None + """ + Array of expense type exemptions for the tax code + """ id: int | None = None identifier: str """ Max length: 8; """ - description: str + invoice_caption: Annotated[str, Field(alias="invoiceCaption")] """ - Max length: 50; + Max length: 25; """ - invoice_caption: str = Field(..., alias="invoiceCaption") + level_five_agency_xref: Annotated[str | None, Field(alias="levelFiveAgencyXref")] = None """ - Max length: 25; + Max length: 100; """ - country: CountryReference | None = None - effective_date: datetime = Field(..., alias="effectiveDate") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - display_on_invoice_flag: bool | None = Field( - default=None, alias="displayOnInvoiceFlag" - ) - canada_calculate_gst_flag: bool | None = Field( - default=None, alias="canadaCalculateGSTFlag" - ) - cancel_date: datetime | None = Field(default=None, alias="cancelDate") - level_one_rate: float | None = Field(default=None, alias="levelOneRate") - level_one_rate_type: Literal["Amount", "Percent"] | None = Field( - default=None, alias="levelOneRateType" - ) - level_one_taxable_max: float | None = Field( - default=None, alias="levelOneTaxableMax" - ) - level_one_caption: str | None = Field(default=None, alias="levelOneCaption") + level_five_apply_single_unit_flag: Annotated[bool | None, Field(alias="levelFiveApplySingleUnitFlag")] = None + level_five_apply_single_unit_max: Annotated[float | None, Field(alias="levelFiveApplySingleUnitMax")] = None + level_five_apply_single_unit_min: Annotated[float | None, Field(alias="levelFiveApplySingleUnitMin")] = None + level_five_caption: Annotated[str | None, Field(alias="levelFiveCaption")] = None """ Max length: 25; """ - level_one_tax_code_xref: str | None = Field( - default=None, alias="levelOneTaxCodeXref" - ) + level_five_expenses_flag: Annotated[bool | None, Field(alias="levelFiveExpensesFlag")] = None + level_five_products_flag: Annotated[bool | None, Field(alias="levelFiveProductsFlag")] = None + level_five_rate: Annotated[float | None, Field(alias="levelFiveRate")] = None + level_five_rate_type: Annotated[Literal["Amount", "Percent"] | None, Field(alias="levelFiveRateType")] = None + level_five_services_flag: Annotated[bool | None, Field(alias="levelFiveServicesFlag")] = None + level_five_tax_code_xref: Annotated[str | None, Field(alias="levelFiveTaxCodeXref")] = None """ Max length: 50; """ - level_one_agency_xref: str | None = Field(default=None, alias="levelOneAgencyXref") + level_five_taxable_max: Annotated[float | None, Field(alias="levelFiveTaxableMax")] = None + level_four_agency_xref: Annotated[str | None, Field(alias="levelFourAgencyXref")] = None """ Max length: 100; """ - level_one_services_flag: bool | None = Field( - default=None, alias="levelOneServicesFlag" - ) - level_one_expenses_flag: bool | None = Field( - default=None, alias="levelOneExpensesFlag" - ) - level_one_products_flag: bool | None = Field( - default=None, alias="levelOneProductsFlag" - ) - level_one_apply_single_unit_flag: bool | None = Field( - default=None, alias="levelOneApplySingleUnitFlag" - ) - level_one_apply_single_unit_min: float | None = Field( - default=None, alias="levelOneApplySingleUnitMin" - ) - level_one_apply_single_unit_max: float | None = Field( - default=None, alias="levelOneApplySingleUnitMax" - ) - level_two_rate: float | None = Field(default=None, alias="levelTwoRate") - level_two_rate_type: Literal["Amount", "Percent"] | None = Field( - default=None, alias="levelTwoRateType" - ) - level_two_taxable_max: float | None = Field( - default=None, alias="levelTwoTaxableMax" - ) - level_two_caption: str | None = Field(default=None, alias="levelTwoCaption") + level_four_apply_single_unit_flag: Annotated[bool | None, Field(alias="levelFourApplySingleUnitFlag")] = None + level_four_apply_single_unit_max: Annotated[float | None, Field(alias="levelFourApplySingleUnitMax")] = None + level_four_apply_single_unit_min: Annotated[float | None, Field(alias="levelFourApplySingleUnitMin")] = None + level_four_caption: Annotated[str | None, Field(alias="levelFourCaption")] = None """ Max length: 25; """ - level_two_tax_code_xref: str | None = Field( - default=None, alias="levelTwoTaxCodeXref" - ) + level_four_expenses_flag: Annotated[bool | None, Field(alias="levelFourExpensesFlag")] = None + level_four_products_flag: Annotated[bool | None, Field(alias="levelFourProductsFlag")] = None + level_four_rate: Annotated[float | None, Field(alias="levelFourRate")] = None + level_four_rate_type: Annotated[Literal["Amount", "Percent"] | None, Field(alias="levelFourRateType")] = None + level_four_services_flag: Annotated[bool | None, Field(alias="levelFourServicesFlag")] = None + level_four_tax_code_xref: Annotated[str | None, Field(alias="levelFourTaxCodeXref")] = None """ Max length: 50; """ - level_two_agency_xref: str | None = Field(default=None, alias="levelTwoAgencyXref") + level_four_taxable_max: Annotated[float | None, Field(alias="levelFourTaxableMax")] = None + level_one_agency_xref: Annotated[str | None, Field(alias="levelOneAgencyXref")] = None """ Max length: 100; """ - level_two_services_flag: bool | None = Field( - default=None, alias="levelTwoServicesFlag" - ) - level_two_expenses_flag: bool | None = Field( - default=None, alias="levelTwoExpensesFlag" - ) - level_two_products_flag: bool | None = Field( - default=None, alias="levelTwoProductsFlag" - ) - level_two_apply_single_unit_flag: bool | None = Field( - default=None, alias="levelTwoApplySingleUnitFlag" - ) - level_two_apply_single_unit_min: float | None = Field( - default=None, alias="levelTwoApplySingleUnitMin" - ) - level_two_apply_single_unit_max: float | None = Field( - default=None, alias="levelTwoApplySingleUnitMax" - ) - level_three_rate: float | None = Field(default=None, alias="levelThreeRate") - level_three_rate_type: Literal["Amount", "Percent"] | None = Field( - default=None, alias="levelThreeRateType" - ) - level_three_taxable_max: float | None = Field( - default=None, alias="levelThreeTaxableMax" - ) - level_three_caption: str | None = Field(default=None, alias="levelThreeCaption") + level_one_apply_single_unit_flag: Annotated[bool | None, Field(alias="levelOneApplySingleUnitFlag")] = None + level_one_apply_single_unit_max: Annotated[float | None, Field(alias="levelOneApplySingleUnitMax")] = None + level_one_apply_single_unit_min: Annotated[float | None, Field(alias="levelOneApplySingleUnitMin")] = None + level_one_caption: Annotated[str | None, Field(alias="levelOneCaption")] = None """ Max length: 25; """ - level_three_tax_code_xref: str | None = Field( - default=None, alias="levelThreeTaxCodeXref" - ) + level_one_expenses_flag: Annotated[bool | None, Field(alias="levelOneExpensesFlag")] = None + level_one_products_flag: Annotated[bool | None, Field(alias="levelOneProductsFlag")] = None + level_one_rate: Annotated[float | None, Field(alias="levelOneRate")] = None + level_one_rate_type: Annotated[Literal["Amount", "Percent"] | None, Field(alias="levelOneRateType")] = None + level_one_services_flag: Annotated[bool | None, Field(alias="levelOneServicesFlag")] = None + level_one_tax_code_xref: Annotated[str | None, Field(alias="levelOneTaxCodeXref")] = None """ Max length: 50; """ - level_three_agency_xref: str | None = Field( - default=None, alias="levelThreeAgencyXref" - ) + level_one_taxable_max: Annotated[float | None, Field(alias="levelOneTaxableMax")] = None + level_six_agency_xref: Annotated[str | None, Field(alias="levelSixAgencyXref")] = None """ Max length: 100; """ - level_three_services_flag: bool | None = Field( - default=None, alias="levelThreeServicesFlag" - ) - level_three_expenses_flag: bool | None = Field( - default=None, alias="levelThreeExpensesFlag" - ) - level_three_products_flag: bool | None = Field( - default=None, alias="levelThreeProductsFlag" - ) - level_three_apply_single_unit_flag: bool | None = Field( - default=None, alias="levelThreeApplySingleUnitFlag" - ) - level_three_apply_single_unit_min: float | None = Field( - default=None, alias="levelThreeApplySingleUnitMin" - ) - level_three_apply_single_unit_max: float | None = Field( - default=None, alias="levelThreeApplySingleUnitMax" - ) - level_four_rate: float | None = Field(default=None, alias="levelFourRate") - level_four_rate_type: Literal["Amount", "Percent"] | None = Field( - default=None, alias="levelFourRateType" - ) - level_four_taxable_max: float | None = Field( - default=None, alias="levelFourTaxableMax" - ) - level_four_caption: str | None = Field(default=None, alias="levelFourCaption") + level_six_apply_single_unit_flag: Annotated[bool | None, Field(alias="levelSixApplySingleUnitFlag")] = None + level_six_apply_single_unit_max: Annotated[float | None, Field(alias="levelSixApplySingleUnitMax")] = None + level_six_apply_single_unit_min: Annotated[float | None, Field(alias="levelSixApplySingleUnitMin")] = None + level_six_caption: Annotated[str | None, Field(alias="levelSixCaption")] = None """ Max length: 25; """ - level_four_tax_code_xref: str | None = Field( - default=None, alias="levelFourTaxCodeXref" - ) + level_six_expenses_flag: Annotated[bool | None, Field(alias="levelSixExpensesFlag")] = None + level_six_products_flag: Annotated[bool | None, Field(alias="levelSixProductsFlag")] = None + level_six_rate: Annotated[float | None, Field(alias="levelSixRate")] = None + level_six_rate_type: Annotated[Literal["Amount", "Percent"] | None, Field(alias="levelSixRateType")] = None + level_six_services_flag: Annotated[bool | None, Field(alias="levelSixServicesFlag")] = None + level_six_tax_code_xref: Annotated[str | None, Field(alias="levelSixTaxCodeXref")] = None """ Max length: 50; """ - level_four_agency_xref: str | None = Field( - default=None, alias="levelFourAgencyXref" - ) + level_six_taxable_max: Annotated[float | None, Field(alias="levelSixTaxableMax")] = None + level_three_agency_xref: Annotated[str | None, Field(alias="levelThreeAgencyXref")] = None """ Max length: 100; """ - level_four_services_flag: bool | None = Field( - default=None, alias="levelFourServicesFlag" - ) - level_four_expenses_flag: bool | None = Field( - default=None, alias="levelFourExpensesFlag" - ) - level_four_products_flag: bool | None = Field( - default=None, alias="levelFourProductsFlag" - ) - level_four_apply_single_unit_flag: bool | None = Field( - default=None, alias="levelFourApplySingleUnitFlag" - ) - level_four_apply_single_unit_min: float | None = Field( - default=None, alias="levelFourApplySingleUnitMin" - ) - level_four_apply_single_unit_max: float | None = Field( - default=None, alias="levelFourApplySingleUnitMax" - ) - level_five_rate: float | None = Field(default=None, alias="levelFiveRate") - level_five_rate_type: Literal["Amount", "Percent"] | None = Field( - default=None, alias="levelFiveRateType" - ) - level_five_taxable_max: float | None = Field( - default=None, alias="levelFiveTaxableMax" - ) - level_five_caption: str | None = Field(default=None, alias="levelFiveCaption") + level_three_apply_single_unit_flag: Annotated[bool | None, Field(alias="levelThreeApplySingleUnitFlag")] = None + level_three_apply_single_unit_max: Annotated[float | None, Field(alias="levelThreeApplySingleUnitMax")] = None + level_three_apply_single_unit_min: Annotated[float | None, Field(alias="levelThreeApplySingleUnitMin")] = None + level_three_caption: Annotated[str | None, Field(alias="levelThreeCaption")] = None """ Max length: 25; """ - level_five_tax_code_xref: str | None = Field( - default=None, alias="levelFiveTaxCodeXref" - ) + level_three_expenses_flag: Annotated[bool | None, Field(alias="levelThreeExpensesFlag")] = None + level_three_products_flag: Annotated[bool | None, Field(alias="levelThreeProductsFlag")] = None + level_three_rate: Annotated[float | None, Field(alias="levelThreeRate")] = None + level_three_rate_type: Annotated[Literal["Amount", "Percent"] | None, Field(alias="levelThreeRateType")] = None + level_three_services_flag: Annotated[bool | None, Field(alias="levelThreeServicesFlag")] = None + level_three_tax_code_xref: Annotated[str | None, Field(alias="levelThreeTaxCodeXref")] = None """ Max length: 50; """ - level_five_agency_xref: str | None = Field( - default=None, alias="levelFiveAgencyXref" - ) + level_three_taxable_max: Annotated[float | None, Field(alias="levelThreeTaxableMax")] = None + level_two_agency_xref: Annotated[str | None, Field(alias="levelTwoAgencyXref")] = None """ Max length: 100; """ - level_five_services_flag: bool | None = Field( - default=None, alias="levelFiveServicesFlag" - ) - level_five_expenses_flag: bool | None = Field( - default=None, alias="levelFiveExpensesFlag" - ) - level_five_products_flag: bool | None = Field( - default=None, alias="levelFiveProductsFlag" - ) - level_five_apply_single_unit_flag: bool | None = Field( - default=None, alias="levelFiveApplySingleUnitFlag" - ) - level_five_apply_single_unit_min: float | None = Field( - default=None, alias="levelFiveApplySingleUnitMin" - ) - level_five_apply_single_unit_max: float | None = Field( - default=None, alias="levelFiveApplySingleUnitMax" - ) - level_six_rate: float | None = Field(default=None, alias="levelSixRate") - level_six_rate_type: Literal["Amount", "Percent"] | None = Field( - default=None, alias="levelSixRateType" - ) - level_six_taxable_max: float | None = Field( - default=None, alias="levelSixTaxableMax" - ) - level_six_caption: str | None = Field(default=None, alias="levelSixCaption") + level_two_apply_single_unit_flag: Annotated[bool | None, Field(alias="levelTwoApplySingleUnitFlag")] = None + level_two_apply_single_unit_max: Annotated[float | None, Field(alias="levelTwoApplySingleUnitMax")] = None + level_two_apply_single_unit_min: Annotated[float | None, Field(alias="levelTwoApplySingleUnitMin")] = None + level_two_caption: Annotated[str | None, Field(alias="levelTwoCaption")] = None """ Max length: 25; """ - level_six_tax_code_xref: str | None = Field( - default=None, alias="levelSixTaxCodeXref" - ) + level_two_expenses_flag: Annotated[bool | None, Field(alias="levelTwoExpensesFlag")] = None + level_two_products_flag: Annotated[bool | None, Field(alias="levelTwoProductsFlag")] = None + level_two_rate: Annotated[float | None, Field(alias="levelTwoRate")] = None + level_two_rate_type: Annotated[Literal["Amount", "Percent"] | None, Field(alias="levelTwoRateType")] = None + level_two_services_flag: Annotated[bool | None, Field(alias="levelTwoServicesFlag")] = None + level_two_tax_code_xref: Annotated[str | None, Field(alias="levelTwoTaxCodeXref")] = None """ Max length: 50; """ - level_six_agency_xref: str | None = Field(default=None, alias="levelSixAgencyXref") + level_two_taxable_max: Annotated[float | None, Field(alias="levelTwoTaxableMax")] = None + product_type_ids: Annotated[list[int] | None, Field(alias="productTypeIds")] = None """ - Max length: 100; + Array of product type exemptions for the tax code + """ + remove_all_expense_types: Annotated[bool | None, Field(alias="removeAllExpenseTypes")] = None + remove_all_product_types: Annotated[bool | None, Field(alias="removeAllProductTypes")] = None + remove_all_work_roles: Annotated[bool | None, Field(alias="removeAllWorkRoles")] = None + work_role_ids: Annotated[list[int] | None, Field(alias="workRoleIds")] = None + """ + Array of work role exemptions for the tax code """ - level_six_services_flag: bool | None = Field( - default=None, alias="levelSixServicesFlag" - ) - level_six_expenses_flag: bool | None = Field( - default=None, alias="levelSixExpensesFlag" - ) - level_six_products_flag: bool | None = Field( - default=None, alias="levelSixProductsFlag" - ) - level_six_apply_single_unit_flag: bool | None = Field( - default=None, alias="levelSixApplySingleUnitFlag" - ) - level_six_apply_single_unit_min: float | None = Field( - default=None, alias="levelSixApplySingleUnitMin" - ) - level_six_apply_single_unit_max: float | None = Field( - default=None, alias="levelSixApplySingleUnitMax" - ) - work_role_ids: list[int] | None = Field(default=None, alias="workRoleIds") - """ - Array of work role exemptions for the tax code. - """ - add_all_work_roles: bool | None = Field(default=None, alias="addAllWorkRoles") - remove_all_work_roles: bool | None = Field(default=None, alias="removeAllWorkRoles") - expense_type_ids: list[int] | None = Field(default=None, alias="expenseTypeIds") - """ - Array of expense type exemptions for the tax code. - """ - add_all_expense_types: bool | None = Field(default=None, alias="addAllExpenseTypes") - remove_all_expense_types: bool | None = Field( - default=None, alias="removeAllExpenseTypes" - ) - product_type_ids: list[int] | None = Field(default=None, alias="productTypeIds") - """ - Array of product type exemptions for the tax code. - """ - add_all_product_types: bool | None = Field(default=None, alias="addAllProductTypes") - remove_all_product_types: bool | None = Field( - default=None, alias="removeAllProductTypes" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class TaxCodeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + cancel_date: Annotated[datetime | None, Field(alias="cancelDate")] = None + description: str | None = None + effective_date: Annotated[datetime | None, Field(alias="effectiveDate")] = None id: int | None = None identifier: str | None = None - description: str | None = None - effective_date: str | None = Field(default=None, alias="effectiveDate") - cancel_date: str | None = Field(default=None, alias="cancelDate") - info: dict[str, str] | None = Field(default=None, alias="_info") class TaxCodeLevel(ConnectWiseModel): - id: int | None = None - tax_level: int | None = Field(default=None, alias="taxLevel") - tax_rate: float = Field(..., alias="taxRate") - rate_type: Literal["Amount", "Percent"] = Field(..., alias="rateType") - taxable_max: float | None = Field(default=None, alias="taxableMax") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agency_xref: Annotated[str | None, Field(alias="agencyXref")] = None + """ + Max length: 100; + """ caption: str | None = None """ Max length: 25; """ - tax_code_xref: str | None = Field(default=None, alias="taxCodeXref") + id: int | None = None + rate_type: Annotated[Literal["Amount", "Percent"], Field(alias="rateType")] + single_unit_flag: Annotated[bool | None, Field(alias="singleUnitFlag")] = None + single_unit_maximum: Annotated[float | None, Field(alias="singleUnitMaximum")] = None + single_unit_minimum: Annotated[float | None, Field(alias="singleUnitMinimum")] = None + tax_code_xref: Annotated[str | None, Field(alias="taxCodeXref")] = None """ Max length: 50; """ - agency_xref: str | None = Field(default=None, alias="agencyXref") - """ - Max length: 100; - """ - tax_services_flag: bool | None = Field(default=None, alias="taxServicesFlag") - tax_expenses_flag: bool | None = Field(default=None, alias="taxExpensesFlag") - tax_products_flag: bool | None = Field(default=None, alias="taxProductsFlag") - single_unit_flag: bool | None = Field(default=None, alias="singleUnitFlag") - single_unit_minimum: float | None = Field(default=None, alias="singleUnitMinimum") - single_unit_maximum: float | None = Field(default=None, alias="singleUnitMaximum") - info: dict[str, str] | None = Field(default=None, alias="_info") + tax_expenses_flag: Annotated[bool | None, Field(alias="taxExpensesFlag")] = None + tax_level: Annotated[int | None, Field(alias="taxLevel")] = None + tax_products_flag: Annotated[bool | None, Field(alias="taxProductsFlag")] = None + tax_rate: Annotated[float, Field(alias="taxRate")] + tax_services_flag: Annotated[bool | None, Field(alias="taxServicesFlag")] = None + taxable_max: Annotated[float | None, Field(alias="taxableMax")] = None class TaxCodeLevelReference(ActivityReference): @@ -6046,130 +4990,126 @@ class TaxCodeReference(ActivityReference): class TaxCodeXRef(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None description: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - level_one: Literal["NonTaxable", "Taxable"] | None = Field( - default=None, alias="levelOne" - ) - level_two: Literal["NonTaxable", "Taxable"] | None = Field( - default=None, alias="levelTwo" - ) - level_three: Literal["NonTaxable", "Taxable"] | None = Field( - default=None, alias="levelThree" - ) - level_four: Literal["NonTaxable", "Taxable"] | None = Field( - default=None, alias="levelFour" - ) - level_five: Literal["NonTaxable", "Taxable"] | None = Field( - default=None, alias="levelFive" - ) - level_six: Literal["NonTaxable", "Taxable"] | None = Field( - default=None, alias="levelSix" - ) - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - taxable_levels: list[int] | None = Field(default=None, alias="taxableLevels") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + level_five: Annotated[Literal["NonTaxable", "Taxable"] | None, Field(alias="levelFive")] = None + level_four: Annotated[Literal["NonTaxable", "Taxable"] | None, Field(alias="levelFour")] = None + level_one: Annotated[Literal["NonTaxable", "Taxable"] | None, Field(alias="levelOne")] = None + level_six: Annotated[Literal["NonTaxable", "Taxable"] | None, Field(alias="levelSix")] = None + level_three: Annotated[Literal["NonTaxable", "Taxable"] | None, Field(alias="levelThree")] = None + level_two: Annotated[Literal["NonTaxable", "Taxable"] | None, Field(alias="levelTwo")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + taxable_levels: Annotated[list[int] | None, Field(alias="taxableLevels")] = None class TaxIntegration(ConnectWiseModel): - tax_integration_type: Literal["Avalara"] | None = Field( - default=None, alias="taxIntegrationType" - ) - id: int | None = None - account_number: str | None = Field(default=None, alias="accountNumber") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None """ Max length: 50; """ - license_key: str | None = Field(default=None, alias="licenseKey") + accounting_integration_flag: Annotated[bool | None, Field(alias="accountingIntegrationFlag")] = None + commit_transactions_flag: Annotated[bool | None, Field(alias="commitTransactionsFlag")] = None + company_code: Annotated[str | None, Field(alias="companyCode")] = None """ Max length: 50; """ - service_url: str | None = Field(default=None, alias="serviceUrl") + enabled_flag: Annotated[bool | None, Field(alias="enabledFlag")] = None + expense_tax_code: Annotated[str | None, Field(alias="expenseTaxCode")] = None """ - Max length: 250; + Max length: 50; """ - company_code: str | None = Field(default=None, alias="companyCode") + freight_tax_code: Annotated[str | None, Field(alias="freightTaxCode")] = None """ Max length: 50; """ - time_tax_code: str | None = Field(default=None, alias="timeTaxCode") + id: int | None = None + invoice_amount_tax_code: Annotated[str | None, Field(alias="invoiceAmountTaxCode")] = None """ Max length: 50; """ - expense_tax_code: str | None = Field(default=None, alias="expenseTaxCode") + license_key: Annotated[str | None, Field(alias="licenseKey")] = None """ Max length: 50; """ - product_tax_code: str | None = Field(default=None, alias="productTaxCode") + product_tax_code: Annotated[str | None, Field(alias="productTaxCode")] = None """ Max length: 50; """ - invoice_amount_tax_code: str | None = Field( - default=None, alias="invoiceAmountTaxCode" - ) + sales_invoice_flag: Annotated[bool | None, Field(alias="salesInvoiceFlag")] = None + service_url: Annotated[str | None, Field(alias="serviceUrl")] = None """ - Max length: 50; + Max length: 250; """ - enabled_flag: bool | None = Field(default=None, alias="enabledFlag") - commit_transactions_flag: bool | None = Field( - default=None, alias="commitTransactionsFlag" - ) - sales_invoice_flag: bool | None = Field(default=None, alias="salesInvoiceFlag") - freight_tax_code: str | None = Field(default=None, alias="freightTaxCode") + tax_integration_type: Annotated[Literal["Avalara"] | None, Field(alias="taxIntegrationType")] = None + tax_line_flag: Annotated[bool | None, Field(alias="taxLineFlag")] = None + time_tax_code: Annotated[str | None, Field(alias="timeTaxCode")] = None """ Max length: 50; """ - accounting_integration_flag: bool | None = Field( - default=None, alias="accountingIntegrationFlag" - ) - tax_line_flag: bool | None = Field(default=None, alias="taxLineFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class TaxIntegrationInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + enabled_flag: Annotated[bool | None, Field(alias="enabledFlag")] = None + id: int | None = None + tax_integration_type: Annotated[Literal["Avalara"] | None, Field(alias="taxIntegrationType")] = None + + +class TaxableExpenseTypeLevel(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - enabled_flag: bool | None = Field(default=None, alias="enabledFlag") - tax_integration_type: Literal["Avalara"] | None = Field( - default=None, alias="taxIntegrationType" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + tax_code_level: Annotated[TaxCodeLevelReference | None, Field(alias="taxCodeLevel")] = None + + +class TaxableProductTypeLevel(TaxableExpenseTypeLevel): + pass + + +class TaxableWorkRoleLevel(TaxableExpenseTypeLevel): + pass + + +class TaxableXRefLevel(TaxableExpenseTypeLevel): + pass class Team(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + commission_percent: Annotated[int | None, Field(alias="commissionPercent")] = None id: int | None = None - type: Literal["Individual", "Team"] member: MemberReference | None = None - sales_team: SalesTeamReference | None = Field(default=None, alias="salesTeam") - commission_percent: int | None = Field(default=None, alias="commissionPercent") - referral_flag: bool | None = Field(default=None, alias="referralFlag") - opportunity_id: int | None = Field(default=None, alias="opportunityId") - responsible_flag: bool | None = Field(default=None, alias="responsibleFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + opportunity_id: Annotated[int | None, Field(alias="opportunityId")] = None + referral_flag: Annotated[bool | None, Field(alias="referralFlag")] = None + responsible_flag: Annotated[bool | None, Field(alias="responsibleFlag")] = None + sales_team: Annotated[SalesTeamReference | None, Field(alias="salesTeam")] = None + type: Literal["Individual", "Team"] class TeamMember(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None board: BoardReference | None = None - team: ServiceTeamReference | None = None + id: int | None = None member: MemberReference | None = None - team_leader_flag: bool | None = Field(default=None, alias="teamLeaderFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + team: ServiceTeamReference | None = None + team_leader_flag: Annotated[bool | None, Field(alias="teamLeaderFlag")] = None class TeamRole(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_manager_flag: Annotated[bool | None, Field(alias="accountManagerFlag")] = None id: int | None = None name: str """ Max length: 20; """ - account_manager_flag: bool | None = Field(default=None, alias="accountManagerFlag") - tech_flag: bool | None = Field(default=None, alias="techFlag") - sales_flag: bool | None = Field(default=None, alias="salesFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + sales_flag: Annotated[bool | None, Field(alias="salesFlag")] = None + tech_flag: Annotated[bool | None, Field(alias="techFlag")] = None class TeamRoleInfo(ActivityReference): @@ -6181,151 +5121,112 @@ class TeamRoleReference(ActivityReference): class TemplateGeneratedCountsModel(ConnectWiseModel): - service_count: int | None = Field(default=None, alias="serviceCount") - schedule_count: int | None = Field(default=None, alias="scheduleCount") + schedule_count: Annotated[int | None, Field(alias="scheduleCount")] = None + service_count: Annotated[int | None, Field(alias="serviceCount")] = None class TicketBundle(ConnectWiseModel): - child_ticket_ids: list[int] | None = Field(default=None, alias="childTicketIds") + child_ticket_ids: Annotated[list[int] | None, Field(alias="childTicketIds")] = None class TicketInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None id: int | None = None summary: str | None = None - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class TicketMerge(ConnectWiseModel): - merge_ticket_ids: list[int] = Field(..., alias="mergeTicketIds") + merge_ticket_ids: Annotated[list[int], Field(alias="mergeTicketIds")] status: ServiceStatusReference | None = None class TicketNote(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + contact: ContactReference | None = None + customer_updated_flag: Annotated[bool | None, Field(alias="customerUpdatedFlag")] = None + detail_description_flag: Annotated[bool | None, Field(alias="detailDescriptionFlag")] = None + external_flag: Annotated[bool | None, Field(alias="externalFlag")] = None id: int | None = None - ticket_id: int | None = Field(default=None, alias="ticketId") - text: str | None = None - detail_description_flag: bool | None = Field( - default=None, alias="detailDescriptionFlag" - ) - internal_analysis_flag: bool | None = Field( - default=None, alias="internalAnalysisFlag" - ) - resolution_flag: bool | None = Field(default=None, alias="resolutionFlag") - issue_flag: bool | None = Field(default=None, alias="issueFlag") + internal_analysis_flag: Annotated[bool | None, Field(alias="internalAnalysisFlag")] = None + internal_flag: Annotated[bool | None, Field(alias="internalFlag")] = None + issue_flag: Annotated[bool | None, Field(alias="issueFlag")] = None member: MemberReference | None = None - contact: ContactReference | None = None - customer_updated_flag: bool | None = Field( - default=None, alias="customerUpdatedFlag" - ) - process_notifications: bool | None = Field( - default=None, alias="processNotifications" - ) - internal_flag: bool | None = Field(default=None, alias="internalFlag") - external_flag: bool | None = Field(default=None, alias="externalFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + process_notifications: Annotated[bool | None, Field(alias="processNotifications")] = None + resolution_flag: Annotated[bool | None, Field(alias="resolutionFlag")] = None + text: str | None = None + ticket_id: Annotated[int | None, Field(alias="ticketId")] = None class TicketReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None summary: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class TicketSync(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None id: int | None = None + integrator_login: Annotated[IntegratorLoginReference | None, Field(alias="integratorLogin")] = None + internal_analysis_flag: Annotated[bool | None, Field(alias="internalAnalysisFlag")] = None name: str """ Max length: 80; """ - vendor_type: Literal["Zenith"] = Field(..., alias="vendorType") - integrator_login: IntegratorLoginReference | None = Field( - default=None, alias="integratorLogin" - ) - company: CompanyReference | None = None - url: str - user_name: str | None = Field(default=None, alias="userName") password: str | None = None + problem_description_flag: Annotated[bool | None, Field(alias="problemDescriptionFlag")] = None psg: str | None = None - problem_description_flag: bool | None = Field( - default=None, alias="problemDescriptionFlag" - ) - internal_analysis_flag: bool | None = Field( - default=None, alias="internalAnalysisFlag" - ) - resolution_flag: bool | None = Field(default=None, alias="resolutionFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + resolution_flag: Annotated[bool | None, Field(alias="resolutionFlag")] = None + url: str + user_name: Annotated[str | None, Field(alias="userName")] = None + vendor_type: Annotated[Literal["Zenith"], Field(alias="vendorType")] -class TicketTask(ConnectWiseModel): - id: int | None = None - ticket_id: int | None = Field(default=None, alias="ticketId") - notes: str | None = None - closed_flag: bool | None = Field(default=None, alias="closedFlag") - priority: int | None = None - schedule: ScheduleEntryReference | None = None - code: ServiceCodeReference | None = None - resolution: str | None = None - summary: str | None = None - child_schedule_action: Literal["Transfer", "Delete", "Done"] | None = Field( - default=None, alias="childScheduleAction" - ) - child_ticket_id: int | None = Field(default=None, alias="childTicketId") - info: dict[str, str] | None = Field(default=None, alias="_info") +class TicketTask(Task): + pass class TimeAccrual(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + holiday_available_type: Annotated[ + Literal["AnniversaryYear", "CalendarYear"] | None, Field(alias="holidayAvailableType") + ] = None + holiday_carryover_allowed_flag: Annotated[bool | None, Field(alias="holidayCarryoverAllowedFlag")] = None + holiday_carryover_limit: Annotated[float | None, Field(alias="holidayCarryoverLimit")] = None + holiday_flag: Annotated[bool | None, Field(alias="holidayFlag")] = None + """ + if holidayFlag is set to false, system will clear out or ignore the values of holidayAvailableType, holidayCarryoverAllowedFlag, holidayCarryoverLimit + """ id: int | None = None location: SystemLocationReference | None = None - vacation_flag: bool | None = Field(default=None, alias="vacationFlag") + pto_available_type: Annotated[ + Literal["AnniversaryYear", "CalendarYear"] | None, Field(alias="ptoAvailableType") + ] = None + pto_carryover_allowed_flag: Annotated[bool | None, Field(alias="ptoCarryoverAllowedFlag")] = None + pto_carryover_limit: Annotated[float | None, Field(alias="ptoCarryoverLimit")] = None + pto_flag: Annotated[bool | None, Field(alias="ptoFlag")] = None """ - if vacationFlag is set to false, system will clear out or ingore the values of vacationAvailableType, vacationCarryoverAllowedFlag, vacationCarryoverLimit + if ptoFlag is set to false, system will clear out or ignore the values of ptoAvailableType, ptoCarryoverAllowedFlag, ptoCarryoverLimit """ - vacation_available_type: Literal["AnniversaryYear", "CalendarYear"] | None = Field( - default=None, alias="vacationAvailableType" - ) - vacation_carryover_allowed_flag: bool | None = Field( - default=None, alias="vacationCarryoverAllowedFlag" - ) - vacation_carryover_limit: float | None = Field( - default=None, alias="vacationCarryoverLimit" - ) - sick_flag: bool | None = Field(default=None, alias="sickFlag") + sick_available_type: Annotated[ + Literal["AnniversaryYear", "CalendarYear"] | None, Field(alias="sickAvailableType") + ] = None + sick_carryover_allowed_flag: Annotated[bool | None, Field(alias="sickCarryoverAllowedFlag")] = None + sick_carryover_limit: Annotated[float | None, Field(alias="sickCarryoverLimit")] = None + sick_flag: Annotated[bool | None, Field(alias="sickFlag")] = None """ if sickFlag is set to false, system will clear out or ignore the values of sickAvailableType, sickCarryoverAllowedFlag, sickCarryoverLimit """ - sick_available_type: Literal["AnniversaryYear", "CalendarYear"] | None = Field( - default=None, alias="sickAvailableType" - ) - sick_carryover_allowed_flag: bool | None = Field( - default=None, alias="sickCarryoverAllowedFlag" - ) - sick_carryover_limit: float | None = Field(default=None, alias="sickCarryoverLimit") - pto_flag: bool | None = Field(default=None, alias="ptoFlag") - """ - if ptoFlag is set to false, system will clear out or ignore the values of ptoAvailableType, ptoCarryoverAllowedFlag, ptoCarryoverLimit - """ - pto_available_type: Literal["AnniversaryYear", "CalendarYear"] | None = Field( - default=None, alias="ptoAvailableType" - ) - pto_carryover_allowed_flag: bool | None = Field( - default=None, alias="ptoCarryoverAllowedFlag" - ) - pto_carryover_limit: float | None = Field(default=None, alias="ptoCarryoverLimit") - holiday_flag: bool | None = Field(default=None, alias="holidayFlag") + vacation_available_type: Annotated[ + Literal["AnniversaryYear", "CalendarYear"] | None, Field(alias="vacationAvailableType") + ] = None + vacation_carryover_allowed_flag: Annotated[bool | None, Field(alias="vacationCarryoverAllowedFlag")] = None + vacation_carryover_limit: Annotated[float | None, Field(alias="vacationCarryoverLimit")] = None + vacation_flag: Annotated[bool | None, Field(alias="vacationFlag")] = None """ - if holidayFlag is set to false, system will clear out or ignore the values of holidayAvailableType, holidayCarryoverAllowedFlag, holidayCarryoverLimit + if vacationFlag is set to false, system will clear out or ingore the values of vacationAvailableType, vacationCarryoverAllowedFlag, vacationCarryoverLimit """ - holiday_available_type: Literal["AnniversaryYear", "CalendarYear"] | None = Field( - default=None, alias="holidayAvailableType" - ) - holiday_carryover_allowed_flag: bool | None = Field( - default=None, alias="holidayCarryoverAllowedFlag" - ) - holiday_carryover_limit: float | None = Field( - default=None, alias="holidayCarryoverLimit" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class TimeAccrualReference(ActivityReference): @@ -6333,8 +5234,12 @@ class TimeAccrualReference(ActivityReference): class TimeEntryAudit(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None member: MemberReference | None = None + message: str | None = None + new_value: Annotated[str | None, Field(alias="newValue")] = None + old_value: Annotated[str | None, Field(alias="oldValue")] = None source: Literal[ "None", "Member", @@ -6405,7 +5310,6 @@ class TimeEntryAudit(ConnectWiseModel): "Agreement", "Addition", "Adjustment", - "Microsoft365", "API", "ProjectFinance", "CompanyProfile", @@ -6455,30 +5359,8 @@ class TimeEntryAudit(ConnectWiseModel): "TimeDiscussion", "TimeInternal", "TimeResolution", - "MemberTemplate", - "Delegation", - "Skill", - "Certification", - "Accrual", - "ApiKey", - "Login", - "Notifications", - "System", - "ServiceBoard", - "ProjectBoard", - "Scheduling", - "TimeBillingExpense", - "CRM", - "Procurement", - "JobRole", - "Details", - "Authentication", ] | None = None - message: str | None = None - old_value: str | None = Field(default=None, alias="oldValue") - new_value: str | None = Field(default=None, alias="newValue") value: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class TimeEntryReference(CalendarSetupReference): @@ -6486,72 +5368,52 @@ class TimeEntryReference(CalendarSetupReference): class TimeExpense(ConnectWiseModel): - id: int | None = None - tier1_approval_flag: bool | None = Field(default=None, alias="tier1ApprovalFlag") - tier2_approval_flag: bool | None = Field(default=None, alias="tier2ApprovalFlag") - disable_time_entry_flag: bool | None = Field( - default=None, alias="disableTimeEntryFlag" - ) - require_time_note_flag: bool | None = Field( - default=None, alias="requireTimeNoteFlag" - ) - require_expense_note_flag: bool | None = Field( - default=None, alias="requireExpenseNoteFlag" - ) - rounding_factor: float | None = Field(default=None, alias="roundingFactor") - invoice_start: int | None = Field(default=None, alias="invoiceStart") - default_special_invoice_type: Literal[ - "Agreement", - "CreditMemo", - "DownPayment", - "Miscellaneous", - "Progress", - "Standard", - ] | None = Field(default=None, alias="defaultSpecialInvoiceType") - internal_company: CompanyReference | None = Field( - default=None, alias="internalCompany" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_special_invoice_type: Annotated[ + Literal["Agreement", "CreditMemo", "DownPayment", "Miscellaneous", "Progress", "Standard"] | None, + Field(alias="defaultSpecialInvoiceType"), + ] = None + disable_time_entry_flag: Annotated[bool | None, Field(alias="disableTimeEntryFlag")] = None + id: int | None = None + internal_company: Annotated[CompanyReference | None, Field(alias="internalCompany")] = None + invoice_start: Annotated[int | None, Field(alias="invoiceStart")] = None + require_expense_note_flag: Annotated[bool | None, Field(alias="requireExpenseNoteFlag")] = None + require_time_note_flag: Annotated[bool | None, Field(alias="requireTimeNoteFlag")] = None + rounding_factor: Annotated[float | None, Field(alias="roundingFactor")] = None + tier1_approval_flag: Annotated[bool | None, Field(alias="tier1ApprovalFlag")] = None + tier2_approval_flag: Annotated[bool | None, Field(alias="tier2ApprovalFlag")] = None class TimePeriodSetup(ConnectWiseModel): - id: int | None = None - period_apply_to: Literal["Both", "Expense", "Time"] = Field( - ..., alias="periodApplyTo" - ) - year: int - number_future_periods: int = Field(..., alias="numberFuturePeriods") - type: Literal["Weekly", "BiWeekly", "SemiMonthly", "Monthly"] + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + days_past_end_date: Annotated[int, Field(alias="daysPastEndDate")] description: str | None = None """ Max length: 100; """ - first_period_end_date: date = Field(..., alias="firstPeriodEndDate") - monthly_period_ends: int | None = Field(default=None, alias="monthlyPeriodEnds") + first_period_end_date: Annotated[date, Field(alias="firstPeriodEndDate")] + id: int | None = None + last_day_flag: Annotated[bool | None, Field(alias="lastDayFlag")] = None """ Only needed when type is monthly """ - semi_monthly_first_period: int | None = Field( - default=None, alias="semiMonthlyFirstPeriod" - ) + monthly_period_ends: Annotated[int | None, Field(alias="monthlyPeriodEnds")] = None """ - Only needed when type is semi-monthly + Only needed when type is monthly """ - semi_monthly_second_period: int | None = Field( - default=None, alias="semiMonthlySecondPeriod" - ) + number_future_periods: Annotated[int, Field(alias="numberFuturePeriods")] + period_apply_to: Annotated[Literal["Both", "Expense", "Time"], Field(alias="periodApplyTo")] + semi_monthly_first_period: Annotated[int | None, Field(alias="semiMonthlyFirstPeriod")] = None """ Only needed when type is semi-monthly """ - semi_monthly_last_day_flag: bool | None = Field( - default=None, alias="semiMonthlyLastDayFlag" - ) - last_day_flag: bool | None = Field(default=None, alias="lastDayFlag") + semi_monthly_last_day_flag: Annotated[bool | None, Field(alias="semiMonthlyLastDayFlag")] = None + semi_monthly_second_period: Annotated[int | None, Field(alias="semiMonthlySecondPeriod")] = None """ - Only needed when type is monthly + Only needed when type is semi-monthly """ - days_past_end_date: int = Field(..., alias="daysPastEndDate") - info: dict[str, str] | None = Field(default=None, alias="_info") + type: Literal["Weekly", "BiWeekly", "SemiMonthly", "Monthly"] + year: int class TimePeriodSetupDefaults(GLExportSettings): @@ -6567,12 +5429,14 @@ class TimeRevenueReference(AgreementRevenueReference): class TimeSheet(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + date_end: Annotated[datetime | None, Field(alias="dateEnd")] = None + date_start: Annotated[datetime | None, Field(alias="dateStart")] = None + deadline: datetime | None = None + hours: float | None = None id: int | None = None member: MemberReference | None = None - year: int | None = None period: int | None = None - date_start: str | None = Field(default=None, alias="dateStart") - date_end: str | None = Field(default=None, alias="dateEnd") status: Literal[ "Open", "Rejected", @@ -6587,9 +5451,7 @@ class TimeSheet(ConnectWiseModel): "WrittenOff", "BilledAgreement", ] | None = None - hours: float | None = None - deadline: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + year: int | None = None class TimeSheetAudit(TimeEntryAudit): @@ -6600,8 +5462,23 @@ class TimeSheetReference(ActivityReference): pass -class TimeSheetTierUpdate(ExpenseReportTierUpdate): - pass +class TimeSheetTierUpdate(ConnectWiseModel): + approval_type: Annotated[ + Literal[ + "DataEntry", + "Tier1Update", + "Tier2Update", + "Billing", + "Service", + "Project", + "MonthlySummary", + "SalesActivity", + "Schedule", + ] + | None, + Field(alias="approvalType"), + ] = None + id: int | None = None class TimeZoneReference(ActivityReference): @@ -6609,35 +5486,33 @@ class TimeZoneReference(ActivityReference): class TimeZoneSetup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + daylight_savings_flag: Annotated[bool | None, Field(alias="daylightSavingsFlag")] = None + """ + Determined based on system library value for specified timeZone. + Not able to be used in query params at this time + """ + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + """ + Identifies the default system time zone setup + """ id: int | None = None name: str """ Max length: 50; """ - time_zone: TimeZoneReference | None = Field(default=None, alias="timeZone") offset: float | None = None """ The hours offset from UTC (+/-) """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - """ - Identifies the default system time zone setup - """ - daylight_savings_flag: bool | None = Field( - default=None, alias="daylightSavingsFlag" - ) - """ - Determined based on system library value for specified timeZone. - Not able to be used in query params at this time - """ - info: dict[str, str] | None = Field(default=None, alias="_info") + time_zone: Annotated[TimeZoneReference | None, Field(alias="timeZone")] = None class TimeZoneSetupInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None name: str | None = None offset: float | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class TimeZoneSetupReference(ActivityReference): @@ -6645,57 +5520,57 @@ class TimeZoneSetupReference(ActivityReference): class TodayPageCategory(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + location: SystemLocationReference | None = None name: str """ Max length: 30; """ - sort_order: int = Field(..., alias="sortOrder") - location: SystemLocationReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int, Field(alias="sortOrder")] class Token(ConnectWiseModel): - public_key: str | None = Field(default=None, alias="publicKey") - private_key: str | None = Field(default=None, alias="privateKey") expiration: str | None = None + private_key: Annotated[str | None, Field(alias="privateKey")] = None + public_key: Annotated[str | None, Field(alias="publicKey")] = None class Track(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 100; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - notify_action_ids: list[int] | None = Field(default=None, alias="notifyActionIds") - info: dict[str, str] | None = Field(default=None, alias="_info") + notify_action_ids: Annotated[list[int] | None, Field(alias="notifyActionIds")] = None class TrackReference(ActivityReference): pass -class TypeSubTypeCampaignSubType(ConnectWiseModel): +class TypeCampaignSubType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - type_id: int | None = Field(default=None, alias="typeId") name: str | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + type_id: Annotated[int | None, Field(alias="typeId")] = None class UnitOfMeasure(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - uom_schedule_xref: str | None = Field(default=None, alias="uomScheduleXref") + uom_schedule_xref: Annotated[str | None, Field(alias="uomScheduleXref")] = None """ Max length: 31; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class UnitOfMeasureReference(ActivityReference): @@ -6703,195 +5578,181 @@ class UnitOfMeasureReference(ActivityReference): class UnpostedExpense(ConnectWiseModel): - id: int | None = None - location_id: int | None = Field(default=None, alias="locationId") - department_id: int | None = Field(default=None, alias="departmentId") - company: CompanyReference | None = None - account_number: str | None = Field(default=None, alias="accountNumber") - credit_account: str | None = Field(default=None, alias="creditAccount") - expense_detail_id: int | None = Field(default=None, alias="expenseDetailId") - expense_type: ExpenseTypeReference | None = Field(default=None, alias="expenseType") - classification: Literal["NonReimbursable", "Reimbursable", "Personal"] | None = None - gl_type: Literal[ - "AP", - "AR", - "EE", - "EI", - "EO", - "IA", - "IT", - "P", - "PF", - "R", - "RA", - "RD", - "RE", - "RP", - "ST", - "SD", - "ET", - "FT", - "PT", - "WP", - "WR", - ] | None = Field(default=None, alias="glType") - member: MemberReference | None = None - date_expense: str | None = Field(default=None, alias="dateExpense") - charge_code: ChargeCodeReference | None = Field(default=None, alias="chargeCode") - charge_description: str | None = Field(default=None, alias="chargeDescription") - in_policy: bool | None = Field(default=None, alias="inPolicy") - payment_method: PaymentMethodReference | None = Field( - default=None, alias="paymentMethod" - ) - currency: CurrencyReference | None = None - total: float | None = None - billable_amount: float | None = Field(default=None, alias="billableAmount") - non_billable_amount: float | None = Field(default=None, alias="nonBillableAmount") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None agreement: AgreementReference | None = None - agreement_amount_covered: float | None = Field( - default=None, alias="agreementAmountCovered" - ) - ticket: TicketReference | None = None - project: ProjectReference | None = None - project_phase: ProjectPhaseReference | None = Field( - default=None, alias="projectPhase" - ) - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - avalara_tax_flag: bool | None = Field(default=None, alias="avalaraTaxFlag") + agreement_amount_covered: Annotated[float | None, Field(alias="agreementAmountCovered")] = None + avalara_tax_flag: Annotated[bool | None, Field(alias="avalaraTaxFlag")] = None """ Used to determine if Avalara tax is enabled. """ - item_taxable_flag: bool | None = Field(default=None, alias="itemTaxableFlag") - sales_tax_amount: float | None = Field(default=None, alias="salesTaxAmount") - state_tax_flag: bool | None = Field(default=None, alias="stateTaxFlag") + billable_amount: Annotated[float | None, Field(alias="billableAmount")] = None + charge_code: Annotated[ChargeCodeReference | None, Field(alias="chargeCode")] = None + charge_description: Annotated[str | None, Field(alias="chargeDescription")] = None + city_tax_amount: Annotated[float | None, Field(alias="cityTaxAmount")] = None + city_tax_flag: Annotated[bool | None, Field(alias="cityTaxFlag")] = None """ - Set to true if transaction is taxable at the state level. - """ - state_tax_xref: str | None = Field(default=None, alias="stateTaxXref") - state_tax_amount: float | None = Field(default=None, alias="stateTaxAmount") - county_tax_flag: bool | None = Field(default=None, alias="countyTaxFlag") - """ - Set to true if transaction is taxable at the county level. + Set to true if transaction is taxable at the city level. """ - county_tax_xref: str | None = Field(default=None, alias="countyTaxXref") - county_tax_amount: float | None = Field(default=None, alias="countyTaxAmount") - city_tax_flag: bool | None = Field(default=None, alias="cityTaxFlag") + city_tax_xref: Annotated[str | None, Field(alias="cityTaxXref")] = None + classification: Literal["NonReimbursable", "Reimbursable", "Personal"] | None = None + company: CompanyReference | None = None + composite_tax_amount: Annotated[float | None, Field(alias="compositeTaxAmount")] = None + composite_tax_flag: Annotated[bool | None, Field(alias="compositeTaxFlag")] = None """ - Set to true if transaction is taxable at the city level. + Set to true if transaction is taxable at the composite level. """ - city_tax_xref: str | None = Field(default=None, alias="cityTaxXref") - city_tax_amount: float | None = Field(default=None, alias="cityTaxAmount") - country_tax_flag: bool | None = Field(default=None, alias="countryTaxFlag") + composite_tax_xref: Annotated[str | None, Field(alias="compositeTaxXref")] = None + country_tax_amount: Annotated[float | None, Field(alias="countryTaxAmount")] = None + country_tax_flag: Annotated[bool | None, Field(alias="countryTaxFlag")] = None """ Set to true if transaction is taxable at the country level. """ - country_tax_xref: str | None = Field(default=None, alias="countryTaxXref") - country_tax_amount: float | None = Field(default=None, alias="countryTaxAmount") - composite_tax_flag: bool | None = Field(default=None, alias="compositeTaxFlag") + country_tax_xref: Annotated[str | None, Field(alias="countryTaxXref")] = None + county_tax_amount: Annotated[float | None, Field(alias="countyTaxAmount")] = None + county_tax_flag: Annotated[bool | None, Field(alias="countyTaxFlag")] = None """ - Set to true if transaction is taxable at the composite level. + Set to true if transaction is taxable at the county level. """ - composite_tax_xref: str | None = Field(default=None, alias="compositeTaxXref") - composite_tax_amount: float | None = Field(default=None, alias="compositeTaxAmount") - level_six_tax_flag: bool | None = Field(default=None, alias="levelSixTaxFlag") + county_tax_xref: Annotated[str | None, Field(alias="countyTaxXref")] = None + credit_account: Annotated[str | None, Field(alias="creditAccount")] = None + currency: CurrencyReference | None = None + date_closed: Annotated[datetime | None, Field(alias="dateClosed")] = None + date_expense: Annotated[datetime | None, Field(alias="dateExpense")] = None + department_id: Annotated[int | None, Field(alias="departmentId")] = None + expense_detail_id: Annotated[int | None, Field(alias="expenseDetailId")] = None + expense_type: Annotated[ExpenseTypeReference | None, Field(alias="expenseType")] = None + gl_type: Annotated[ + Literal[ + "AP", + "AR", + "EE", + "EI", + "EO", + "IA", + "IT", + "P", + "PF", + "R", + "RA", + "RD", + "RE", + "RP", + "ST", + "SD", + "ET", + "FT", + "PT", + ] + | None, + Field(alias="glType"), + ] = None + id: int | None = None + in_policy: Annotated[bool | None, Field(alias="inPolicy")] = None + item_taxable_flag: Annotated[bool | None, Field(alias="itemTaxableFlag")] = None + level_six_tax_amount: Annotated[float | None, Field(alias="levelSixTaxAmount")] = None + level_six_tax_flag: Annotated[bool | None, Field(alias="levelSixTaxFlag")] = None """ Set to true if transaction is taxable at level six. """ - level_six_tax_xref: str | None = Field(default=None, alias="levelSixTaxXref") - level_six_tax_amount: float | None = Field(default=None, alias="levelSixTaxAmount") - date_closed: str | None = Field(default=None, alias="dateClosed") - info: dict[str, str] | None = Field(default=None, alias="_info") + level_six_tax_xref: Annotated[str | None, Field(alias="levelSixTaxXref")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + member: MemberReference | None = None + non_billable_amount: Annotated[float | None, Field(alias="nonBillableAmount")] = None + payment_method: Annotated[PaymentMethodReference | None, Field(alias="paymentMethod")] = None + project: ProjectReference | None = None + project_phase: Annotated[ProjectPhaseReference | None, Field(alias="projectPhase")] = None + sales_tax_amount: Annotated[float | None, Field(alias="salesTaxAmount")] = None + state_tax_amount: Annotated[float | None, Field(alias="stateTaxAmount")] = None + state_tax_flag: Annotated[bool | None, Field(alias="stateTaxFlag")] = None + """ + Set to true if transaction is taxable at the state level. + """ + state_tax_xref: Annotated[str | None, Field(alias="stateTaxXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + ticket: TicketReference | None = None + total: float | None = None class UnpostedExpenseTaxableLevel(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - tax_level: int | None = Field(default=None, alias="taxLevel") - tax_code_xref: str | None = Field(default=None, alias="taxCodeXref") - tax_amount: float | None = Field(default=None, alias="taxAmount") - info: dict[str, str] | None = Field(default=None, alias="_info") + tax_amount: Annotated[float | None, Field(alias="taxAmount")] = None + tax_code_xref: Annotated[str | None, Field(alias="taxCodeXref")] = None + tax_level: Annotated[int | None, Field(alias="taxLevel")] = None class UnpostedInvoice(ConnectWiseModel): - id: int | None = None - billing_log_id: int | None = Field(default=None, alias="billingLogId") - location_id: int | None = Field(default=None, alias="locationId") - department_id: int | None = Field(default=None, alias="departmentId") - company: CompanyReference | None = None - account_number: str | None = Field(default=None, alias="accountNumber") - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - bill_to_site: SiteReference | None = Field(default=None, alias="billToSite") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") - invoice_number: str | None = Field(default=None, alias="invoiceNumber") - invoice_date: str | None = Field(default=None, alias="invoiceDate") - invoice_type: Literal[ - "Agreement", - "CreditMemo", - "DownPayment", - "Miscellaneous", - "Progress", - "Standard", - ] | None = Field(default=None, alias="invoiceType") - description: str | None = None - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - due_days: str | None = Field(default=None, alias="dueDays") - due_date: str | None = Field(default=None, alias="dueDate") - currency: CurrencyReference | None = None - sub_total: float | None = Field(default=None, alias="subTotal") - total: float | None = None - invoice_taxable_flag: bool | None = Field(default=None, alias="invoiceTaxableFlag") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - avalara_tax_flag: bool | None = Field(default=None, alias="avalaraTaxFlag") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + avalara_tax_flag: Annotated[bool | None, Field(alias="avalaraTaxFlag")] = None """ Used to determine if Avalara tax is enabled. """ - item_taxable_flag: bool | None = Field(default=None, alias="itemTaxableFlag") - sales_tax_amount: float | None = Field(default=None, alias="salesTaxAmount") - state_tax_flag: bool | None = Field(default=None, alias="stateTaxFlag") - """ - Set to true if transaction is taxable at the state level. - """ - state_tax_xref: str | None = Field(default=None, alias="stateTaxXref") - state_tax_amount: float | None = Field(default=None, alias="stateTaxAmount") - county_tax_flag: bool | None = Field(default=None, alias="countyTaxFlag") + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + bill_to_site: Annotated[SiteReference | None, Field(alias="billToSite")] = None + billing_log_id: Annotated[int | None, Field(alias="billingLogId")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + city_tax_amount: Annotated[float | None, Field(alias="cityTaxAmount")] = None + city_tax_flag: Annotated[bool | None, Field(alias="cityTaxFlag")] = None """ - Set to true if transaction is taxable at the county level. + Set to true if transaction is taxable at the city level. """ - county_tax_xref: str | None = Field(default=None, alias="countyTaxXref") - county_tax_amount: float | None = Field(default=None, alias="countyTaxAmount") - city_tax_flag: bool | None = Field(default=None, alias="cityTaxFlag") + city_tax_xref: Annotated[str | None, Field(alias="cityTaxXref")] = None + company: CompanyReference | None = None + composite_tax_amount: Annotated[float | None, Field(alias="compositeTaxAmount")] = None + composite_tax_flag: Annotated[bool | None, Field(alias="compositeTaxFlag")] = None """ - Set to true if transaction is taxable at the city level. + Set to true if transaction is taxable at the composite level. """ - city_tax_xref: str | None = Field(default=None, alias="cityTaxXref") - city_tax_amount: float | None = Field(default=None, alias="cityTaxAmount") - country_tax_flag: bool | None = Field(default=None, alias="countryTaxFlag") + composite_tax_xref: Annotated[str | None, Field(alias="compositeTaxXref")] = None + country_tax_amount: Annotated[float | None, Field(alias="countryTaxAmount")] = None + country_tax_flag: Annotated[bool | None, Field(alias="countryTaxFlag")] = None """ Set to true if transaction is taxable at the country level. """ - country_tax_xref: str | None = Field(default=None, alias="countryTaxXref") - country_tax_amount: float | None = Field(default=None, alias="countryTaxAmount") - composite_tax_flag: bool | None = Field(default=None, alias="compositeTaxFlag") + country_tax_xref: Annotated[str | None, Field(alias="countryTaxXref")] = None + county_tax_amount: Annotated[float | None, Field(alias="countyTaxAmount")] = None + county_tax_flag: Annotated[bool | None, Field(alias="countyTaxFlag")] = None """ - Set to true if transaction is taxable at the composite level. + Set to true if transaction is taxable at the county level. """ - composite_tax_xref: str | None = Field(default=None, alias="compositeTaxXref") - composite_tax_amount: float | None = Field(default=None, alias="compositeTaxAmount") - level_six_tax_flag: bool | None = Field(default=None, alias="levelSixTaxFlag") + county_tax_xref: Annotated[str | None, Field(alias="countyTaxXref")] = None + created_by: Annotated[str | None, Field(alias="createdBy")] = None + currency: CurrencyReference | None = None + date_closed: Annotated[datetime | None, Field(alias="dateClosed")] = None + department_id: Annotated[int | None, Field(alias="departmentId")] = None + description: str | None = None + due_date: Annotated[datetime | None, Field(alias="dueDate")] = None + due_days: Annotated[str | None, Field(alias="dueDays")] = None + id: int | None = None + invoice_date: Annotated[datetime | None, Field(alias="invoiceDate")] = None + invoice_number: Annotated[str | None, Field(alias="invoiceNumber")] = None + invoice_taxable_flag: Annotated[bool | None, Field(alias="invoiceTaxableFlag")] = None + invoice_type: Annotated[ + Literal["Agreement", "CreditMemo", "DownPayment", "Miscellaneous", "Progress", "Standard"] | None, + Field(alias="invoiceType"), + ] = None + item_taxable_flag: Annotated[bool | None, Field(alias="itemTaxableFlag")] = None + level_six_tax_amount: Annotated[float | None, Field(alias="levelSixTaxAmount")] = None + level_six_tax_flag: Annotated[bool | None, Field(alias="levelSixTaxFlag")] = None """ Set to true if transaction is taxable at level six. """ - level_six_tax_xref: str | None = Field(default=None, alias="levelSixTaxXref") - level_six_tax_amount: float | None = Field(default=None, alias="levelSixTaxAmount") - created_by: str | None = Field(default=None, alias="createdBy") - date_closed: str | None = Field(default=None, alias="dateClosed") - info: dict[str, str] | None = Field(default=None, alias="_info") + level_six_tax_xref: Annotated[str | None, Field(alias="levelSixTaxXref")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + sales_tax_amount: Annotated[float | None, Field(alias="salesTaxAmount")] = None + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + ship_to_site: Annotated[SiteReference | None, Field(alias="shipToSite")] = None + state_tax_amount: Annotated[float | None, Field(alias="stateTaxAmount")] = None + state_tax_flag: Annotated[bool | None, Field(alias="stateTaxFlag")] = None + """ + Set to true if transaction is taxable at the state level. + """ + state_tax_xref: Annotated[str | None, Field(alias="stateTaxXref")] = None + sub_total: Annotated[float | None, Field(alias="subTotal")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + total: float | None = None class UnpostedInvoiceTaxableLevel(UnpostedExpenseTaxableLevel): @@ -6899,80 +5760,74 @@ class UnpostedInvoiceTaxableLevel(UnpostedExpenseTaxableLevel): class UnpostedProcurement(ConnectWiseModel): - id: int | None = None - description: str | None = None - unposted_product_id: str | None = Field(default=None, alias="unpostedProductId") - location_id: int | None = Field(default=None, alias="locationId") - department_id: int | None = Field(default=None, alias="departmentId") - procurement_type: Literal["Purchase", "Adjustment", "Transfer"] | None = Field( - default=None, alias="procurementType" - ) - purchase_order: PurchaseOrderReference | None = Field( - default=None, alias="purchaseOrder" - ) - purchase_date: str | None = Field(default=None, alias="purchaseDate") - tracking_number: str | None = Field(default=None, alias="trackingNumber") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - currency: CurrencyReference | None = None - total: float | None = None - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - avalara_tax_flag: bool | None = Field(default=None, alias="avalaraTaxFlag") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + avalara_tax_flag: Annotated[bool | None, Field(alias="avalaraTaxFlag")] = None """ Used to determine if Avalara tax is enabled. """ - item_taxable_flag: bool | None = Field(default=None, alias="itemTaxableFlag") - purchase_order_taxable_flag: bool | None = Field( - default=None, alias="purchaseOrderTaxableFlag" - ) - state_tax_flag: bool | None = Field(default=None, alias="stateTaxFlag") - """ - Set to true if transaction is taxable at the state level. - """ - state_tax_xref: str | None = Field(default=None, alias="stateTaxXref") - state_tax_amount: float | None = Field(default=None, alias="stateTaxAmount") - county_tax_flag: bool | None = Field(default=None, alias="countyTaxFlag") + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + city_tax_amount: Annotated[float | None, Field(alias="cityTaxAmount")] = None + city_tax_flag: Annotated[bool | None, Field(alias="cityTaxFlag")] = None """ - Set to true if transaction is taxable at the county level. + Set to true if transaction is taxable at the city level. """ - county_tax_xref: str | None = Field(default=None, alias="countyTaxXref") - county_tax_amount: float | None = Field(default=None, alias="countyTaxAmount") - city_tax_flag: bool | None = Field(default=None, alias="cityTaxFlag") + city_tax_xref: Annotated[str | None, Field(alias="cityTaxXref")] = None + composite_tax_amount: Annotated[float | None, Field(alias="compositeTaxAmount")] = None + composite_tax_flag: Annotated[bool | None, Field(alias="compositeTaxFlag")] = None """ - Set to true if transaction is taxable at the city level. + Set to true if transaction is taxable at the composite level. """ - city_tax_xref: str | None = Field(default=None, alias="cityTaxXref") - city_tax_amount: float | None = Field(default=None, alias="cityTaxAmount") - country_tax_flag: bool | None = Field(default=None, alias="countryTaxFlag") + composite_tax_xref: Annotated[str | None, Field(alias="compositeTaxXref")] = None + country_tax_amount: Annotated[float | None, Field(alias="countryTaxAmount")] = None + country_tax_flag: Annotated[bool | None, Field(alias="countryTaxFlag")] = None """ Set to true if transaction is taxable at the country level. """ - country_tax_xref: str | None = Field(default=None, alias="countryTaxXref") - country_tax_amount: float | None = Field(default=None, alias="countryTaxAmount") - composite_tax_flag: bool | None = Field(default=None, alias="compositeTaxFlag") + country_tax_xref: Annotated[str | None, Field(alias="countryTaxXref")] = None + county_tax_amount: Annotated[float | None, Field(alias="countyTaxAmount")] = None + county_tax_flag: Annotated[bool | None, Field(alias="countyTaxFlag")] = None """ - Set to true if transaction is taxable at the composite level. + Set to true if transaction is taxable at the county level. """ - composite_tax_xref: str | None = Field(default=None, alias="compositeTaxXref") - composite_tax_amount: float | None = Field(default=None, alias="compositeTaxAmount") - level_six_tax_flag: bool | None = Field(default=None, alias="levelSixTaxFlag") + county_tax_xref: Annotated[str | None, Field(alias="countyTaxXref")] = None + currency: CurrencyReference | None = None + customer: CompanyReference | None = None + date_closed: Annotated[datetime | None, Field(alias="dateClosed")] = None + department_id: Annotated[int | None, Field(alias="departmentId")] = None + description: str | None = None + freight_cost: Annotated[float | None, Field(alias="freightCost")] = None + freight_tax_total: Annotated[float | None, Field(alias="freightTaxTotal")] = None + id: int | None = None + item_taxable_flag: Annotated[bool | None, Field(alias="itemTaxableFlag")] = None + level_six_tax_amount: Annotated[float | None, Field(alias="levelSixTaxAmount")] = None + level_six_tax_flag: Annotated[bool | None, Field(alias="levelSixTaxFlag")] = None """ Set to true if transaction is taxable at level six. """ - level_six_tax_xref: str | None = Field(default=None, alias="levelSixTaxXref") - level_six_tax_amount: float | None = Field(default=None, alias="levelSixTaxAmount") - tax_total: float | None = Field(default=None, alias="taxTotal") - customer: CompanyReference | None = None + level_six_tax_xref: Annotated[str | None, Field(alias="levelSixTaxXref")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + procurement_type: Annotated[ + Literal["Purchase", "Adjustment", "Transfer"] | None, Field(alias="procurementType") + ] = None + purchase_date: Annotated[datetime | None, Field(alias="purchaseDate")] = None + purchase_order: Annotated[PurchaseOrderReference | None, Field(alias="purchaseOrder")] = None + purchase_order_taxable_flag: Annotated[bool | None, Field(alias="purchaseOrderTaxableFlag")] = None + state_tax_amount: Annotated[float | None, Field(alias="stateTaxAmount")] = None + state_tax_flag: Annotated[bool | None, Field(alias="stateTaxFlag")] = None + """ + Set to true if transaction is taxable at the state level. + """ + state_tax_xref: Annotated[str | None, Field(alias="stateTaxXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_freight_flag: Annotated[bool | None, Field(alias="taxFreightFlag")] = None + tax_total: Annotated[float | None, Field(alias="taxTotal")] = None + total: float | None = None + tracking_number: Annotated[str | None, Field(alias="trackingNumber")] = None + unposted_product_id: Annotated[str | None, Field(alias="unpostedProductId")] = None vendor: CompanyReference | None = None - vendor_account_number: str | None = Field(default=None, alias="vendorAccountNumber") - vendor_invoice_number: str | None = Field(default=None, alias="vendorInvoiceNumber") - vendor_invoice_date: str | None = Field(default=None, alias="vendorInvoiceDate") - tax_freight_flag: bool | None = Field(default=None, alias="taxFreightFlag") - freight_tax_total: float | None = Field(default=None, alias="freightTaxTotal") - freight_cost: float | None = Field(default=None, alias="freightCost") - date_closed: str | None = Field(default=None, alias="dateClosed") - info: dict[str, str] | None = Field(default=None, alias="_info") + vendor_account_number: Annotated[str | None, Field(alias="vendorAccountNumber")] = None + vendor_invoice_date: Annotated[datetime | None, Field(alias="vendorInvoiceDate")] = None + vendor_invoice_number: Annotated[str | None, Field(alias="vendorInvoiceNumber")] = None class UnpostedProcurementTaxableLevel(UnpostedExpenseTaxableLevel): @@ -6980,80 +5835,66 @@ class UnpostedProcurementTaxableLevel(UnpostedExpenseTaxableLevel): class Usage(ConnectWiseModel): - type: str | None = None count: int | None = None - id: int | None = None description: str | None = None hyperlink: str | None = None - type_key: str | None = Field(default=None, alias="typeKey") + id: int | None = None + type: str | None = None + type_key: Annotated[str | None, Field(alias="typeKey")] = None class UserDefinedFieldOption(ConnectWiseModel): + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - option_value: str | None = Field(default=None, alias="optionValue") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - sort_order: int | None = Field(default=None, alias="sortOrder") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + option_value: Annotated[str | None, Field(alias="optionValue")] = None + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class UserDefinedFieldReference(ActivityReference): pass -class UserDefinedFieldValueModel(ConnectWiseModel): - user_defined_field_rec_id: int | None = Field( - default=None, alias="userDefinedFieldRecId" - ) - value: str | None = None - row_num: int | None = Field(default=None, alias="rowNum") - skip_location_and_billing_unit: bool | None = Field( - default=None, alias="skipLocationAndBillingUnit" - ) - filtered: bool | None = None - - class ValidatePortalRequest(ConnectWiseModel): email: str password: str class ValidatePortalResponse(ConnectWiseModel): + contact_id: Annotated[int | None, Field(alias="contactId")] = None success: bool | None = None - contact_id: int | None = Field(default=None, alias="contactId") class ValidationError(ConnectWiseModel): code: str | None = None + details: str | None = None + field: str | None = None message: str | None = None resource: str | None = None - field: str | None = None - details: str | None = None class Warehouse(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 50; - """ + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None company: CompanyReference | None = None - location: SystemLocationReference | None = None contact: ContactReference | None = None + currency: CurrencyReference | None = None department: SystemDepartmentReference | None = None - manager: MemberReference | None = None - site: SiteReference | None = None - location_xref: str | None = Field(default=None, alias="locationXref") + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + location: SystemLocationReference | None = None + location_default_flag: Annotated[bool | None, Field(alias="locationDefaultFlag")] = None + location_xref: Annotated[str | None, Field(alias="locationXref")] = None """ Max length: 10; """ - location_default_flag: bool | None = Field( - default=None, alias="locationDefaultFlag" - ) - overall_default_flag: bool | None = Field(default=None, alias="overallDefaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - locked_flag: bool | None = Field(default=None, alias="lockedFlag") - currency: CurrencyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + locked_flag: Annotated[bool | None, Field(alias="lockedFlag")] = None + manager: MemberReference | None = None + name: str + """ + Max length: 50; + """ + overall_default_flag: Annotated[bool | None, Field(alias="overallDefaultFlag")] = None + site: SiteReference | None = None class WarehouseBinReference(ActivityReference): @@ -7065,134 +5906,145 @@ class WarehouseInfo(CategoryInfo): class WarehouseReference(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + locked_flag: Annotated[bool | None, Field(alias="lockedFlag")] = None name: str | None = None - locked_flag: bool | None = Field(default=None, alias="lockedFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") -class WisePayBatchPayment(ConnectWiseModel): - amount: float | None = None - wise_pay_href: str | None = Field(default=None, alias="wisePayHref") +class WonRevenueReference(AgreementRevenueReference): + pass -class WisePayFeeInvoice(ConnectWiseModel): +class WorkRole(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_agreement_exclusions: Annotated[bool | None, Field(alias="addAllAgreementExclusions")] = None + """ + Used only on create to add the work role to all agreement and agreement type exclusion lists + """ + add_all_locations: Annotated[bool | None, Field(alias="addAllLocations")] = None + hourly_rate: Annotated[float | None, Field(alias="hourlyRate")] = None id: int | None = None - invoice_number: str | None = Field(default=None, alias="invoiceNumber") - amount: float | None = None - invoice_href: str | None = Field(default=None, alias="invoiceHref") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_xref: Annotated[str | None, Field(alias="integrationXref")] = None + """ + Max length: 50; + """ + location_ids: Annotated[list[int] | None, Field(alias="locationIds")] = None + name: str + """ + Max length: 50; + """ + remove_all_locations: Annotated[bool | None, Field(alias="removeAllLocations")] = None -class WisePayPayment(ConnectWiseModel): - payment_date_utc: str | None = Field(default=None, alias="paymentDateUtc") - wise_pay_reference: str | None = Field(default=None, alias="wisePayReference") - batch_payment: WisePayBatchPayment | None = Field( - default=None, alias="batchPayment" - ) - fee_invoice: WisePayFeeInvoice | None = Field(default=None, alias="feeInvoice") +class WorkRoleInfo(CategoryInfo): + pass -class WonRevenueReference(AgreementRevenueReference): +class WorkRoleReference(ActivityReference): pass -class WorkflowAction(ConnectWiseModel): +class WorkType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + accrual_type: Annotated[Literal["Holiday", "PTO", "Sick", "Vacation"] | None, Field(alias="accrualType")] = None + activity_default_flag: Annotated[bool | None, Field(alias="activityDefaultFlag")] = None + add_all_agreement_exclusions: Annotated[bool | None, Field(alias="addAllAgreementExclusions")] = None + """ + Used only on create to add the work type to all agreement and agreement type exclusion lists + """ + bill_time: Annotated[Literal["Billable", "DoNotBill", "NoCharge"], Field(alias="billTime")] + cost_multiplier: Annotated[float | None, Field(alias="costMultiplier")] = None + hours_max: Annotated[float | None, Field(alias="hoursMax")] = None + hours_min: Annotated[float | None, Field(alias="hoursMin")] = None id: int | None = None - notify_type: NotifyTypeReference = Field(..., alias="notifyType") - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - specific_member_to: MemberReference | None = Field( - default=None, alias="specificMemberTo" - ) - email_recipient: str | None = Field(default=None, alias="emailRecipient") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_x_ref: Annotated[str | None, Field(alias="integrationXRef")] = None """ - Required when notifyWho is set to: "Email Address" Max length: 250; + Max length: 50; """ - notify_from: NotificationRecipientReference | None = Field( - default=None, alias="notifyFrom" - ) - specific_member_from: MemberReference | None = Field( - default=None, alias="specificMemberFrom" - ) - email_from: str | None = Field(default=None, alias="emailFrom") + name: str """ - Required when notifyFrom is set to: "Email Address" Max length: 250; + Max length: 50; """ - cc_contact: ContactReference | None = Field(default=None, alias="ccContact") - bcc_contact: ContactReference | None = Field(default=None, alias="bccContact") - subject: str | None = None + overall_default_flag: Annotated[bool | None, Field(alias="overallDefaultFlag")] = None + rate: float + rate_type: Annotated[Literal["AdjAmount", "Custom", "Multiplier"], Field(alias="rateType")] + round_bill_hours_to: Annotated[float | None, Field(alias="roundBillHoursTo")] = None + utilization_flag: Annotated[bool | None, Field(alias="utilizationFlag")] = None + + +class WorkTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + activity_default_flag: Annotated[bool | None, Field(alias="activityDefaultFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + name: str | None = None + + +class WorkTypeReference(ActivityReference): + pass + + +class WorkflowAction(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + activity_status: Annotated[ActivityStatusReference | None, Field(alias="activityStatus")] = None + activity_type: Annotated[ActivityTypeReference | None, Field(alias="activityType")] = None + attach_configurations_for: Annotated[ + Literal["Company", "Contact"] | None, Field(alias="attachConfigurationsFor") + ] = None """ - Required when notifyType is set to: "Create Activity", "Send Email", "Assign Resource" Max length: 100; + Required when notifyType is set to: "Attach Configuration" """ - notes: str | None = None - activity_status: ActivityStatusReference | None = Field( - default=None, alias="activityStatus" - ) - activity_type: ActivityTypeReference | None = Field( - default=None, alias="activityType" - ) - attached_track: TrackReference | None = Field(default=None, alias="attachedTrack") - days_to_execute: int | None = Field(default=None, alias="daysToExecute") + attached_track: Annotated[TrackReference | None, Field(alias="attachedTrack")] = None + attachments: list[int] | None = None + audit_notes_flag: Annotated[bool | None, Field(alias="auditNotesFlag")] = None + automate_script: Annotated[AutomateScriptReference | None, Field(alias="automateScript")] = None + bcc_contact: Annotated[ContactReference | None, Field(alias="bccContact")] = None board: BoardReference | None = None - board_status: ServiceStatusReference | None = Field( - default=None, alias="boardStatus" - ) - service_type: ServiceTypeReference | None = Field(default=None, alias="serviceType") - service_sub_type: ServiceSubTypeReference | None = Field( - default=None, alias="serviceSubType" - ) - service_item: ServiceItemReference | None = Field(default=None, alias="serviceItem") + board_status: Annotated[ServiceStatusReference | None, Field(alias="boardStatus")] = None + cc_contact: Annotated[ContactReference | None, Field(alias="ccContact")] = None + company_status: Annotated[CompanyStatusReference | None, Field(alias="companyStatus")] = None + configuration_status: Annotated[ConfigurationStatusReference | None, Field(alias="configurationStatus")] = None + configuration_type: Annotated[ConfigurationTypeReference | None, Field(alias="configurationType")] = None + days_to_execute: Annotated[int | None, Field(alias="daysToExecute")] = None + detail_notes_flag: Annotated[bool | None, Field(alias="detailNotesFlag")] = None + email_from: Annotated[str | None, Field(alias="emailFrom")] = None + """ + Required when notifyFrom is set to: "Email Address" Max length: 250; + """ + email_recipient: Annotated[str | None, Field(alias="emailRecipient")] = None + """ + Required when notifyWho is set to: "Email Address" Max length: 250; + """ group: GroupReference | None = None - service_template: ServiceTemplateReference | None = Field( - default=None, alias="serviceTemplate" - ) - invoice_min_days: int | None = Field(default=None, alias="invoiceMinDays") - automate_script: AutomateScriptReference | None = Field( - default=None, alias="automateScript" - ) - script_success_status: ServiceStatusReference | None = Field( - default=None, alias="scriptSuccessStatus" - ) - script_fail_status: ServiceStatusReference | None = Field( - default=None, alias="scriptFailStatus" - ) - detail_notes_flag: bool | None = Field(default=None, alias="detailNotesFlag") - internal_notes_flag: bool | None = Field(default=None, alias="internalNotesFlag") - audit_notes_flag: bool | None = Field(default=None, alias="auditNotesFlag") - service_priority: PriorityReference | None = Field( - default=None, alias="servicePriority" - ) - update_owner_flag: bool | None = Field(default=None, alias="updateOwnerFlag") - sales_order_status: OrderStatusReference | None = Field( - default=None, alias="salesOrderStatus" - ) - project_status: ProjectStatusReference | None = Field( - default=None, alias="projectStatus" - ) - company_status: CompanyStatusReference | None = Field( - default=None, alias="companyStatus" - ) - attachments: list[int] | None = None - service_survey: ServiceSurveyReference | None = Field( - default=None, alias="serviceSurvey" - ) - specific_team_to: GenericBoardTeamReference | None = Field( - default=None, alias="specificTeamTo" - ) - attach_configurations_for: Literal["Company", "Contact"] | None = Field( - default=None, alias="attachConfigurationsFor" - ) + id: int | None = None + internal_notes_flag: Annotated[bool | None, Field(alias="internalNotesFlag")] = None + invoice_min_days: Annotated[int | None, Field(alias="invoiceMinDays")] = None + notes: str | None = None + notify_from: Annotated[NotificationRecipientReference | None, Field(alias="notifyFrom")] = None + notify_type: Annotated[NotifyTypeReference, Field(alias="notifyType")] + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None + project_status: Annotated[ProjectStatusReference | None, Field(alias="projectStatus")] = None + sales_order_status: Annotated[OrderStatusReference | None, Field(alias="salesOrderStatus")] = None + script_fail_status: Annotated[ServiceStatusReference | None, Field(alias="scriptFailStatus")] = None + script_success_status: Annotated[ServiceStatusReference | None, Field(alias="scriptSuccessStatus")] = None + service_item: Annotated[ServiceItemReference | None, Field(alias="serviceItem")] = None + service_priority: Annotated[PriorityReference | None, Field(alias="servicePriority")] = None + service_sub_type: Annotated[ServiceSubTypeReference | None, Field(alias="serviceSubType")] = None + service_survey: Annotated[ServiceSurveyReference | None, Field(alias="serviceSurvey")] = None + service_template: Annotated[ServiceTemplateReference | None, Field(alias="serviceTemplate")] = None + service_type: Annotated[ServiceTypeReference | None, Field(alias="serviceType")] = None + specific_member_from: Annotated[MemberReference | None, Field(alias="specificMemberFrom")] = None + specific_member_to: Annotated[MemberReference | None, Field(alias="specificMemberTo")] = None + specific_team_to: Annotated[GenericBoardTeamReference | None, Field(alias="specificTeamTo")] = None + subject: str | None = None """ - Required when notifyType is set to: "Attach Configuration" + Required when notifyType is set to: "Create Activity", "Send Email", "Assign Resource" Max length: 100; """ - configuration_type: ConfigurationTypeReference | None = Field( - default=None, alias="configurationType" - ) - configuration_status: ConfigurationStatusReference | None = Field( - default=None, alias="configurationStatus" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + update_owner_flag: Annotated[bool | None, Field(alias="updateOwnerFlag")] = None class WorkflowActionAutomateParameter(ConnectWiseModel): @@ -7202,19 +6054,19 @@ class WorkflowActionAutomateParameter(ConnectWiseModel): class WorkflowActionUserDefinedField(ConnectWiseModel): - id: int | None = None - event_id: int | None = Field(default=None, alias="eventId") - action_id: int | None = Field(default=None, alias="actionId") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + action_id: Annotated[int | None, Field(alias="actionId")] = None caption: str | None = None - user_defined_field_id: int | None = Field(default=None, alias="userDefinedFieldId") + entry_type_id: Annotated[str | None, Field(alias="entryTypeId")] = None + event_id: Annotated[int | None, Field(alias="eventId")] = None + field_type_id: Annotated[str | None, Field(alias="fieldTypeId")] = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + overwrite_flag: Annotated[bool | None, Field(alias="overwriteFlag")] = None + pod_description: Annotated[str | None, Field(alias="podDescription")] = None + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + user_defined_field_id: Annotated[int | None, Field(alias="userDefinedFieldId")] = None value: str | None = None - overwrite_flag: bool | None = Field(default=None, alias="overwriteFlag") - pod_description: str | None = Field(default=None, alias="podDescription") - field_type_id: str | None = Field(default=None, alias="fieldTypeId") - entry_type_id: str | None = Field(default=None, alias="entryTypeId") - required_flag: bool | None = Field(default=None, alias="requiredFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class WorkflowAttachment(ActivityReference): @@ -7222,57 +6074,51 @@ class WorkflowAttachment(ActivityReference): class WorkflowEvent(ConnectWiseModel): - id: int | None = None - name: str | None = None - event_condition: str = Field(..., alias="eventCondition") - frequency_unit: Literal["Minutes", "Hours", "Days", "Months"] | None = Field( - default=None, alias="frequencyUnit" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + event_condition: Annotated[str, Field(alias="eventCondition")] + execution_time: Annotated[ + Literal["Once", "MultipleTimes", "Continuously"] | None, Field(alias="executionTime") + ] = None """ - Required when exectionTimes is set to MultipleTimes or Continuously + Defaults to Once when not specified """ - frequency_of_execution: int | None = Field( - default=None, alias="frequencyOfExecution" - ) + frequency_of_execution: Annotated[int | None, Field(alias="frequencyOfExecution")] = None """ Required when exectionTimes is set to MultipleTimes or Continuously """ - max_number_of_execution: int | None = Field( - default=None, alias="maxNumberOfExecution" - ) + frequency_unit: Annotated[Literal["Minutes", "Hours", "Days", "Months"] | None, Field(alias="frequencyUnit")] = None """ - Required when exectionTimes is set to MultipleTimes + Required when exectionTimes is set to MultipleTimes or Continuously """ - execution_time: Literal["Once", "MultipleTimes", "Continuously"] | None = Field( - default=None, alias="executionTime" - ) + id: int | None = None + max_number_of_execution: Annotated[int | None, Field(alias="maxNumberOfExecution")] = None """ - Defaults to Once when not specified + Required when exectionTimes is set to MultipleTimes """ - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None class WorkflowNotifyType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + external_flag: Annotated[bool | None, Field(alias="externalFlag")] = None + """ + If the current action effects external objects e.g. integrations or sending an email + """ id: int | None = None identifier: str | None = None - name: str | None = None - is_setup_flag: bool | None = Field(default=None, alias="isSetupFlag") + is_setup_flag: Annotated[bool | None, Field(alias="isSetupFlag")] = None """ If the current action is available because it is already set up. Pertains to integrations such as Automate """ - external_flag: bool | None = Field(default=None, alias="externalFlag") - """ - If the current action effects external objects e.g. integrations or sending an email - """ - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None class WorkflowNotifyTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None identifier: str | None = None + is_setup_flag: Annotated[bool | None, Field(alias="isSetupFlag")] = None name: str | None = None - is_setup_flag: bool | None = Field(default=None, alias="isSetupFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class WorkflowTableType(CatalogItemReference): @@ -7288,708 +6134,423 @@ class WorkflowTableTypeReference(CatalogItemReference): class WorkflowTrigger(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + custom_field: Annotated[UserDefinedFieldReference | None, Field(alias="customField")] = None + description: str | None = None + expected_type: Annotated[str | None, Field(alias="expectedType")] = None + has_operator_flag: Annotated[bool | None, Field(alias="hasOperatorFlag")] = None + has_options_flag: Annotated[bool | None, Field(alias="hasOptionsFlag")] = None id: int | None = None name: str | None = None - description: str | None = None - has_options_flag: bool | None = Field(default=None, alias="hasOptionsFlag") - has_operator_flag: bool | None = Field(default=None, alias="hasOperatorFlag") - custom_field: UserDefinedFieldReference | None = Field( - default=None, alias="customField" - ) - expected_type: str | None = Field(default=None, alias="expectedType") - info: dict[str, str] | None = Field(default=None, alias="_info") class WorkflowTriggerOption(ConnectWiseModel): - value: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + custom_field: Annotated[UserDefinedFieldReference | None, Field(alias="customField")] = None name: str | None = None - custom_field: UserDefinedFieldReference | None = Field( - default=None, alias="customField" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class WorkRole(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 50; - """ - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - integration_xref: str | None = Field(default=None, alias="integrationXref") - """ - Max length: 50; - """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - add_all_locations: bool | None = Field(default=None, alias="addAllLocations") - remove_all_locations: bool | None = Field(default=None, alias="removeAllLocations") - add_all_agreement_exclusions: bool | None = Field( - default=None, alias="addAllAgreementExclusions" - ) - """ - Used only on create to add the work role to all agreement and agreement type exclusion lists - """ - location_ids: list[int] | None = Field(default=None, alias="locationIds") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class WorkRoleInfo(CategoryInfo): - pass - - -class WorkRoleReference(ActivityReference): - pass + value: str | None = None -class WorkType(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 50; - """ - bill_time: Literal["Billable", "DoNotBill", "NoCharge"] = Field( - ..., alias="billTime" - ) - rate_type: Literal["AdjAmount", "Custom", "Multiplier"] = Field( - ..., alias="rateType" - ) - rate: float - hours_min: float | None = Field(default=None, alias="hoursMin") - hours_max: float | None = Field(default=None, alias="hoursMax") - round_bill_hours_to: float | None = Field(default=None, alias="roundBillHoursTo") - accrual_type: Literal["Holiday", "PTO", "Sick", "Vacation"] | None = Field( - default=None, alias="accrualType" - ) - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - overall_default_flag: bool | None = Field(default=None, alias="overallDefaultFlag") - activity_default_flag: bool | None = Field( - default=None, alias="activityDefaultFlag" - ) - utilization_flag: bool | None = Field(default=None, alias="utilizationFlag") - cost_multiplier: float | None = Field(default=None, alias="costMultiplier") - integration_x_ref: str | None = Field(default=None, alias="integrationXRef") - """ - Max length: 50; - """ - add_all_agreement_exclusions: bool | None = Field( - default=None, alias="addAllAgreementExclusions" - ) +class Activity(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement: AgreementReference | None = None + assign_to: Annotated[MemberReference | None, Field(alias="assignTo")] = None + assigned_by: Annotated[MemberReference | None, Field(alias="assignedBy")] = None + campaign: CampaignReference | None = None + company: CompanyReference | None = None + contact: ContactReference | None = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + date_end: Annotated[datetime | None, Field(alias="dateEnd")] = None + date_start: Annotated[datetime | None, Field(alias="dateStart")] = None + email: str | None = None """ - Used only on create to add the work type to all agreement and agreement type exclusion lists + Max length: 250; """ - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class WorkTypeInfo(ConnectWiseModel): - id: int | None = None - name: str | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - activity_default_flag: bool | None = Field( - default=None, alias="activityDefaultFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class WorkTypeReference(ActivityReference): - pass - - -class Activity(ConnectWiseModel): id: int | None = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None name: str """ Max length: 100; """ - type: ActivityTypeReference | None = None - company: CompanyReference | None = None - contact: ContactReference | None = None - phone_number: str | None = Field(default=None, alias="phoneNumber") + notes: str | None = None + notify_flag: Annotated[bool | None, Field(alias="notifyFlag")] = None + opportunity: OpportunityReference | None = None + phone_number: Annotated[str | None, Field(alias="phoneNumber")] = None """ Max length: 30; """ - email: str | None = None - """ - Max length: 250; - """ + reminder: ReminderReference | None = None + schedule_status: Annotated[ScheduleStatusReference | None, Field(alias="scheduleStatus")] = None status: ActivityStatusReference | None = None - opportunity: OpportunityReference | None = None ticket: TicketReference | None = None - agreement: AgreementReference | None = None - campaign: CampaignReference | None = None - notes: str | None = None - date_start: datetime | None = Field(default=None, alias="dateStart") - date_end: datetime | None = Field(default=None, alias="dateEnd") - assigned_by: MemberReference | None = Field(default=None, alias="assignedBy") - assign_to: MemberReference | None = Field(default=None, alias="assignTo") - schedule_status: ScheduleStatusReference | None = Field( - default=None, alias="scheduleStatus" - ) - reminder: ReminderReference | None = None + type: ActivityTypeReference | None = None where: ServiceLocationReference | None = None - notify_flag: bool | None = Field(default=None, alias="notifyFlag") - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - currency: CurrencyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class ActivityStopwatch(ConnectWiseModel): - activity_id: int = Field(..., alias="activityId") - activity_mobile_guid: UUID | None = Field(default=None, alias="activityMobileGuid") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + activity_id: Annotated[int, Field(alias="activityId")] + activity_mobile_guid: Annotated[UUID | None, Field(alias="activityMobileGuid")] = None agreement: AgreementReference | None = None - billable_option: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billableOption") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - date_entered: datetime | None = Field(default=None, alias="dateEntered") - end_time: datetime | None = Field(default=None, alias="endTime") - id: int | None = None - internal_notes: str | None = Field(default=None, alias="internalNotes") - location_id: int | None = Field(default=None, alias="locationId") + billable_option: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billableOption") + ] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None + end_time: Annotated[datetime | None, Field(alias="endTime")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None member: MemberReference | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None notes: str | None = None """ Max length: 4000; """ - start_time: datetime | None = Field(default=None, alias="startTime") + start_time: Annotated[datetime | None, Field(alias="startTime")] = None status: Literal["Reset", "Running", "Paused", "Stopped"] - total_pause_time: int | None = Field(default=None, alias="totalPauseTime") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - info: dict[str, str] | None = Field(default=None, alias="_info") + total_pause_time: Annotated[int | None, Field(alias="totalPauseTime")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class Addition(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None + agreement_status: Annotated[ + Literal["Active", "Cancelled", "Expired", "Inactive"] | None, Field(alias="agreementStatus") + ] = None + bill_customer: Annotated[Literal["Billable", "DoNotBill", "NoCharge"], Field(alias="billCustomer")] + billed_quantity: Annotated[float | None, Field(alias="billedQuantity")] = None + cancelled_date: Annotated[datetime | None, Field(alias="cancelledDate")] = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + description: str | None = None + effective_date: Annotated[datetime | None, Field(alias="effectiveDate")] = None + ext_cost: Annotated[float | None, Field(alias="extCost")] = None + ext_price: Annotated[float | None, Field(alias="extPrice")] = None + extended_prorate_cost: Annotated[float | None, Field(alias="extendedProrateCost")] = None + extended_prorate_price: Annotated[float | None, Field(alias="extendedProratePrice")] = None id: int | None = None + invoice_description: Annotated[str | None, Field(alias="invoiceDescription")] = None + """ + Max length: 6000; + """ + invoice_grouping: Annotated[InvoiceGroupingReference | None, Field(alias="invoiceGrouping")] = None + less_included: Annotated[float | None, Field(alias="lessIncluded")] = None + margin: float | None = None + opportunity: OpportunityReference | None = None product: IvItemReference | None = None + prorate_cost: Annotated[float | None, Field(alias="prorateCost")] = None + prorate_current_period_flag: Annotated[bool | None, Field(alias="prorateCurrentPeriodFlag")] = None + prorate_price: Annotated[float | None, Field(alias="proratePrice")] = None + purchase_item_flag: Annotated[bool | None, Field(alias="purchaseItemFlag")] = None quantity: float | None = None - less_included: float | None = Field(default=None, alias="lessIncluded") - unit_price: float | None = Field(default=None, alias="unitPrice") - unit_cost: float | None = Field(default=None, alias="unitCost") - bill_customer: Literal["Billable", "DoNotBill", "NoCharge"] = Field( - ..., alias="billCustomer" - ) - effective_date: datetime | None = Field(default=None, alias="effectiveDate") - cancelled_date: datetime | None = Field(default=None, alias="cancelledDate") - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - serial_number: str | None = Field(default=None, alias="serialNumber") + sequence_number: Annotated[float | None, Field(alias="sequenceNumber")] = None + serial_number: Annotated[str | None, Field(alias="serialNumber")] = None """ Max length: 50; """ - invoice_description: str | None = Field(default=None, alias="invoiceDescription") - """ - Max length: 6000; - """ - purchase_item_flag: bool | None = Field(default=None, alias="purchaseItemFlag") - special_order_flag: bool | None = Field(default=None, alias="specialOrderFlag") - agreement_id: int | None = Field(default=None, alias="agreementId") - description: str | None = None - billed_quantity: float | None = Field(default=None, alias="billedQuantity") + special_order_flag: Annotated[bool | None, Field(alias="specialOrderFlag")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None + unit_cost: Annotated[float | None, Field(alias="unitCost")] = None + unit_price: Annotated[float | None, Field(alias="unitPrice")] = None uom: str | None = None - ext_price: float | None = Field(default=None, alias="extPrice") - ext_cost: float | None = Field(default=None, alias="extCost") - sequence_number: float | None = Field(default=None, alias="sequenceNumber") - margin: float | None = None - prorate_cost: float | None = Field(default=None, alias="prorateCost") - prorate_price: float | None = Field(default=None, alias="proratePrice") - extended_prorate_cost: float | None = Field( - default=None, alias="extendedProrateCost" - ) - extended_prorate_price: float | None = Field( - default=None, alias="extendedProratePrice" - ) - prorate_current_period_flag: bool | None = Field( - default=None, alias="prorateCurrentPeriodFlag" - ) - opportunity: OpportunityReference | None = None - agreement_status: Literal[ - "Active", "Cancelled", "Expired", "Inactive" - ] | None = Field(default=None, alias="agreementStatus") - invoice_grouping: InvoiceGroupingReference | None = Field( - default=None, alias="invoiceGrouping" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class AdjustmentDetail(ConnectWiseModel): - id: int | None = None - catalog_item: CatalogItemReference | None = Field(default=None, alias="catalogItem") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + adjustment: AdjustmentReference | None = None + catalog_item: Annotated[CatalogItemReference | None, Field(alias="catalogItem")] = None description: str | None = None """ Max length: 50; """ - quantity_on_hand: float | None = Field(default=None, alias="quantityOnHand") - unit_cost: float | None = Field(default=None, alias="unitCost") - warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - quantity_adjusted: int = Field(..., alias="quantityAdjusted") - serial_number: str | None = Field(default=None, alias="serialNumber") + id: int | None = None + quantity_adjusted: Annotated[int, Field(alias="quantityAdjusted")] + quantity_on_hand: Annotated[float | None, Field(alias="quantityOnHand")] = None + serial_number: Annotated[str | None, Field(alias="serialNumber")] = None """ Max length: 1000; """ - adjustment: AdjustmentReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + unit_cost: Annotated[float | None, Field(alias="unitCost")] = None + warehouse: WarehouseReference | None = None + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None class Agreement(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_status: Annotated[ + Literal["Active", "Cancelled", "Expired", "Inactive"] | None, Field(alias="agreementStatus") + ] = None + allow_overruns: Annotated[bool | None, Field(alias="allowOverruns")] = None + application_cycle: Annotated[ + Literal[ + "Contract2Weeks", + "Contract4Weeks", + "ContractYear", + "CalendarMonth", + "CalendarQuarter", + "CalendarWeek", + "ContractQuarter", + "CalendarYear", + ] + | None, + Field(alias="applicationCycle"), + ] = None + application_limit: Annotated[float | None, Field(alias="applicationLimit")] = None + application_units: Annotated[Literal["Amount", "Hours", "Incidents"] | None, Field(alias="applicationUnits")] = None + application_unlimited_flag: Annotated[bool | None, Field(alias="applicationUnlimitedFlag")] = None + auto_invoice_flag: Annotated[bool | None, Field(alias="autoInvoiceFlag")] = None + bill_amount: Annotated[float | None, Field(alias="billAmount")] = None + bill_expenses: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billExpenses") + ] = None """ - Max length: 100; + Required On Updates; """ - type: AgreementTypeReference | None = None - company: CompanyReference | None = None - contact: ContactReference | None = None - site: SiteReference | None = None - sub_contract_company: CompanyReference | None = Field( - default=None, alias="subContractCompany" - ) - sub_contract_contact: ContactReference | None = Field( - default=None, alias="subContractContact" - ) - parent_agreement: AgreementReference | None = Field( - default=None, alias="parentAgreement" - ) - customer_po: str | None = Field(default=None, alias="customerPO") + bill_one_time_flag: Annotated[bool | None, Field(alias="billOneTimeFlag")] = None + bill_products: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billProducts") + ] = None """ - Max length: 50; + Required On Updates; """ - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - restrict_location_flag: bool | None = Field( - default=None, alias="restrictLocationFlag" - ) - restrict_department_flag: bool | None = Field( - default=None, alias="restrictDepartmentFlag" - ) - start_date: datetime | None = Field(default=None, alias="startDate") - end_date: datetime | None = Field(default=None, alias="endDate") - no_ending_date_flag: bool | None = Field(default=None, alias="noEndingDateFlag") - opportunity: OpportunityReference | None = None - cancelled_flag: bool | None = Field(default=None, alias="cancelledFlag") - date_cancelled: datetime | None = Field(default=None, alias="dateCancelled") - reason_cancelled: str | None = Field(default=None, alias="reasonCancelled") + bill_start_date: Annotated[datetime | None, Field(alias="billStartDate")] = None + bill_time: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billTime") + ] = None """ - Max length: 100; + Required On Updates; """ - sla: SLAReference | None = None - work_order: str | None = Field(default=None, alias="workOrder") + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + bill_to_contact: Annotated[ContactReference | None, Field(alias="billToContact")] = None + bill_to_site: Annotated[SiteReference | None, Field(alias="billToSite")] = None + billable_expense_invoice: Annotated[bool | None, Field(alias="billableExpenseInvoice")] = None + billable_product_invoice: Annotated[bool | None, Field(alias="billableProductInvoice")] = None + billable_time_invoice: Annotated[bool | None, Field(alias="billableTimeInvoice")] = None + billing_cycle: Annotated[BillingCycleReference | None, Field(alias="billingCycle")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + bottom_comment: Annotated[bool | None, Field(alias="bottomComment")] = None + cancelled_flag: Annotated[bool | None, Field(alias="cancelledFlag")] = None + carry_over_unused: Annotated[bool | None, Field(alias="carryOverUnused")] = None + charge_to_firm: Annotated[bool | None, Field(alias="chargeToFirm")] = None + comp_hourly_rate: Annotated[float | None, Field(alias="compHourlyRate")] = None + comp_limit_amount: Annotated[float | None, Field(alias="compLimitAmount")] = None + company: CompanyReference | None = None + company_location: Annotated[SystemLocationReference | None, Field(alias="companyLocation")] = None + contact: ContactReference | None = None + cover_agreement_expense: Annotated[bool | None, Field(alias="coverAgreementExpense")] = None + cover_agreement_product: Annotated[bool | None, Field(alias="coverAgreementProduct")] = None + cover_agreement_time: Annotated[bool | None, Field(alias="coverAgreementTime")] = None + cover_sales_tax: Annotated[bool | None, Field(alias="coverSalesTax")] = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_po: Annotated[str | None, Field(alias="customerPO")] = None """ - Max length: 20; + Max length: 50; """ - internal_notes: str | None = Field(default=None, alias="internalNotes") - application_units: Literal["Amount", "Hours", "Incidents"] | None = Field( - default=None, alias="applicationUnits" - ) - application_limit: float | None = Field(default=None, alias="applicationLimit") - application_cycle: Literal[ - "Contract2Weeks", - "Contract4Weeks", - "ContractYear", - "CalendarMonth", - "CalendarQuarter", - "CalendarWeek", - "ContractQuarter", - "CalendarYear", - ] | None = Field(default=None, alias="applicationCycle") - application_unlimited_flag: bool | None = Field( - default=None, alias="applicationUnlimitedFlag" - ) - one_time_flag: bool | None = Field(default=None, alias="oneTimeFlag") - cover_agreement_time: bool | None = Field(default=None, alias="coverAgreementTime") - cover_agreement_product: bool | None = Field( - default=None, alias="coverAgreementProduct" - ) - cover_agreement_expense: bool | None = Field( - default=None, alias="coverAgreementExpense" - ) - cover_sales_tax: bool | None = Field(default=None, alias="coverSalesTax") - carry_over_unused: bool | None = Field(default=None, alias="carryOverUnused") - allow_overruns: bool | None = Field(default=None, alias="allowOverruns") - expired_days: int | None = Field(default=None, alias="expiredDays") - limit: int | None = None - expire_when_zero: bool | None = Field(default=None, alias="expireWhenZero") - charge_to_firm: bool | None = Field(default=None, alias="chargeToFirm") - employee_comp_rate: Literal["Actual", "Hourly"] | None = Field( - default=None, alias="employeeCompRate" - ) + date_cancelled: Annotated[datetime | None, Field(alias="dateCancelled")] = None + department: SystemDepartmentReference | None = None + employee_comp_not_exceed: Annotated[ + Literal["Billing", "Amount", "Percent"] | None, Field(alias="employeeCompNotExceed") + ] = None + employee_comp_rate: Annotated[Literal["Actual", "Hourly"] | None, Field(alias="employeeCompRate")] = None """ Required On Updates; """ - employee_comp_not_exceed: Literal["Billing", "Amount", "Percent"] | None = Field( - default=None, alias="employeeCompNotExceed" - ) - comp_hourly_rate: float | None = Field(default=None, alias="compHourlyRate") - comp_limit_amount: float | None = Field(default=None, alias="compLimitAmount") - billing_cycle: BillingCycleReference | None = Field( - default=None, alias="billingCycle" - ) - bill_one_time_flag: bool | None = Field(default=None, alias="billOneTimeFlag") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - invoicing_cycle: Literal["ContractYear", "CalendarYear"] | None = Field( - default=None, alias="invoicingCycle" - ) + end_date: Annotated[datetime | None, Field(alias="endDate")] = None + expire_when_zero: Annotated[bool | None, Field(alias="expireWhenZero")] = None + expired_days: Annotated[int | None, Field(alias="expiredDays")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None + invoice_description: Annotated[str | None, Field(alias="invoiceDescription")] = None + invoice_template: Annotated[InvoiceTemplateReference | None, Field(alias="invoiceTemplate")] = None + invoicing_cycle: Annotated[Literal["ContractYear", "CalendarYear"] | None, Field(alias="invoicingCycle")] = None """ Required On Updates; """ - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - bill_to_contact: ContactReference | None = Field( - default=None, alias="billToContact" - ) - bill_to_site: SiteReference | None = Field(default=None, alias="billToSite") - bill_amount: float | None = Field(default=None, alias="billAmount") - taxable: bool | None = None - prorate_first_bill: float | None = Field(default=None, alias="prorateFirstBill") - bill_start_date: datetime | None = Field(default=None, alias="billStartDate") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - restrict_down_payment: bool | None = Field( - default=None, alias="restrictDownPayment" - ) - prorate_flag: bool | None = Field(default=None, alias="prorateFlag") - invoice_prorated_additions_flag: bool | None = Field( - default=None, alias="invoiceProratedAdditionsFlag" - ) - invoice_description: str | None = Field(default=None, alias="invoiceDescription") - top_comment: bool | None = Field(default=None, alias="topComment") - bottom_comment: bool | None = Field(default=None, alias="bottomComment") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - project_type: ProjectTypeReference | None = Field(default=None, alias="projectType") - invoice_template: InvoiceTemplateReference | None = Field( - default=None, alias="invoiceTemplate" - ) - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) + limit: int | None = None + location: SystemLocationReference | None = None + name: str """ - Required On Updates; + Max length: 100; """ - bill_expenses: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billExpenses") + next_invoice_date: Annotated[datetime | None, Field(alias="nextInvoiceDate")] = None + no_ending_date_flag: Annotated[bool | None, Field(alias="noEndingDateFlag")] = None + one_time_flag: Annotated[bool | None, Field(alias="oneTimeFlag")] = None + opportunity: OpportunityReference | None = None + parent_agreement: Annotated[AgreementReference | None, Field(alias="parentAgreement")] = None + period_type: Annotated[Literal["Current", "Future", "Both", "Undefined"] | None, Field(alias="periodType")] = None + project_type: Annotated[ProjectTypeReference | None, Field(alias="projectType")] = None + prorate_first_bill: Annotated[float | None, Field(alias="prorateFirstBill")] = None + prorate_flag: Annotated[bool | None, Field(alias="prorateFlag")] = None + reason_cancelled: Annotated[str | None, Field(alias="reasonCancelled")] = None """ - Required On Updates; + Max length: 100; """ - bill_products: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billProducts") + restrict_department_flag: Annotated[bool | None, Field(alias="restrictDepartmentFlag")] = None + restrict_down_payment: Annotated[bool | None, Field(alias="restrictDownPayment")] = None + restrict_location_flag: Annotated[bool | None, Field(alias="restrictLocationFlag")] = None + site: SiteReference | None = None + sla: SLAReference | None = None + start_date: Annotated[datetime | None, Field(alias="startDate")] = None + sub_contract_company: Annotated[CompanyReference | None, Field(alias="subContractCompany")] = None + sub_contract_contact: Annotated[ContactReference | None, Field(alias="subContractContact")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + taxable: bool | None = None + top_comment: Annotated[bool | None, Field(alias="topComment")] = None + type: AgreementTypeReference | None = None + work_order: Annotated[str | None, Field(alias="workOrder")] = None """ - Required On Updates; + Max length: 20; """ - billable_time_invoice: bool | None = Field( - default=None, alias="billableTimeInvoice" - ) - billable_expense_invoice: bool | None = Field( - default=None, alias="billableExpenseInvoice" - ) - billable_product_invoice: bool | None = Field( - default=None, alias="billableProductInvoice" - ) - currency: CurrencyReference | None = None - period_type: Literal["Current", "Future", "Both", "Undefined"] | None = Field( - default=None, alias="periodType" - ) - auto_invoice_flag: bool | None = Field(default=None, alias="autoInvoiceFlag") - next_invoice_date: str | None = Field(default=None, alias="nextInvoiceDate") - company_location: SystemLocationReference | None = Field( - default=None, alias="companyLocation" - ) - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_contact: ContactReference | None = Field( - default=None, alias="shipToContact" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") - agreement_status: Literal[ - "Active", "Cancelled", "Expired", "Inactive" - ] | None = Field(default=None, alias="agreementStatus") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class AgreementAdjustment(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None amount: float | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None description: str | None = None """ Max length: 1000; """ - effective_date: datetime | None = Field(default=None, alias="effectiveDate") - agreement_id: int | None = Field(default=None, alias="agreementId") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) - - -class AgreementApplicationParameters(ConnectWiseModel): - application_unit: AgreementApplicationUnit | None = Field( - default=None, alias="applicationUnit" - ) - application_limit: AgreementApplicationLimit | None = Field( - default=None, alias="applicationLimit" - ) - application_limit_amount: float | None = Field( - default=None, alias="applicationLimitAmount" - ) - available_per: AgreementApplicationAviablePer | None = Field( - default=None, alias="availablePer" - ) - covers_time_flag: bool | None = Field(default=None, alias="coversTimeFlag") - covers_expenses_flag: bool | None = Field(default=None, alias="coversExpensesFlag") - covers_products_flag: bool | None = Field(default=None, alias="coversProductsFlag") - covers_tax_flag: bool | None = Field(default=None, alias="coversTaxFlag") - carryover_unused_flag: bool | None = Field( - default=None, alias="carryoverUnusedFlag" - ) - carry_over_days: int | None = Field(default=None, alias="carryOverDays") - allow_overruns_flag: bool | None = Field(default=None, alias="allowOverrunsFlag") - overrun_limit: int | None = Field(default=None, alias="overrunLimit") - agreement_expires_flag: bool | None = Field( - default=None, alias="agreementExpiresFlag" - ) - charge_adjustments_flag: bool | None = Field( - default=None, alias="chargeAdjustmentsFlag" - ) - prepay_flag: bool | None = Field(default=None, alias="prepayFlag") - agr_billing_cycle: AgreementApplicationBillingCycle | None = Field( - default=None, alias="agrBillingCycle" - ) - user_defined_field_values: list[UserDefinedFieldValueModel] | None = Field( - default=None, alias="userDefinedFieldValues" - ) - - -class AgreementRecurringParameters(ConnectWiseModel): - billing_cycle: GenericNameIdDTO | None = Field(default=None, alias="billingCycle") - cycle_base: GenericNameIdDTO | None = Field(default=None, alias="cycleBase") - a_gr_amount: float | None = Field(default=None, alias="aGRAmount") - taxable: bool | None = None - children_amount: float | None = Field(default=None, alias="childrenAmount") - additions_amount: float | None = Field(default=None, alias="additionsAmount") - total_amount: float | None = Field(default=None, alias="totalAmount") - a_gr_prorate: float | None = Field(default=None, alias="aGRProrate") - bill_start_date: str | None = Field(default=None, alias="billStartDate") - tax_code: GenericNameIdDTO | None = Field(default=None, alias="taxCode") - terms: GenericNameIdDTO | None = None - prorate_flag: bool | None = Field(default=None, alias="prorateFlag") - invoice_prorated_additions_flag: bool | None = Field( - default=None, alias="invoiceProratedAdditionsFlag" - ) - restrict_downpayment: bool | None = Field(default=None, alias="restrictDownpayment") - currency: GenericNameIdDTO | None = None - auto_invoice_flag: bool | None = Field(default=None, alias="autoInvoiceFlag") - user_defined_field_values: list[UserDefinedFieldValueModel] | None = Field( - default=None, alias="userDefinedFieldValues" - ) + effective_date: Annotated[datetime | None, Field(alias="effectiveDate")] = None + id: int | None = None class AgreementSite(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None company: CompanyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + id: int | None = None site: SiteReference | None = None - agreement_id: int | None = Field(default=None, alias="agreementId") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class AgreementType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_work_role_exclusions: Annotated[bool | None, Field(alias="addAllWorkRoleExclusions")] = None + add_all_work_type_exclusions: Annotated[bool | None, Field(alias="addAllWorkTypeExclusions")] = None + allow_overruns_flag: Annotated[bool | None, Field(alias="allowOverrunsFlag")] = None + application_cycle: Annotated[ + Literal[ + "Contract2Weeks", + "Contract4Weeks", + "ContractYear", + "CalendarMonth", + "CalendarQuarter", + "CalendarWeek", + "ContractQuarter", + "CalendarYear", + ] + | None, + Field(alias="applicationCycle"), + ] = None + application_limit: Annotated[float | None, Field(alias="applicationLimit")] = None + application_units: Annotated[Literal["Amount", "Hours", "Incidents"] | None, Field(alias="applicationUnits")] = None + application_unlimited_flag: Annotated[bool | None, Field(alias="applicationUnlimitedFlag")] = None + auto_invoice_flag: Annotated[bool | None, Field(alias="autoInvoiceFlag")] = None + bill_amount: Annotated[float | None, Field(alias="billAmount")] = None + bill_expenses: Annotated[Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"], Field(alias="billExpenses")] + bill_one_time_flag: Annotated[bool | None, Field(alias="billOneTimeFlag")] = None + bill_products: Annotated[Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"], Field(alias="billProducts")] + bill_time: Annotated[Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"], Field(alias="billTime")] + billable_expense_invoice_flag: Annotated[bool | None, Field(alias="billableExpenseInvoiceFlag")] = None + billable_product_invoice_flag: Annotated[bool | None, Field(alias="billableProductInvoiceFlag")] = None + billable_time_invoice_flag: Annotated[bool | None, Field(alias="billableTimeInvoiceFlag")] = None + billing_cycle: Annotated[BillingCycleReference | None, Field(alias="billingCycle")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + bottom_comment_flag: Annotated[bool | None, Field(alias="bottomCommentFlag")] = None + carry_over_unused_flag: Annotated[bool | None, Field(alias="carryOverUnusedFlag")] = None + charge_to_firm_flag: Annotated[bool | None, Field(alias="chargeToFirmFlag")] = None + comp_hourly_rate: Annotated[float | None, Field(alias="compHourlyRate")] = None + comp_limit_amount: Annotated[float | None, Field(alias="compLimitAmount")] = None + copy_work_roles_flag: Annotated[bool | None, Field(alias="copyWorkRolesFlag")] = None + copy_work_types_flag: Annotated[bool | None, Field(alias="copyWorkTypesFlag")] = None + cover_agreement_expense_flag: Annotated[bool | None, Field(alias="coverAgreementExpenseFlag")] = None + cover_agreement_product_flag: Annotated[bool | None, Field(alias="coverAgreementProductFlag")] = None + cover_agreement_time_flag: Annotated[bool | None, Field(alias="coverAgreementTimeFlag")] = None + cover_sales_tax_flag: Annotated[bool | None, Field(alias="coverSalesTaxFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + department: SystemDepartmentReference | None = None + email_template: Annotated[EmailTemplateReference | None, Field(alias="emailTemplate")] = None + employee_comp_not_exceed: Annotated[Literal["Billing", "Amount", "Percent"], Field(alias="employeeCompNotExceed")] + employee_comp_rate: Annotated[Literal["Actual", "Hourly"], Field(alias="employeeCompRate")] + exclusion_work_role_ids: Annotated[list[int] | None, Field(alias="exclusionWorkRoleIds")] = None + exclusion_work_type_ids: Annotated[list[int] | None, Field(alias="exclusionWorkTypeIds")] = None + expire_when_zero: Annotated[bool | None, Field(alias="expireWhenZero")] = None + expired_days: Annotated[int | None, Field(alias="expiredDays")] = None id: int | None = None - name: str + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_x_ref: Annotated[str | None, Field(alias="integrationXRef")] = None """ Max length: 50; """ - prefix_suffix_option: Literal["Prefix", "Suffix"] | None = Field( - default=None, alias="prefixSuffixOption" - ) - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - pre_payment_flag: bool | None = Field(default=None, alias="prePaymentFlag") - invoice_pre_suffix: str | None = Field(default=None, alias="invoicePreSuffix") + invoice_description: Annotated[str | None, Field(alias="invoiceDescription")] = None + """ + Max length: 4000; + """ + invoice_pre_suffix: Annotated[str | None, Field(alias="invoicePreSuffix")] = None """ Max length: 5; """ - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - restrict_location_flag: bool | None = Field( - default=None, alias="restrictLocationFlag" - ) - restrict_department_flag: bool | None = Field( - default=None, alias="restrictDepartmentFlag" - ) - sla: SLAReference | None = None - application_units: Literal["Amount", "Hours", "Incidents"] | None = Field( - default=None, alias="applicationUnits" - ) - application_limit: float | None = Field(default=None, alias="applicationLimit") - application_cycle: Literal[ - "Contract2Weeks", - "Contract4Weeks", - "ContractYear", - "CalendarMonth", - "CalendarQuarter", - "CalendarWeek", - "ContractQuarter", - "CalendarYear", - ] | None = Field(default=None, alias="applicationCycle") - application_unlimited_flag: bool | None = Field( - default=None, alias="applicationUnlimitedFlag" - ) - one_time_flag: bool | None = Field(default=None, alias="oneTimeFlag") - cover_agreement_time_flag: bool | None = Field( - default=None, alias="coverAgreementTimeFlag" - ) - cover_agreement_product_flag: bool | None = Field( - default=None, alias="coverAgreementProductFlag" - ) - cover_agreement_expense_flag: bool | None = Field( - default=None, alias="coverAgreementExpenseFlag" - ) - cover_sales_tax_flag: bool | None = Field(default=None, alias="coverSalesTaxFlag") - carry_over_unused_flag: bool | None = Field( - default=None, alias="carryOverUnusedFlag" - ) - allow_overruns_flag: bool | None = Field(default=None, alias="allowOverrunsFlag") - expired_days: int | None = Field(default=None, alias="expiredDays") + invoice_template: Annotated[InvoiceTemplateReference | None, Field(alias="invoiceTemplate")] = None + invoicing_cycle: Annotated[Literal["ContractYear", "CalendarYear"], Field(alias="invoicingCycle")] limit: int | None = None - expire_when_zero: bool | None = Field(default=None, alias="expireWhenZero") - charge_to_firm_flag: bool | None = Field(default=None, alias="chargeToFirmFlag") - employee_comp_rate: Literal["Actual", "Hourly"] = Field( - ..., alias="employeeCompRate" - ) - employee_comp_not_exceed: Literal["Billing", "Amount", "Percent"] = Field( - ..., alias="employeeCompNotExceed" - ) - comp_hourly_rate: float | None = Field(default=None, alias="compHourlyRate") - comp_limit_amount: float | None = Field(default=None, alias="compLimitAmount") - billing_cycle: BillingCycleReference | None = Field( - default=None, alias="billingCycle" - ) - bill_one_time_flag: bool | None = Field(default=None, alias="billOneTimeFlag") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - invoicing_cycle: Literal["ContractYear", "CalendarYear"] = Field( - ..., alias="invoicingCycle" - ) - bill_amount: float | None = Field(default=None, alias="billAmount") - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - restrict_down_payment_flag: bool | None = Field( - default=None, alias="restrictDownPaymentFlag" - ) - invoice_description: str | None = Field(default=None, alias="invoiceDescription") + location: SystemLocationReference | None = None + name: str """ - Max length: 4000; + Max length: 50; """ - top_comment_flag: bool | None = Field(default=None, alias="topCommentFlag") - bottom_comment_flag: bool | None = Field(default=None, alias="bottomCommentFlag") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - project_type: ProjectTypeReference | None = Field(default=None, alias="projectType") - invoice_template: InvoiceTemplateReference | None = Field( - default=None, alias="invoiceTemplate" - ) - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] = Field( - ..., alias="billTime" - ) - bill_expenses: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] = Field( - ..., alias="billExpenses" - ) - bill_products: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] = Field( - ..., alias="billProducts" - ) - billable_time_invoice_flag: bool | None = Field( - default=None, alias="billableTimeInvoiceFlag" - ) - billable_expense_invoice_flag: bool | None = Field( - default=None, alias="billableExpenseInvoiceFlag" - ) - billable_product_invoice_flag: bool | None = Field( - default=None, alias="billableProductInvoiceFlag" - ) - copy_work_roles_flag: bool | None = Field(default=None, alias="copyWorkRolesFlag") - copy_work_types_flag: bool | None = Field(default=None, alias="copyWorkTypesFlag") - exclusion_work_role_ids: list[int] | None = Field( - default=None, alias="exclusionWorkRoleIds" - ) - add_all_work_role_exclusions: bool | None = Field( - default=None, alias="addAllWorkRoleExclusions" - ) - remove_all_work_role_exclusions: bool | None = Field( - default=None, alias="removeAllWorkRoleExclusions" - ) - exclusion_work_type_ids: list[int] | None = Field( - default=None, alias="exclusionWorkTypeIds" - ) - add_all_work_type_exclusions: bool | None = Field( - default=None, alias="addAllWorkTypeExclusions" - ) - remove_all_work_type_exclusions: bool | None = Field( - default=None, alias="removeAllWorkTypeExclusions" - ) - integration_x_ref: str | None = Field(default=None, alias="integrationXRef") - """ - Max length: 50; - """ - prorate_flag: bool | None = Field(default=None, alias="prorateFlag") - email_template: EmailTemplateReference | None = Field( - default=None, alias="emailTemplate" - ) - auto_invoice_flag: bool | None = Field(default=None, alias="autoInvoiceFlag") - invoice_prorated_additions_flag: bool | None = Field( - default=None, alias="invoiceProratedAdditionsFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + one_time_flag: Annotated[bool | None, Field(alias="oneTimeFlag")] = None + pre_payment_flag: Annotated[bool | None, Field(alias="prePaymentFlag")] = None + prefix_suffix_option: Annotated[Literal["Prefix", "Suffix"] | None, Field(alias="prefixSuffixOption")] = None + project_type: Annotated[ProjectTypeReference | None, Field(alias="projectType")] = None + prorate_flag: Annotated[bool | None, Field(alias="prorateFlag")] = None + remove_all_work_role_exclusions: Annotated[bool | None, Field(alias="removeAllWorkRoleExclusions")] = None + remove_all_work_type_exclusions: Annotated[bool | None, Field(alias="removeAllWorkTypeExclusions")] = None + restrict_department_flag: Annotated[bool | None, Field(alias="restrictDepartmentFlag")] = None + restrict_down_payment_flag: Annotated[bool | None, Field(alias="restrictDownPaymentFlag")] = None + restrict_location_flag: Annotated[bool | None, Field(alias="restrictLocationFlag")] = None + sla: SLAReference | None = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None + top_comment_flag: Annotated[bool | None, Field(alias="topCommentFlag")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class AgreementTypeBoardDefault(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + department: SystemDepartmentReference | None = None id: int | None = None - type: AgreementTypeReference | None = None location: SystemLocationReference - department: SystemDepartmentReference | None = None - board: BoardReference | None = None - service_type: ServiceTypeReference | None = Field(default=None, alias="serviceType") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + service_type: Annotated[ServiceTypeReference | None, Field(alias="serviceType")] = None + type: AgreementTypeReference | None = None class AgreementTypeWorkRole(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + effective_date: Annotated[datetime | None, Field(alias="effectiveDate")] = None + ending_date: Annotated[datetime | None, Field(alias="endingDate")] = None id: int | None = None - type: AgreementTypeReference | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - effective_date: datetime | None = Field(default=None, alias="effectiveDate") - ending_date: datetime | None = Field(default=None, alias="endingDate") + limit_to: Annotated[float | None, Field(alias="limitTo")] = None rate: float | None = None - rate_type: Literal["AdjAmount", "Custom", "Multiplier"] = Field( - ..., alias="rateType" - ) - limit_to: float | None = Field(default=None, alias="limitTo") - info: dict[str, str] | None = Field(default=None, alias="_info") + rate_type: Annotated[Literal["AdjAmount", "Custom", "Multiplier"], Field(alias="rateType")] + type: AgreementTypeReference | None = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None class AgreementTypeWorkRoleExclusion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None type: AgreementTypeReference | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - info: dict[str, str] | None = Field(default=None, alias="_info") + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None class AgreementTypeWorkRoleInfo(AgreementTypeWorkRoleExclusion): @@ -7997,853 +6558,609 @@ class AgreementTypeWorkRoleInfo(AgreementTypeWorkRoleExclusion): class AgreementTypeWorkType(ConnectWiseModel): - id: int | None = None - type: AgreementTypeReference | None = None - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - effective_date: datetime | None = Field(default=None, alias="effectiveDate") - ending_date: datetime | None = Field(default=None, alias="endingDate") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + bill_time: Annotated[Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"], Field(alias="billTime")] + effective_date: Annotated[datetime | None, Field(alias="effectiveDate")] = None + ending_date: Annotated[datetime | None, Field(alias="endingDate")] = None + hours_max: Annotated[float | None, Field(alias="hoursMax")] = None + hours_min: Annotated[float | None, Field(alias="hoursMin")] = None + id: int | None = None + limit_to: Annotated[float | None, Field(alias="limitTo")] = None + overage_rate: Annotated[float | None, Field(alias="overageRate")] = None + overage_rate_type: Annotated[Literal["AdjAmount", "Custom", "Multiplier"], Field(alias="overageRateType")] rate: float | None = None - rate_type: Literal["AdjAmount", "Custom", "Multiplier"] = Field( - ..., alias="rateType" - ) - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] = Field( - ..., alias="billTime" - ) - hours_min: float | None = Field(default=None, alias="hoursMin") - hours_max: float | None = Field(default=None, alias="hoursMax") - round_bill_hours: float | None = Field(default=None, alias="roundBillHours") - overage_rate: float | None = Field(default=None, alias="overageRate") - overage_rate_type: Literal["AdjAmount", "Custom", "Multiplier"] = Field( - ..., alias="overageRateType" - ) - limit_to: float | None = Field(default=None, alias="limitTo") - info: dict[str, str] | None = Field(default=None, alias="_info") + rate_type: Annotated[Literal["AdjAmount", "Custom", "Multiplier"], Field(alias="rateType")] + round_bill_hours: Annotated[float | None, Field(alias="roundBillHours")] = None + type: AgreementTypeReference | None = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class AgreementTypeWorkTypeExclusion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None type: AgreementTypeReference | None = None - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - info: dict[str, str] | None = Field(default=None, alias="_info") + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class AgreementWorkRole(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None + effective_date: Annotated[datetime | None, Field(alias="effectiveDate")] = None + ending_date: Annotated[datetime | None, Field(alias="endingDate")] = None id: int | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - location_id: int | None = Field(default=None, alias="locationId") - rate_type: Literal["AdjAmount", "Custom", "Multiplier"] = Field( - ..., alias="rateType" - ) + limit_to: Annotated[float | None, Field(alias="limitTo")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None rate: float | None = None - limit_to: float | None = Field(default=None, alias="limitTo") - effective_date: datetime | None = Field(default=None, alias="effectiveDate") - ending_date: datetime | None = Field(default=None, alias="endingDate") - agreement_id: int | None = Field(default=None, alias="agreementId") - info: dict[str, str] | None = Field(default=None, alias="_info") + rate_type: Annotated[Literal["AdjAmount", "Custom", "Multiplier"], Field(alias="rateType")] + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None class AgreementWorkRoleExclusion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None id: int | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - agreement_id: int | None = Field(default=None, alias="agreementId") - info: dict[str, str] | None = Field(default=None, alias="_info") + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None class AgreementWorkType(ConnectWiseModel): - id: int | None = None - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - location: OwnerLevelReference | None = None - location_id: int | None = Field(default=None, alias="locationId") - rate_type: Literal["AdjAmount", "Custom", "Multiplier"] = Field( - ..., alias="rateType" - ) - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] = Field( - ..., alias="billTime" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None + agreement_limit: Annotated[float | None, Field(alias="agreementLimit")] = None + bill_time: Annotated[Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"], Field(alias="billTime")] + company: CompanyReference | None = None + effective_date: Annotated[datetime | None, Field(alias="effectiveDate")] = None + ending_date: Annotated[datetime | None, Field(alias="endingDate")] = None + hours_max: Annotated[float | None, Field(alias="hoursMax")] = None + hours_min: Annotated[float | None, Field(alias="hoursMin")] = None + id: int | None = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + overage_rate: Annotated[float | None, Field(alias="overageRate")] = None + overage_rate_type: Annotated[ + Literal["AdjAmount", "Custom", "Multiplier"] | None, Field(alias="overageRateType") + ] = None rate: float | None = None - hours_max: float | None = Field(default=None, alias="hoursMax") - hours_min: float | None = Field(default=None, alias="hoursMin") - round_bill_hours: float | None = Field(default=None, alias="roundBillHours") - overage_rate: float | None = Field(default=None, alias="overageRate") - overage_rate_type: Literal["AdjAmount", "Custom", "Multiplier"] | None = Field( - default=None, alias="overageRateType" - ) - agreement_limit: float | None = Field(default=None, alias="agreementLimit") + rate_type: Annotated[Literal["AdjAmount", "Custom", "Multiplier"], Field(alias="rateType")] + round_bill_hours: Annotated[float | None, Field(alias="roundBillHours")] = None site: SiteReference | None = None - effective_date: datetime | None = Field(default=None, alias="effectiveDate") - ending_date: datetime | None = Field(default=None, alias="endingDate") - agreement: AgreementReference | None = None - agreement_id: int | None = Field(default=None, alias="agreementId") - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class AgreementWorkTypeExclusion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None id: int | None = None - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - agreement_id: int | None = Field(default=None, alias="agreementId") - info: dict[str, str] | None = Field(default=None, alias="_info") + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class ApiMember(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + block_cost_flag: Annotated[bool | None, Field(alias="blockCostFlag")] = None + block_price_flag: Annotated[bool | None, Field(alias="blockPriceFlag")] = None + default_department: Annotated[SystemDepartmentReference | None, Field(alias="defaultDepartment")] = None + default_location: Annotated[SystemLocationReference | None, Field(alias="defaultLocation")] = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None + """ + Max length: 250; + """ + excluded_service_board_ids: Annotated[list[int] | None, Field(alias="excludedServiceBoardIds")] = None id: int | None = None identifier: str """ Max length: 15; """ + inactive_date: Annotated[datetime | None, Field(alias="inactiveDate")] = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None """ Max length: 30; Required On Updates; """ - email_address: str | None = Field(default=None, alias="emailAddress") - """ - Max length: 250; - """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - inactive_date: datetime | None = Field(default=None, alias="inactiveDate") - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - security_role: SecurityRoleReference | None = Field( - default=None, alias="securityRole" - ) - structure_level: StructureReference | None = Field( - default=None, alias="structureLevel" - ) - security_location: SystemLocationReference | None = Field( - default=None, alias="securityLocation" - ) - default_location: SystemLocationReference | None = Field( - default=None, alias="defaultLocation" - ) - default_department: SystemDepartmentReference | None = Field( - default=None, alias="defaultDepartment" - ) - sales_default_location: SystemLocationReference | None = Field( - default=None, alias="salesDefaultLocation" - ) - service_default_board: BoardReference | None = Field( - default=None, alias="serviceDefaultBoard" - ) notes: str | None = None - excluded_service_board_ids: list[int] | None = Field( - default=None, alias="excludedServiceBoardIds" - ) - block_price_flag: bool | None = Field(default=None, alias="blockPriceFlag") - block_cost_flag: bool | None = Field(default=None, alias="blockCostFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + sales_default_location: Annotated[SystemLocationReference | None, Field(alias="salesDefaultLocation")] = None + security_location: Annotated[SystemLocationReference | None, Field(alias="securityLocation")] = None + security_role: Annotated[SecurityRoleReference | None, Field(alias="securityRole")] = None + service_default_board: Annotated[BoardReference | None, Field(alias="serviceDefaultBoard")] = None + structure_level: Annotated[StructureReference | None, Field(alias="structureLevel")] = None + time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="timeZone")] = None class ApiRequest(ConnectWiseModel): - id: int | None = None - external_id: str | None = Field(default=None, alias="externalId") - parent_id: int | None = Field(default=None, alias="parentId") - grand_parent_id: int | None = Field(default=None, alias="grandParentId") entity: IRestIdentifiedItem | None = None + external_id: Annotated[str | None, Field(alias="externalId")] = None + fields: str | None = None filters: FilterValues | None = None - page: PageValues | None = None format: str | None = None - fields: str | None = None - misc_properties: dict[str, dict[str, Any]] | None = Field( - default=None, alias="miscProperties" - ) - member_context: str | None = Field(default=None, alias="memberContext") - update_only_ces_properties: bool | None = Field( - default=None, alias="updateOnlyCesProperties" - ) + grand_parent_id: Annotated[int | None, Field(alias="grandParentId")] = None + id: int | None = None + member_context: Annotated[str | None, Field(alias="memberContext")] = None + misc_properties: Annotated[dict[str, dict[str, Any]] | None, Field(alias="miscProperties")] = None + page: PageValues | None = None + parent_id: Annotated[int | None, Field(alias="parentId")] = None class AutoSyncTime(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - sync_time: str = Field(..., alias="syncTime") - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - info: dict[str, str] | None = Field(default=None, alias="_info") + sync_time: Annotated[str, Field(alias="syncTime")] + time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="timeZone")] = None class BatchEntry(ConnectWiseModel): - id: int | None = None - account_type: str | None = Field(default=None, alias="accountType") - name: str | None = None - account_number: str | None = Field(default=None, alias="accountNumber") - debit: float | None = None - credit: float | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + account_type: Annotated[str | None, Field(alias="accountType")] = None + adjustment_detail: Annotated[AdjustmentDetailReference | None, Field(alias="adjustmentDetail")] = None cost: float | None = None - item: str | None = None - sales_code: str | None = Field(default=None, alias="salesCode") - cost_of_goods_sold_account_number: str | None = Field( - default=None, alias="costOfGoodsSoldAccountNumber" - ) + cost_of_goods_sold_account_number: Annotated[str | None, Field(alias="costOfGoodsSoldAccountNumber")] = None + credit: float | None = None + debit: float | None = None + expense: ExpenseDetailReference | None = None + id: int | None = None invoice: InvoiceReference | None = None - purchase_order: PurchaseOrderReference | None = Field( - default=None, alias="purchaseOrder" - ) - line_item: PurchaseOrderLineItemReference | None = Field( - default=None, alias="lineItem" - ) + item: str | None = None + line_item: Annotated[PurchaseOrderLineItemReference | None, Field(alias="lineItem")] = None + name: str | None = None + purchase_order: Annotated[PurchaseOrderReference | None, Field(alias="purchaseOrder")] = None + sales_code: Annotated[str | None, Field(alias="salesCode")] = None transfer: str | None = None - expense: ExpenseDetailReference | None = None - adjustment_detail: AdjustmentDetailReference | None = Field( - default=None, alias="adjustmentDetail" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class BillingSetup(ConnectWiseModel): - id: int | None = None - remit_name: str = Field(..., alias="remitName") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + address_one: Annotated[str | None, Field(alias="addressOne")] = None """ Max length: 50; """ - location: SystemLocationReference - address_one: str | None = Field(default=None, alias="addressOne") + address_two: Annotated[str | None, Field(alias="addressTwo")] = None """ Max length: 50; """ - address_two: str | None = Field(default=None, alias="addressTwo") + agreement_invoice: Annotated[InvoiceTemplateReference | None, Field(alias="agreementInvoice")] = None + allow_restricted_dept_on_routing_flag: Annotated[ + bool | None, Field(alias="allowRestrictedDeptOnRoutingFlag") + ] = None + bill_product_after_ship_flag: Annotated[bool | None, Field(alias="billProductAfterShipFlag")] = None + bill_project_complete_flag: Annotated[bool | None, Field(alias="billProjectCompleteFlag")] = None + bill_project_unapproved_flag: Annotated[bool | None, Field(alias="billProjectUnapprovedFlag")] = None + bill_sales_order_complete_flag: Annotated[bool | None, Field(alias="billSalesOrderCompleteFlag")] = None + bill_ticket_complete_flag: Annotated[bool | None, Field(alias="billTicketCompleteFlag")] = None + bill_ticket_separately_flag: Annotated[bool | None, Field(alias="billTicketSeparatelyFlag")] = None + bill_ticket_unapproved_flag: Annotated[bool | None, Field(alias="billTicketUnapprovedFlag")] = None + business_number: Annotated[str | None, Field(alias="businessNumber")] = None """ Max length: 50; """ + charge_adj_to_firm_flag: Annotated[bool | None, Field(alias="chargeAdjToFirmFlag")] = None city: str | None = None """ Max length: 50; """ - state: StateReference | None = None - zip: str | None = None + company_code: Annotated[str | None, Field(alias="companyCode")] = None """ - Max length: 12; + Max length: 250; """ + copy_agreement_products_flag: Annotated[bool | None, Field(alias="copyAgreementProductsFlag")] = None + copy_non_service_products_flag: Annotated[bool | None, Field(alias="copyNonServiceProductsFlag")] = None + copy_service_products_flag: Annotated[bool | None, Field(alias="copyServiceProductsFlag")] = None country: CountryReference | None = None - phone: str | None = None + credit_memo_invoice: Annotated[InvoiceTemplateReference | None, Field(alias="creditMemoInvoice")] = None + currency: CurrencyReference | None = None + custom_label: Annotated[str | None, Field(alias="customLabel")] = None """ - Max length: 15; + Max length: 50; """ - invoice_title: str = Field(..., alias="invoiceTitle") + custom_text: Annotated[str | None, Field(alias="customText")] = None """ - Max length: 50; + Max length: 500; """ - payable_name: str = Field(..., alias="payableName") + delivery_receipt_flag: Annotated[bool | None, Field(alias="deliveryReceiptFlag")] = None + disable_routing_email_flag: Annotated[bool | None, Field(alias="disableRoutingEmailFlag")] = None + display_tax_flag: Annotated[bool | None, Field(alias="displayTaxFlag")] = None + down_payment_invoice: Annotated[InvoiceTemplateReference | None, Field(alias="downPaymentInvoice")] = None + email_template: Annotated[EmailTemplateReference, Field(alias="emailTemplate")] + exclude_avalara_flag: Annotated[bool | None, Field(alias="excludeAvalaraFlag")] = None + exclude_do_not_bill_expense_flag: Annotated[bool | None, Field(alias="excludeDoNotBillExpenseFlag")] = None + exclude_do_not_bill_product_flag: Annotated[bool | None, Field(alias="excludeDoNotBillProductFlag")] = None + exclude_do_not_bill_time_flag: Annotated[bool | None, Field(alias="excludeDoNotBillTimeFlag")] = None + id: int | None = None + invoice_footer: Annotated[str | None, Field(alias="invoiceFooter")] = None """ - Max length: 50; + Max length: 500; """ - topcomment: str | None = None + invoice_title: Annotated[str, Field(alias="invoiceTitle")] """ - Max length: 4000; + Max length: 50; """ - invoice_footer: str | None = Field(default=None, alias="invoiceFooter") + localized_country: Annotated[CountryReference | None, Field(alias="localizedCountry")] = None + location: SystemLocationReference + misc_invoice: Annotated[InvoiceTemplateReference | None, Field(alias="miscInvoice")] = None + no_watermark_flag: Annotated[bool | None, Field(alias="noWatermarkFlag")] = None + overall_invoice_default: Annotated[InvoiceTemplateReference | None, Field(alias="overallInvoiceDefault")] = None + payable_name: Annotated[str, Field(alias="payableName")] """ - Max length: 500; + Max length: 50; """ - quote_footer: str | None = Field(default=None, alias="quoteFooter") + phone: str | None = None """ - Max length: 1000; + Max length: 15; """ - overall_invoice_default: InvoiceTemplateReference | None = Field( - default=None, alias="overallInvoiceDefault" - ) - standard_invoice_actual: InvoiceTemplateReference | None = Field( - default=None, alias="standardInvoiceActual" - ) - standard_invoice_fixed: InvoiceTemplateReference | None = Field( - default=None, alias="standardInvoiceFixed" - ) - progress_invoice: InvoiceTemplateReference | None = Field( - default=None, alias="progressInvoice" - ) - agreement_invoice: InvoiceTemplateReference | None = Field( - default=None, alias="agreementInvoice" - ) - credit_memo_invoice: InvoiceTemplateReference | None = Field( - default=None, alias="creditMemoInvoice" - ) - down_payment_invoice: InvoiceTemplateReference | None = Field( - default=None, alias="downPaymentInvoice" - ) - misc_invoice: InvoiceTemplateReference | None = Field( - default=None, alias="miscInvoice" - ) - sales_order_invoice: InvoiceTemplateReference | None = Field( - default=None, alias="salesOrderInvoice" - ) - exclude_do_not_bill_time_flag: bool | None = Field( - default=None, alias="excludeDoNotBillTimeFlag" - ) - exclude_do_not_bill_expense_flag: bool | None = Field( - default=None, alias="excludeDoNotBillExpenseFlag" - ) - exclude_do_not_bill_product_flag: bool | None = Field( - default=None, alias="excludeDoNotBillProductFlag" - ) - prefix_suffix_flag: Literal["Prefix", "Suffix"] | None = Field( - default=None, alias="prefixSuffixFlag" - ) - prefix_suffix_text: str | None = Field(default=None, alias="prefixSuffixText") + prefix_suffix_flag: Annotated[Literal["Prefix", "Suffix"] | None, Field(alias="prefixSuffixFlag")] = None + prefix_suffix_text: Annotated[str | None, Field(alias="prefixSuffixText")] = None """ Max length: 5; """ - charge_adj_to_firm_flag: bool | None = Field( - default=None, alias="chargeAdjToFirmFlag" - ) - no_watermark_flag: bool | None = Field(default=None, alias="noWatermarkFlag") - display_tax_flag: bool | None = Field(default=None, alias="displayTaxFlag") - allow_restricted_dept_on_routing_flag: bool | None = Field( - default=None, alias="allowRestrictedDeptOnRoutingFlag" - ) - bill_ticket_separately_flag: bool | None = Field( - default=None, alias="billTicketSeparatelyFlag" - ) - bill_ticket_complete_flag: bool | None = Field( - default=None, alias="billTicketCompleteFlag" - ) - bill_ticket_unapproved_flag: bool | None = Field( - default=None, alias="billTicketUnapprovedFlag" - ) - bill_project_complete_flag: bool | None = Field( - default=None, alias="billProjectCompleteFlag" - ) - bill_project_unapproved_flag: bool | None = Field( - default=None, alias="billProjectUnapprovedFlag" - ) - progress_time_flag: bool | None = Field(default=None, alias="progressTimeFlag") - restrict_project_downpayment_flag: bool | None = Field( - default=None, alias="restrictProjectDownpaymentFlag" - ) - bill_sales_order_complete_flag: bool | None = Field( - default=None, alias="billSalesOrderCompleteFlag" - ) - bill_product_after_ship_flag: bool | None = Field( - default=None, alias="billProductAfterShipFlag" - ) - restrict_downpayment_flag: bool | None = Field( - default=None, alias="restrictDownpaymentFlag" - ) - copy_non_service_products_flag: bool | None = Field( - default=None, alias="copyNonServiceProductsFlag" - ) - copy_service_products_flag: bool | None = Field( - default=None, alias="copyServiceProductsFlag" - ) - copy_agreement_products_flag: bool | None = Field( - default=None, alias="copyAgreementProductsFlag" - ) - print_logo_flag: bool | None = Field(default=None, alias="printLogoFlag") - read_receipt_flag: bool | None = Field(default=None, alias="readReceiptFlag") - delivery_receipt_flag: bool | None = Field( - default=None, alias="deliveryReceiptFlag" - ) - attach_xml_invoice_flag: bool | None = Field( - default=None, alias="attachXmlInvoiceFlag" - ) - disable_routing_email_flag: bool | None = Field( - default=None, alias="disableRoutingEmailFlag" - ) - email_template: EmailTemplateReference = Field(..., alias="emailTemplate") - localized_country: CountryReference | None = Field( - default=None, alias="localizedCountry" - ) - business_number: str | None = Field(default=None, alias="businessNumber") + print_logo_flag: Annotated[bool | None, Field(alias="printLogoFlag")] = None + progress_invoice: Annotated[InvoiceTemplateReference | None, Field(alias="progressInvoice")] = None + progress_time_flag: Annotated[bool | None, Field(alias="progressTimeFlag")] = None + quote_footer: Annotated[str | None, Field(alias="quoteFooter")] = None """ - Max length: 50; + Max length: 1000; """ - currency: CurrencyReference | None = None - custom_label: str | None = Field(default=None, alias="customLabel") + read_receipt_flag: Annotated[bool | None, Field(alias="readReceiptFlag")] = None + remit_name: Annotated[str, Field(alias="remitName")] """ Max length: 50; """ - custom_text: str | None = Field(default=None, alias="customText") + restrict_downpayment_flag: Annotated[bool | None, Field(alias="restrictDownpaymentFlag")] = None + restrict_project_downpayment_flag: Annotated[bool | None, Field(alias="restrictProjectDownpaymentFlag")] = None + sales_order_invoice: Annotated[InvoiceTemplateReference | None, Field(alias="salesOrderInvoice")] = None + standard_invoice_actual: Annotated[InvoiceTemplateReference | None, Field(alias="standardInvoiceActual")] = None + standard_invoice_fixed: Annotated[InvoiceTemplateReference | None, Field(alias="standardInvoiceFixed")] = None + state: StateReference | None = None + topcomment: str | None = None """ - Max length: 500; + Max length: 4000; """ - company_code: str | None = Field(default=None, alias="companyCode") + zip: str | None = None """ - Max length: 250; + Max length: 12; """ - exclude_avalara_flag: bool | None = Field(default=None, alias="excludeAvalaraFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class BillingSetupInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + currency: CurrencyReference | None = None id: int | None = None - remit_name: str | None = Field(default=None, alias="remitName") location: SystemLocationReference | None = None - currency: CurrencyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + remit_name: Annotated[str | None, Field(alias="remitName")] = None class BillingSetupRouting(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - sequence_number: int = Field(..., alias="sequenceNumber") - invoice_rule: Literal["All", "Standard", "Project", "Agreement"] = Field( - ..., alias="invoiceRule" - ) - routing_rule: Literal[ - "Account", - "Territory", - "Creator", - "Department", - "Location", - "Member", - "Project", - "Sales", - ] = Field(..., alias="routingRule") + invoice_rule: Annotated[Literal["All", "Standard", "Project", "Agreement"], Field(alias="invoiceRule")] member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + routing_rule: Annotated[ + Literal["Account", "Territory", "Creator", "Department", "Location", "Member", "Project", "Sales"], + Field(alias="routingRule"), + ] + sequence_number: Annotated[int, Field(alias="sequenceNumber")] class Board(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_sort: Annotated[Literal["Ascending", "Descending"] | None, Field(alias="allSort")] = None + auto_assign_new_ec_tickets_flag: Annotated[bool | None, Field(alias="autoAssignNewECTicketsFlag")] = None + auto_assign_new_portal_tickets_flag: Annotated[bool | None, Field(alias="autoAssignNewPortalTicketsFlag")] = None + auto_assign_new_tickets_flag: Annotated[bool | None, Field(alias="autoAssignNewTicketsFlag")] = None + auto_assign_ticket_owner_flag: Annotated[bool | None, Field(alias="autoAssignTicketOwnerFlag")] = None + auto_close_status: Annotated[ServiceStatusReference | None, Field(alias="autoCloseStatus")] = None + bill_expense: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billExpense") + ] = None + bill_product: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billProduct") + ] = None + bill_ticket_separately_flag: Annotated[bool | None, Field(alias="billTicketSeparatelyFlag")] = None + bill_tickets_after_closed_flag: Annotated[bool | None, Field(alias="billTicketsAfterClosedFlag")] = None + bill_time: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billTime") + ] = None + bill_unapproved_time_expense_flag: Annotated[bool | None, Field(alias="billUnapprovedTimeExpenseFlag")] = None + board_icon: Annotated[DocumentReference | None, Field(alias="boardIcon")] = None + closed_loop_all_flag: Annotated[bool | None, Field(alias="closedLoopAllFlag")] = None + closed_loop_discussions_flag: Annotated[bool | None, Field(alias="closedLoopDiscussionsFlag")] = None + closed_loop_internal_analysis_flag: Annotated[bool | None, Field(alias="closedLoopInternalAnalysisFlag")] = None + closed_loop_resolution_flag: Annotated[bool | None, Field(alias="closedLoopResolutionFlag")] = None + contact_template: Annotated[ServiceEmailTemplateReference | None, Field(alias="contactTemplate")] = None + department: SystemDepartmentReference | None = None + discussions_locked_flag: Annotated[bool | None, Field(alias="discussionsLockedFlag")] = None + dispatch_member: Annotated[MemberReference | None, Field(alias="dispatchMember")] = None + duty_manager_member: Annotated[MemberReference | None, Field(alias="dutyManagerMember")] = None + email_connector_allow_reopen_closed_flag: Annotated[ + bool | None, Field(alias="emailConnectorAllowReopenClosedFlag") + ] = None + email_connector_never_reopen_by_days_closed_flag: Annotated[ + bool | None, Field(alias="emailConnectorNeverReopenByDaysClosedFlag") + ] = None """ - Max length: 50; + This field can only be set when emailConnectorAllowReopenClosed is true """ - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - sign_off_template: ServiceSignoffReference | None = Field( - default=None, alias="signOffTemplate" - ) - send_to_contact_flag: bool | None = Field(default=None, alias="sendToContactFlag") - contact_template: ServiceEmailTemplateReference | None = Field( - default=None, alias="contactTemplate" - ) - send_to_resource_flag: bool | None = Field(default=None, alias="sendToResourceFlag") - resource_template: ServiceEmailTemplateReference | None = Field( - default=None, alias="resourceTemplate" - ) - project_flag: bool | None = Field(default=None, alias="projectFlag") - show_dependencies_flag: bool | None = Field( - default=None, alias="showDependenciesFlag" - ) + email_connector_never_reopen_by_days_flag: Annotated[ + bool | None, Field(alias="emailConnectorNeverReopenByDaysFlag") + ] = None """ - This field only shows if it is Project Board. + This field can only be set when emailConnectorAllowReopenClosed is true """ - show_estimates_flag: bool | None = Field(default=None, alias="showEstimatesFlag") + email_connector_new_ticket_no_match_flag: Annotated[ + bool | None, Field(alias="emailConnectorNewTicketNoMatchFlag") + ] = None """ - This field only shows if it is Project Board. + This field can only be set when emailConnectorAllowReopenClosed is true """ - board_icon: DocumentReference | None = Field(default=None, alias="boardIcon") - bill_tickets_after_closed_flag: bool | None = Field( - default=None, alias="billTicketsAfterClosedFlag" - ) - bill_ticket_separately_flag: bool | None = Field( - default=None, alias="billTicketSeparatelyFlag" - ) - bill_unapproved_time_expense_flag: bool | None = Field( - default=None, alias="billUnapprovedTimeExpenseFlag" - ) - override_billing_setup_flag: bool | None = Field( - default=None, alias="overrideBillingSetupFlag" - ) - dispatch_member: MemberReference | None = Field( - default=None, alias="dispatchMember" - ) - service_manager_member: MemberReference | None = Field( - default=None, alias="serviceManagerMember" - ) - duty_manager_member: MemberReference | None = Field( - default=None, alias="dutyManagerMember" - ) - oncall_member: MemberReference | None = Field(default=None, alias="oncallMember") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) - bill_expense: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billExpense") - bill_product: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billProduct") - auto_close_status: ServiceStatusReference | None = Field( - default=None, alias="autoCloseStatus" - ) - auto_assign_new_tickets_flag: bool | None = Field( - default=None, alias="autoAssignNewTicketsFlag" - ) - auto_assign_new_ec_tickets_flag: bool | None = Field( - default=None, alias="autoAssignNewECTicketsFlag" - ) - auto_assign_new_portal_tickets_flag: bool | None = Field( - default=None, alias="autoAssignNewPortalTicketsFlag" - ) - discussions_locked_flag: bool | None = Field( - default=None, alias="discussionsLockedFlag" - ) - time_entry_locked_flag: bool | None = Field( - default=None, alias="timeEntryLockedFlag" - ) - notify_email_from: str | None = Field(default=None, alias="notifyEmailFrom") - """ - Max length: 50; - """ - notify_email_from_name: str | None = Field( - default=None, alias="notifyEmailFromName" - ) + email_connector_reopen_days_closed_limit: Annotated[ + int | None, Field(alias="emailConnectorReopenDaysClosedLimit") + ] = None """ - Max length: 60; + This field can only be set when emailConnectorNeverReopenByDaysClosedFlag and emailConnectorAllowReopenClosed are both true + This field is required when emailConnectorNeverReopenByDaysClosedFlag is true """ - closed_loop_discussions_flag: bool | None = Field( - default=None, alias="closedLoopDiscussionsFlag" - ) - closed_loop_resolution_flag: bool | None = Field( - default=None, alias="closedLoopResolutionFlag" - ) - closed_loop_internal_analysis_flag: bool | None = Field( - default=None, alias="closedLoopInternalAnalysisFlag" - ) - time_entry_discussion_flag: bool | None = Field( - default=None, alias="timeEntryDiscussionFlag" - ) - time_entry_resolution_flag: bool | None = Field( - default=None, alias="timeEntryResolutionFlag" - ) - time_entry_internal_analysis_flag: bool | None = Field( - default=None, alias="timeEntryInternalAnalysisFlag" - ) - problem_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="problemSort" - ) - resolution_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="resolutionSort" - ) - internal_analysis_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="internalAnalysisSort" - ) - email_connector_allow_reopen_closed_flag: bool | None = Field( - default=None, alias="emailConnectorAllowReopenClosedFlag" - ) - email_connector_reopen_status: ServiceStatusReference | None = Field( - default=None, alias="emailConnectorReopenStatus" - ) - email_connector_reopen_resources_flag: bool | None = Field( - default=None, alias="emailConnectorReopenResourcesFlag" - ) - """ - This field can only be set when emailConnectorAllowReopenClosed is true. - """ - email_connector_new_ticket_no_match_flag: bool | None = Field( - default=None, alias="emailConnectorNewTicketNoMatchFlag" - ) - """ - This field can only be set when emailConnectorAllowReopenClosed is true. - """ - email_connector_never_reopen_by_days_flag: bool | None = Field( - default=None, alias="emailConnectorNeverReopenByDaysFlag" - ) - """ - This field can only be set when emailConnectorAllowReopenClosed is true. - """ - email_connector_reopen_days_limit: int | None = Field( - default=None, alias="emailConnectorReopenDaysLimit" - ) + email_connector_reopen_days_limit: Annotated[int | None, Field(alias="emailConnectorReopenDaysLimit")] = None """ This field can only be set when emailConnectorNeverReopenByDaysFlag and emailConnectorAllowReopenClosed are both true - This field is required when emailConnectorNeverReopenByDaysFlag is true. + This field is required when emailConnectorNeverReopenByDaysFlag is true + """ + email_connector_reopen_resources_flag: Annotated[ + bool | None, Field(alias="emailConnectorReopenResourcesFlag") + ] = None """ - email_connector_never_reopen_by_days_closed_flag: bool | None = Field( - default=None, alias="emailConnectorNeverReopenByDaysClosedFlag" - ) + This field can only be set when emailConnectorAllowReopenClosed is true """ - This field can only be set when emailConnectorAllowReopenClosed is true. + email_connector_reopen_status: Annotated[ + ServiceStatusReference | None, Field(alias="emailConnectorReopenStatus") + ] = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + internal_analysis_sort: Annotated[ + Literal["Ascending", "Descending"] | None, Field(alias="internalAnalysisSort") + ] = None + location: SystemLocationReference | None = None + mark_first_note_issue_flag: Annotated[bool | None, Field(alias="markFirstNoteIssueFlag")] = None + name: str + """ + Max length: 50; """ - email_connector_reopen_days_closed_limit: int | None = Field( - default=None, alias="emailConnectorReopenDaysClosedLimit" - ) + notify_email_from: Annotated[str | None, Field(alias="notifyEmailFrom")] = None """ - This field can only be set when emailConnectorNeverReopenByDaysClosedFlag and emailConnectorAllowReopenClosed are both true - This field is required when emailConnectorNeverReopenByDaysClosedFlag is true. - """ - use_member_display_name_flag: bool | None = Field( - default=None, alias="useMemberDisplayNameFlag" - ) - send_to_cc_flag: bool | None = Field(default=None, alias="sendToCCFlag") - auto_assign_ticket_owner_flag: bool | None = Field( - default=None, alias="autoAssignTicketOwnerFlag" - ) - auto_assign_limit_flag: bool | None = Field( - default=None, alias="autoAssignLimitFlag" - ) - auto_assign_limit_amount: int | None = Field( - default=None, alias="autoAssignLimitAmount" - ) - """ - This field can only be set when autoAssignLimitFlag is true - """ - closed_loop_all_flag: bool | None = Field(default=None, alias="closedLoopAllFlag") - percentage_calculation: Literal[ - "ActualHours", "Manual", "ClosedPhases", "ClosedTickets" - ] | None = Field(default=None, alias="percentageCalculation") - all_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="allSort" - ) - mark_first_note_issue_flag: bool | None = Field( - default=None, alias="markFirstNoteIssueFlag" - ) - restrict_board_by_default_flag: bool | None = Field( - default=None, alias="restrictBoardByDefaultFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + Max length: 50; + """ + notify_email_from_name: Annotated[str | None, Field(alias="notifyEmailFromName")] = None + """ + Max length: 60; + """ + oncall_member: Annotated[MemberReference | None, Field(alias="oncallMember")] = None + override_billing_setup_flag: Annotated[bool | None, Field(alias="overrideBillingSetupFlag")] = None + percentage_calculation: Annotated[ + Literal["ActualHours", "Manual", "ClosedPhases", "ClosedTickets"] | None, Field(alias="percentageCalculation") + ] = None + problem_sort: Annotated[Literal["Ascending", "Descending"] | None, Field(alias="problemSort")] = None + project_flag: Annotated[bool | None, Field(alias="projectFlag")] = None + resolution_sort: Annotated[Literal["Ascending", "Descending"] | None, Field(alias="resolutionSort")] = None + resource_template: Annotated[ServiceEmailTemplateReference | None, Field(alias="resourceTemplate")] = None + restrict_board_by_default_flag: Annotated[bool | None, Field(alias="restrictBoardByDefaultFlag")] = None + send_to_cc_flag: Annotated[bool | None, Field(alias="sendToCCFlag")] = None + send_to_contact_flag: Annotated[bool | None, Field(alias="sendToContactFlag")] = None + send_to_resource_flag: Annotated[bool | None, Field(alias="sendToResourceFlag")] = None + service_manager_member: Annotated[MemberReference | None, Field(alias="serviceManagerMember")] = None + show_dependencies_flag: Annotated[bool | None, Field(alias="showDependenciesFlag")] = None + """ + This field only shows if it is Project Board. + """ + show_estimates_flag: Annotated[bool | None, Field(alias="showEstimatesFlag")] = None + """ + This field only shows if it is Project Board. + """ + sign_off_template: Annotated[ServiceSignoffReference | None, Field(alias="signOffTemplate")] = None + time_entry_discussion_flag: Annotated[bool | None, Field(alias="timeEntryDiscussionFlag")] = None + time_entry_internal_analysis_flag: Annotated[bool | None, Field(alias="timeEntryInternalAnalysisFlag")] = None + time_entry_locked_flag: Annotated[bool | None, Field(alias="timeEntryLockedFlag")] = None + time_entry_resolution_flag: Annotated[bool | None, Field(alias="timeEntryResolutionFlag")] = None + use_member_display_name_flag: Annotated[bool | None, Field(alias="useMemberDisplayNameFlag")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class BoardAutoAssignResource(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None class BoardAutoTemplate(ConnectWiseModel): - id: int | None = None - type: ServiceTypeReference | None = None - subtype: ServiceSubTypeReference | None = None - item: ServiceItemReference | None = None - service_template: ServiceTemplateReference | None = Field( - default=None, alias="serviceTemplate" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + auto_apply_flag: Annotated[bool | None, Field(alias="autoApplyFlag")] = None board: BoardReference | None = None - summary_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="summarySetting" - ) - discussion_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="discussionSetting" - ) - internal_analysis_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="internalAnalysisSetting" - ) - resolution_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="resolutionSetting" - ) - tasks_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="tasksSetting" - ) - documents_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="documentsSetting" - ) - resources_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="resourcesSetting" - ) - budget_hours_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="budgetHoursSetting" - ) - finance_information_setting: Literal[ - "Append", "Overwrite", "Ignore" - ] | None = Field(default=None, alias="financeInformationSetting") - send_notes_as_email_setting: Literal[ - "Append", "Overwrite", "Ignore" - ] | None = Field(default=None, alias="sendNotesAsEmailSetting") - impact_urgency_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="impactUrgencySetting" - ) - template_priority_setting: Literal["Append", "Overwrite", "Ignore"] | None = Field( - default=None, alias="templatePrioritySetting" - ) - auto_apply_flag: bool | None = Field(default=None, alias="autoApplyFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + budget_hours_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="budgetHoursSetting") + ] = None + discussion_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="discussionSetting") + ] = None + documents_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="documentsSetting") + ] = None + finance_information_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="financeInformationSetting") + ] = None + id: int | None = None + internal_analysis_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="internalAnalysisSetting") + ] = None + item: ServiceItemReference | None = None + resolution_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="resolutionSetting") + ] = None + resources_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="resourcesSetting") + ] = None + send_notes_as_email_setting: Annotated[ + Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="sendNotesAsEmailSetting") + ] = None + service_template: Annotated[ServiceTemplateReference | None, Field(alias="serviceTemplate")] = None + subtype: ServiceSubTypeReference | None = None + summary_setting: Annotated[Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="summarySetting")] = None + tasks_setting: Annotated[Literal["Append", "Overwrite", "Ignore"] | None, Field(alias="tasksSetting")] = None + type: ServiceTypeReference | None = None class BoardDefault(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_id: Annotated[int | None, Field(alias="agreementId")] = None board: BoardReference | None = None - service_type: ServiceTypeReference | None = Field(default=None, alias="serviceType") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - agreement_id: int | None = Field(default=None, alias="agreementId") - info: dict[str, str] | None = Field(default=None, alias="_info") + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + id: int | None = None + service_type: Annotated[ServiceTypeReference | None, Field(alias="serviceType")] = None class BoardInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_sort: Annotated[Literal["Ascending", "Descending"] | None, Field(alias="allSort")] = None + closed_loop_all_flag: Annotated[bool | None, Field(alias="closedLoopAllFlag")] = None + closed_loop_discussions_flag: Annotated[bool | None, Field(alias="closedLoopDiscussionsFlag")] = None + closed_loop_internal_analysis_flag: Annotated[bool | None, Field(alias="closedLoopInternalAnalysisFlag")] = None + closed_loop_resolution_flag: Annotated[bool | None, Field(alias="closedLoopResolutionFlag")] = None + department: SystemDepartmentReference | None = None id: int | None = None - name: str | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + internal_analysis_sort: Annotated[ + Literal["Ascending", "Descending"] | None, Field(alias="internalAnalysisSort") + ] = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - project_flag: bool | None = Field(default=None, alias="projectFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - closed_loop_discussions_flag: bool | None = Field( - default=None, alias="closedLoopDiscussionsFlag" - ) - closed_loop_internal_analysis_flag: bool | None = Field( - default=None, alias="closedLoopInternalAnalysisFlag" - ) - closed_loop_resolution_flag: bool | None = Field( - default=None, alias="closedLoopResolutionFlag" - ) - closed_loop_all_flag: bool | None = Field(default=None, alias="closedLoopAllFlag") - problem_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="problemSort" - ) - internal_analysis_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="internalAnalysisSort" - ) - resolution_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="resolutionSort" - ) - all_sort: Literal["Ascending", "Descending"] | None = Field( - default=None, alias="allSort" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None + problem_sort: Annotated[Literal["Ascending", "Descending"] | None, Field(alias="problemSort")] = None + project_flag: Annotated[bool | None, Field(alias="projectFlag")] = None + resolution_sort: Annotated[Literal["Ascending", "Descending"] | None, Field(alias="resolutionSort")] = None class BoardItem(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - board: BoardReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class BoardItemAssociation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_sub_types_flag: Annotated[bool | None, Field(alias="addAllSubTypesFlag")] = None + board: BoardReference | None = None id: int - sub_type_association_ids: list[int] | None = Field( - default=None, alias="subTypeAssociationIds" - ) + item: ServiceItemReference | None = None + remove_all_sub_types_flag: Annotated[bool | None, Field(alias="removeAllSubTypesFlag")] = None + sub_type_association_ids: Annotated[list[int] | None, Field(alias="subTypeAssociationIds")] = None """ If addAllSubTypesFlag and removeAllSubTypesFlag are both false, this field is required. """ - add_all_sub_types_flag: bool | None = Field( - default=None, alias="addAllSubTypesFlag" - ) - remove_all_sub_types_flag: bool | None = Field( - default=None, alias="removeAllSubTypesFlag" - ) - item: ServiceItemReference | None = None - board: BoardReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class BoardNotification(ConnectWiseModel): - id: int | None = None - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None email: str | None = None """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + member: MemberReference | None = None + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None class BoardStatus(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None + closed_status: Annotated[bool | None, Field(alias="closedStatus")] = None + custom_status_indicator_name: Annotated[str | None, Field(alias="customStatusIndicatorName")] = None """ - Max length: 50; + Max length: 30; """ - board: BoardReference | None = None - sort_order: int | None = Field(default=None, alias="sortOrder") - display_on_board: bool | None = Field(default=None, alias="displayOnBoard") - inactive: bool | None = None - closed_status: bool | None = Field(default=None, alias="closedStatus") - time_entry_not_allowed: bool | None = Field( - default=None, alias="timeEntryNotAllowed" - ) - round_robin_catchall: bool | None = Field(default=None, alias="roundRobinCatchall") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - escalation_status: Literal[ - "NotResponded", "Responded", "ResolutionPlan", "Resolved", "NoEscalation" - ] | None = Field(default=None, alias="escalationStatus") - customer_portal_description: str | None = Field( - default=None, alias="customerPortalDescription" - ) + customer_portal_description: Annotated[str | None, Field(alias="customerPortalDescription")] = None """ Max length: 500; """ - customer_portal_flag: bool | None = Field(default=None, alias="customerPortalFlag") - email_template: ServiceEmailTemplateReference | None = Field( - default=None, alias="emailTemplate" - ) - status_indicator: StatusIndicatorReference | None = Field( - default=None, alias="statusIndicator" - ) - custom_status_indicator_name: str | None = Field( - default=None, alias="customStatusIndicatorName" - ) + customer_portal_flag: Annotated[bool | None, Field(alias="customerPortalFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + display_on_board: Annotated[bool | None, Field(alias="displayOnBoard")] = None + email_template: Annotated[ServiceEmailTemplateReference | None, Field(alias="emailTemplate")] = None + escalation_status: Annotated[ + Literal["NotResponded", "Responded", "ResolutionPlan", "Resolved", "NoEscalation"] | None, + Field(alias="escalationStatus"), + ] = None + id: int | None = None + inactive: bool | None = None + name: str """ - Max length: 30; + Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") - save_time_as_note: bool | None = Field(default=None, alias="saveTimeAsNote") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None + status_indicator: Annotated[StatusIndicatorReference | None, Field(alias="statusIndicator")] = None + time_entry_not_allowed: Annotated[bool | None, Field(alias="timeEntryNotAllowed")] = None class BoardStatusNotification(ConnectWiseModel): - id: int | None = None - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - status: ServiceStatusReference | None = None - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None email: str | None = None """ - Service Status Notification email must be entered if the notify type is "Email Address". Max length: 255; + Service Status Notification email must be entered if the notify type is "Email Address" Max length: 255; """ - workflow_step: int | None = Field(default=None, alias="workflowStep") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + member: MemberReference | None = None + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None + status: ServiceStatusReference | None = None + workflow_step: Annotated[int | None, Field(alias="workflowStep")] = None class BoardTeam(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board_id: Annotated[int | None, Field(alias="boardId")] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + members: list[int] | None = None name: str """ Max length: 30; """ - team_leader: MemberReference | None = Field(default=None, alias="teamLeader") - members: list[int] | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - notify_on_ticket_delete: bool | None = Field( - default=None, alias="notifyOnTicketDelete" - ) - default_round_robin_flag: bool | None = Field( - default=None, alias="defaultRoundRobinFlag" - ) - round_robin_flag: bool | None = Field(default=None, alias="roundRobinFlag") - board_id: int | None = Field(default=None, alias="boardId") - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - info: dict[str, str] | None = Field(default=None, alias="_info") + notify_on_ticket_delete: Annotated[bool | None, Field(alias="notifyOnTicketDelete")] = None + team_leader: Annotated[MemberReference | None, Field(alias="teamLeader")] = None class BoardType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None + category: Literal["Reactive", "Proactive"] | None = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + department: SystemDepartmentReference | None = None id: int | None = None - name: str + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_xref: Annotated[str | None, Field(alias="integrationXref")] = None """ Max length: 50; """ - category: Literal["Reactive", "Proactive"] | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - request_for_change_flag: bool | None = Field( - default=None, alias="requestForChangeFlag" - ) - integration_xref: str | None = Field(default=None, alias="integrationXref") + location: SystemLocationReference | None = None + name: str """ Max length: 50; """ - skill_category: SkillCategoryReference | None = Field( - default=None, alias="skillCategory" - ) - skill: SkillReference | None = None - board: BoardReference | None = None - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + request_for_change_flag: Annotated[bool | None, Field(alias="requestForChangeFlag")] = None class BoardTypeSubTypeItemAssociation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None id: int | None = None - type: ServiceTypeReference | None = None - sub_type: ServiceSubTypeReference | None = Field(default=None, alias="subType") item: ServiceItemReference | None = None - board: BoardReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + sub_type: Annotated[ServiceSubTypeReference | None, Field(alias="subType")] = None + type: ServiceTypeReference | None = None class BundleRequest(ConnectWiseModel): - sequence_number: int | None = Field(default=None, alias="sequenceNumber") - resource_type: str | None = Field(default=None, alias="resourceType") + api_request: Annotated[ApiRequest | None, Field(alias="apiRequest")] = None + resource_type: Annotated[str | None, Field(alias="resourceType")] = None + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None version: str | None = None - api_request: ApiRequest | None = Field(default=None, alias="apiRequest") class BundleRequestsCollection(ConnectWiseModel): @@ -8851,280 +7168,246 @@ class BundleRequestsCollection(ConnectWiseModel): class Calendar(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + friday_end_time: Annotated[str | None, Field(alias="fridayEndTime")] = None + friday_start_time: Annotated[str | None, Field(alias="fridayStartTime")] = None + holiday_list: Annotated[HolidayListReference | None, Field(alias="holidayList")] = None id: int | None = None + monday_end_time: Annotated[str | None, Field(alias="mondayEndTime")] = None + monday_start_time: Annotated[str | None, Field(alias="mondayStartTime")] = None name: str - holiday_list: HolidayListReference | None = Field(default=None, alias="holidayList") - monday_start_time: str | None = Field(default=None, alias="mondayStartTime") - monday_end_time: str | None = Field(default=None, alias="mondayEndTime") - tuesday_start_time: str | None = Field(default=None, alias="tuesdayStartTime") - tuesday_end_time: str | None = Field(default=None, alias="tuesdayEndTime") - wednesday_start_time: str | None = Field(default=None, alias="wednesdayStartTime") - wednesday_end_time: str | None = Field(default=None, alias="wednesdayEndTime") - thursday_start_time: str | None = Field(default=None, alias="thursdayStartTime") - thursday_end_time: str | None = Field(default=None, alias="thursdayEndTime") - friday_start_time: str | None = Field(default=None, alias="fridayStartTime") - friday_end_time: str | None = Field(default=None, alias="fridayEndTime") - saturday_start_time: str | None = Field(default=None, alias="saturdayStartTime") - saturday_end_time: str | None = Field(default=None, alias="saturdayEndTime") - sunday_start_time: str | None = Field(default=None, alias="sundayStartTime") - sunday_end_time: str | None = Field(default=None, alias="sundayEndTime") - info: dict[str, str] | None = Field(default=None, alias="_info") + saturday_end_time: Annotated[str | None, Field(alias="saturdayEndTime")] = None + saturday_start_time: Annotated[str | None, Field(alias="saturdayStartTime")] = None + sunday_end_time: Annotated[str | None, Field(alias="sundayEndTime")] = None + sunday_start_time: Annotated[str | None, Field(alias="sundayStartTime")] = None + thursday_end_time: Annotated[str | None, Field(alias="thursdayEndTime")] = None + thursday_start_time: Annotated[str | None, Field(alias="thursdayStartTime")] = None + tuesday_end_time: Annotated[str | None, Field(alias="tuesdayEndTime")] = None + tuesday_start_time: Annotated[str | None, Field(alias="tuesdayStartTime")] = None + wednesday_end_time: Annotated[str | None, Field(alias="wednesdayEndTime")] = None + wednesday_start_time: Annotated[str | None, Field(alias="wednesdayStartTime")] = None class Campaign(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + actual_cost: Annotated[float | None, Field(alias="actualCost")] = None + actual_gross_margin: Annotated[float | None, Field(alias="actualGrossMargin")] = None + actual_roi: Annotated[float | None, Field(alias="actualROI")] = None + actual_revenue: Annotated[float | None, Field(alias="actualRevenue")] = None + budget_cost: Annotated[float | None, Field(alias="budgetCost")] = None + budget_gross_margin: Annotated[float | None, Field(alias="budgetGrossMargin")] = None + budget_roi: Annotated[float | None, Field(alias="budgetROI")] = None + budget_revenue: Annotated[float | None, Field(alias="budgetRevenue")] = None + default_group: Annotated[GroupReference | None, Field(alias="defaultGroup")] = None + emails_sent: Annotated[int | None, Field(alias="emailsSent")] = None + end_date: Annotated[datetime | None, Field(alias="endDate")] = None id: int | None = None + impressions: int | None = None + inactive: bool | None = None + inactive_days_after_end: Annotated[int | None, Field(alias="inactiveDaysAfterEnd")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + marketing_manager_default_track_id: Annotated[int | None, Field(alias="marketingManagerDefaultTrackId")] = None + member: MemberReference | None = None name: str """ Max length: 50; """ - type: CampaignTypeReference | None = None - sub_type: CampaignSubTypeReference | None = Field(default=None, alias="subType") - status: CampaignStatusReference | None = None - start_date: datetime = Field(..., alias="startDate") - end_date: datetime | None = Field(default=None, alias="endDate") - location_id: int | None = Field(default=None, alias="locationId") - member: MemberReference | None = None - inactive: bool | None = None - inactive_days_after_end: int | None = Field( - default=None, alias="inactiveDaysAfterEnd" - ) notes: str | None = None - default_group: GroupReference | None = Field(default=None, alias="defaultGroup") - marketing_manager_default_track_id: int | None = Field( - default=None, alias="marketingManagerDefaultTrackId" - ) - opportunity_default_track_id: int | None = Field( - default=None, alias="opportunityDefaultTrackId" - ) - impressions: int | None = None - budget_revenue: float | None = Field(default=None, alias="budgetRevenue") - budget_cost: float | None = Field(default=None, alias="budgetCost") - actual_cost: float | None = Field(default=None, alias="actualCost") - budget_gross_margin: float | None = Field(default=None, alias="budgetGrossMargin") - budget_roi: float | None = Field(default=None, alias="budgetROI") - actual_revenue: float | None = Field(default=None, alias="actualRevenue") - actual_gross_margin: float | None = Field(default=None, alias="actualGrossMargin") - actual_roi: float | None = Field(default=None, alias="actualROI") - emails_sent: int | None = Field(default=None, alias="emailsSent") - info: dict[str, str] | None = Field(default=None, alias="_info") + opportunity_default_track_id: Annotated[int | None, Field(alias="opportunityDefaultTrackId")] = None + start_date: Annotated[datetime, Field(alias="startDate")] + status: CampaignStatusReference | None = None + sub_type: Annotated[CampaignSubTypeReference | None, Field(alias="subType")] = None + type: CampaignTypeReference | None = None -class CampaignSubTypeCampaignSubType(ConnectWiseModel): +class CampaignCampaignSubType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - type: CampaignTypeReference | None = None name: str """ Max length: 100; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + type: CampaignTypeReference | None = None class CampaignAudit(ConnectWiseModel): - id: int | None = None - emails_sent: int = Field(..., alias="emailsSent") - emails_unsent: int | None = Field(default=None, alias="emailsUnsent") - documents_created: int | None = Field(default=None, alias="documentsCreated") - email_subject: str | None = Field(default=None, alias="emailSubject") + campaign_id: Annotated[int | None, Field(alias="campaignId")] = None + created_by: Annotated[str | None, Field(alias="createdBy")] = None + date_created: Annotated[datetime | None, Field(alias="dateCreated")] = None + documents_created: Annotated[int | None, Field(alias="documentsCreated")] = None + email_subject: Annotated[str | None, Field(alias="emailSubject")] = None """ Max length: 1000; """ + emails_sent: Annotated[int, Field(alias="emailsSent")] + emails_unsent: Annotated[int | None, Field(alias="emailsUnsent")] = None group: GroupReference | None = None - campaign_id: int | None = Field(default=None, alias="campaignId") - created_by: str | None = Field(default=None, alias="createdBy") - date_created: str | None = Field(default=None, alias="dateCreated") + id: int | None = None class CatalogComponent(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + catalog_item: Annotated[CatalogItemReference | None, Field(alias="catalogItem")] = None + cost: float | None = None + hide_description_flag: Annotated[bool | None, Field(alias="hideDescriptionFlag")] = None + hide_extended_price_flag: Annotated[bool | None, Field(alias="hideExtendedPriceFlag")] = None + hide_item_identifier_flag: Annotated[bool | None, Field(alias="hideItemIdentifierFlag")] = None + hide_price_flag: Annotated[bool | None, Field(alias="hidePriceFlag")] = None + hide_quantity_flag: Annotated[bool | None, Field(alias="hideQuantityFlag")] = None id: int | None = None - sequence_number: int | None = Field(default=None, alias="sequenceNumber") - quantity: float - catalog_item: CatalogItemReference | None = Field(default=None, alias="catalogItem") - hide_price_flag: bool | None = Field(default=None, alias="hidePriceFlag") - hide_item_identifier_flag: bool | None = Field( - default=None, alias="hideItemIdentifierFlag" - ) - hide_description_flag: bool | None = Field( - default=None, alias="hideDescriptionFlag" - ) - hide_quantity_flag: bool | None = Field(default=None, alias="hideQuantityFlag") - hide_extended_price_flag: bool | None = Field( - default=None, alias="hideExtendedPriceFlag" - ) - parent_catalog_item: CatalogItemReference | None = Field( - default=None, alias="parentCatalogItem" - ) + parent_catalog_item: Annotated[CatalogItemReference | None, Field(alias="parentCatalogItem")] = None price: float | None = None - cost: float | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + quantity: float + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None class CatalogInventory(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + catalog_item: Annotated[CatalogItemReference | None, Field(alias="catalogItem")] = None id: int | None = None - catalog_item: CatalogItemReference | None = Field(default=None, alias="catalogItem") + on_hand: Annotated[int | None, Field(alias="onHand")] = None + serial_numbers: Annotated[list[OnHandSerialNumberReference] | None, Field(alias="serialNumbers")] = None warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - on_hand: int | None = Field(default=None, alias="onHand") - serial_numbers: list[OnHandSerialNumberReference] | None = Field( - default=None, alias="serialNumbers" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None class CatalogItem(ConnectWiseModel): - id: int | None = None - identifier: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + billable_option: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billableOption") + ] = None + calculated_cost: Annotated[float | None, Field(alias="calculatedCost")] = None + calculated_cost_flag: Annotated[bool | None, Field(alias="calculatedCostFlag")] = None + calculated_price: Annotated[float | None, Field(alias="calculatedPrice")] = None + calculated_price_flag: Annotated[bool | None, Field(alias="calculatedPriceFlag")] = None + category: ProductCategoryReference | None = None + cost: float | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_description: Annotated[str, Field(alias="customerDescription")] """ - Max length: 60; + Max length: 6000; """ + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None description: str """ Max length: 60; """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - subcategory: ProductSubCategoryReference | None = None - type: ProductTypeReference | None = None - product_class: Literal[ - "Agreement", "Bundle", "Inventory", "NonInventory", "Service" - ] | None = Field(default=None, alias="productClass") - """ - Defaults to Non-Inventory. - """ - serialized_flag: bool | None = Field(default=None, alias="serializedFlag") - serialized_cost_flag: bool | None = Field(default=None, alias="serializedCostFlag") - phase_product_flag: bool | None = Field(default=None, alias="phaseProductFlag") - unit_of_measure: UnitOfMeasureReference | None = Field( - default=None, alias="unitOfMeasure" - ) - min_stock_level: int | None = Field(default=None, alias="minStockLevel") - price: float | None = None - cost: float | None = None - price_attribute: Literal[ - "FixedFee", "NotToExceed", "OverrideRate", "TimeAndMaterials" - ] | None = Field(default=None, alias="priceAttribute") - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - drop_ship_flag: bool | None = Field(default=None, alias="dropShipFlag") - special_order_flag: bool | None = Field(default=None, alias="specialOrderFlag") - customer_description: str = Field(..., alias="customerDescription") + drop_ship_flag: Annotated[bool | None, Field(alias="dropShipFlag")] = None + entity_type: Annotated[EntityTypeReference | None, Field(alias="entityType")] = None + id: int | None = None + identifier: str """ - Max length: 6000; + Max length: 60; """ - manufacturer: ManufacturerReference | None = None - manufacturer_part_number: str | None = Field( - default=None, alias="manufacturerPartNumber" - ) + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integration_x_ref: Annotated[str | None, Field(alias="integrationXRef")] = None """ Max length: 50; """ - vendor: CompanyReference | None = None - vendor_sku: str | None = Field(default=None, alias="vendorSku") + manufacturer: ManufacturerReference | None = None + manufacturer_part_number: Annotated[str | None, Field(alias="manufacturerPartNumber")] = None """ Max length: 50; """ + min_stock_level: Annotated[int | None, Field(alias="minStockLevel")] = None notes: str | None = None - integration_x_ref: str | None = Field(default=None, alias="integrationXRef") + phase_product_flag: Annotated[bool | None, Field(alias="phaseProductFlag")] = None + price: float | None = None + price_attribute: Annotated[ + Literal["FixedFee", "NotToExceed", "OverrideRate", "TimeAndMaterials"] | None, Field(alias="priceAttribute") + ] = None + product_class: Annotated[ + Literal["Agreement", "Bundle", "Inventory", "NonInventory", "Service"] | None, Field(alias="productClass") + ] = None + """ + Defaults to Non-Inventory + """ + recurring_bill_cycle: Annotated[BillingCycleReference | None, Field(alias="recurringBillCycle")] = None + recurring_cost: Annotated[float | None, Field(alias="recurringCost")] = None + recurring_cycle_type: Annotated[ + Literal["ContractYear", "CalendarYear"] | None, Field(alias="recurringCycleType") + ] = None + recurring_flag: Annotated[bool | None, Field(alias="recurringFlag")] = None + recurring_one_time_flag: Annotated[bool | None, Field(alias="recurringOneTimeFlag")] = None + recurring_revenue: Annotated[float | None, Field(alias="recurringRevenue")] = None + serialized_cost_flag: Annotated[bool | None, Field(alias="serializedCostFlag")] = None + serialized_flag: Annotated[bool | None, Field(alias="serializedFlag")] = None + sla: SLAReference | None = None + special_order_flag: Annotated[bool | None, Field(alias="specialOrderFlag")] = None + subcategory: ProductSubCategoryReference | None = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None + type: ProductTypeReference | None = None + unit_of_measure: Annotated[UnitOfMeasureReference | None, Field(alias="unitOfMeasure")] = None + vendor: CompanyReference | None = None + vendor_sku: Annotated[str | None, Field(alias="vendorSku")] = None """ Max length: 50; """ - sla: SLAReference | None = None - entity_type: EntityTypeReference | None = Field(default=None, alias="entityType") - recurring_flag: bool | None = Field(default=None, alias="recurringFlag") - recurring_revenue: float | None = Field(default=None, alias="recurringRevenue") - recurring_cost: float | None = Field(default=None, alias="recurringCost") - recurring_one_time_flag: bool | None = Field( - default=None, alias="recurringOneTimeFlag" - ) - recurring_bill_cycle: BillingCycleReference | None = Field( - default=None, alias="recurringBillCycle" - ) - recurring_cycle_type: Literal["ContractYear", "CalendarYear"] | None = Field( - default=None, alias="recurringCycleType" - ) - date_entered: str | None = Field(default=None, alias="dateEntered") - calculated_price_flag: bool | None = Field( - default=None, alias="calculatedPriceFlag" - ) - calculated_cost_flag: bool | None = Field(default=None, alias="calculatedCostFlag") - category: ProductCategoryReference | None = None - calculated_price: float | None = Field(default=None, alias="calculatedPrice") - calculated_cost: float | None = Field(default=None, alias="calculatedCost") - billable_option: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billableOption") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class CatalogPricing(ConnectWiseModel): - catalog_item: CatalogItemReference | None = Field(default=None, alias="catalogItem") + catalog_item: Annotated[CatalogItemReference | None, Field(alias="catalogItem")] = None company: CompanyReference | None = None + date: datetime | None = None location: SystemLocationReference | None = None - quantity: int | None = None - date: str | None = None price: float | None = None + quantity: int | None = None class Certification(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None id: int | None = None name: str """ Max length: 50; """ - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ChargeCode(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + allow_all_expense_type_flag: Annotated[bool | None, Field(alias="allowAllExpenseTypeFlag")] = None + bill_time: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billTime") + ] = None + company: CompanyReference | None = None + department: SystemDepartmentReference | None = None + expense_entry_flag: Annotated[bool | None, Field(alias="expenseEntryFlag")] = None + expense_type_ids: Annotated[list[int] | None, Field(alias="expenseTypeIds")] = None id: int | None = None - name: str + integration_xref: Annotated[str | None, Field(alias="integrationXref")] = None """ Max length: 50; """ - company: CompanyReference | None = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) - expense_entry_flag: bool | None = Field(default=None, alias="expenseEntryFlag") - allow_all_expense_type_flag: bool | None = Field( - default=None, alias="allowAllExpenseTypeFlag" - ) - time_entry_flag: bool | None = Field(default=None, alias="timeEntryFlag") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - integration_xref: str | None = Field(default=None, alias="integrationXref") + name: str """ Max length: 50; """ - expense_type_ids: list[int] | None = Field(default=None, alias="expenseTypeIds") - info: dict[str, str] | None = Field(default=None, alias="_info") + time_entry_flag: Annotated[bool | None, Field(alias="timeEntryFlag")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class ChargeCodeExpenseType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + charge_code: Annotated[ChargeCodeReference | None, Field(alias="chargeCode")] = None id: int | None = None type: ExpenseTypeReference | None = None - charge_code: ChargeCodeReference | None = Field(default=None, alias="chargeCode") - info: dict[str, str] | None = Field(default=None, alias="_info") class ChargeCodeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + allow_all_expense_type_flag: Annotated[bool | None, Field(alias="allowAllExpenseTypeFlag")] = None + department: SystemDepartmentReference | None = None + expense_entry_flag: Annotated[bool | None, Field(alias="expenseEntryFlag")] = None + expense_type_ids: Annotated[list[int] | None, Field(alias="expenseTypeIds")] = None id: int | None = None - name: str | None = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - expense_entry_flag: bool | None = Field(default=None, alias="expenseEntryFlag") - allow_all_expense_type_flag: bool | None = Field( - default=None, alias="allowAllExpenseTypeFlag" - ) - time_entry_flag: bool | None = Field(default=None, alias="timeEntryFlag") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - expense_type_ids: list[int] | None = Field(default=None, alias="expenseTypeIds") - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None + time_entry_flag: Annotated[bool | None, Field(alias="timeEntryFlag")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class ClearPickerRequest(ConnectWiseModel): @@ -9133,1581 +7416,1342 @@ class ClearPickerRequest(ConnectWiseModel): class Commission(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement: AgreementReference | None = None + agreement_type: Annotated[AgreementTypeReference | None, Field(alias="agreementType")] = None + agreements_flag: Annotated[bool | None, Field(alias="agreementsFlag")] = None + billing_method: Annotated[ + Literal["Agreement", "CreditMemo", "DownPayment", "Miscellaneous", "Progress", "Standard"] | None, + Field(alias="billingMethod"), + ] = None + commission_basis: Annotated[Literal["GrossProfit", "SalesAmount"] | None, Field(alias="commissionBasis")] = None + commission_percent: Annotated[float | None, Field(alias="commissionPercent")] = None + company: CompanyReference | None = None + date_end: Annotated[datetime | None, Field(alias="dateEnd")] = None + date_start: Annotated[datetime | None, Field(alias="dateStart")] = None + department: SystemDepartmentReference | None = None id: int | None = None - member: MemberReference | None = None - commission_percent: float | None = Field(default=None, alias="commissionPercent") - date_start: datetime | None = Field(default=None, alias="dateStart") - date_end: datetime | None = Field(default=None, alias="dateEnd") + invoice_option: Annotated[Literal["AllInvoices", "PaidInvoices"] | None, Field(alias="invoiceOption")] = None + item: IvItemReference | None = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - company: CompanyReference | None = None - site: SiteReference | None = None - agreement: AgreementReference | None = None + member: MemberReference | None = None + my_opportunities_flag: Annotated[bool | None, Field(alias="myOpportunitiesFlag")] = None + number_of_months: Annotated[int | None, Field(alias="numberOfMonths")] = None + product_category: Annotated[ProductCategoryReference | None, Field(alias="productCategory")] = None + product_sub_category: Annotated[ProductSubCategoryReference | None, Field(alias="productSubCategory")] = None + products_flag: Annotated[bool | None, Field(alias="productsFlag")] = None project: ProjectReference | None = None - service_board: BoardReference | None = Field(default=None, alias="serviceBoard") - ticket: TicketReference | None = None + project_board: Annotated[ProjectBoardReference | None, Field(alias="projectBoard")] = None + project_type: Annotated[ProjectTypeReference | None, Field(alias="projectType")] = None + service_board: Annotated[BoardReference | None, Field(alias="serviceBoard")] = None + service_type: Annotated[ServiceTypeReference | None, Field(alias="serviceType")] = None + services_flag: Annotated[bool | None, Field(alias="servicesFlag")] = None + site: SiteReference | None = None territory: SystemLocationReference | None = None - billing_method: Literal[ - "Agreement", - "CreditMemo", - "DownPayment", - "Miscellaneous", - "Progress", - "Standard", - ] | None = Field(default=None, alias="billingMethod") - service_type: ServiceTypeReference | None = Field(default=None, alias="serviceType") - project_board: ProjectBoardReference | None = Field( - default=None, alias="projectBoard" - ) - project_type: ProjectTypeReference | None = Field(default=None, alias="projectType") - agreement_type: AgreementTypeReference | None = Field( - default=None, alias="agreementType" - ) - number_of_months: int | None = Field(default=None, alias="numberOfMonths") - product_category: ProductCategoryReference | None = Field( - default=None, alias="productCategory" - ) - product_sub_category: ProductSubCategoryReference | None = Field( - default=None, alias="productSubCategory" - ) - item: IvItemReference | None = None - commission_basis: Literal["GrossProfit", "SalesAmount"] | None = Field( - default=None, alias="commissionBasis" - ) - invoice_option: Literal["AllInvoices", "PaidInvoices"] | None = Field( - default=None, alias="invoiceOption" - ) - services_flag: bool | None = Field(default=None, alias="servicesFlag") - agreements_flag: bool | None = Field(default=None, alias="agreementsFlag") - products_flag: bool | None = Field(default=None, alias="productsFlag") - my_opportunities_flag: bool | None = Field( - default=None, alias="myOpportunitiesFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + ticket: TicketReference | None = None class Company(ConnectWiseModel): - id: int | None = None - identifier: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + address_line1: Annotated[str | None, Field(alias="addressLine1")] = None """ - Max length: 30; + At least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country Max length: 50; """ - name: str + address_line2: Annotated[str | None, Field(alias="addressLine2")] = None """ - Max length: 50; + At least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country Max length: 50; """ - status: CompanyStatusReference | None = None - address_line1: str | None = Field(default=None, alias="addressLine1") + annual_revenue: Annotated[float | None, Field(alias="annualRevenue")] = None + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + billing_contact: Annotated[ContactReference | None, Field(alias="billingContact")] = None + billing_site: Annotated[SiteReference | None, Field(alias="billingSite")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + calendar: CalendarReference | None = None + city: str | None = None """ - Gets or sets at least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country. Max length: 50; + At least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country Max length: 50; """ - address_line2: str | None = Field(default=None, alias="addressLine2") + company_entity_type: Annotated[EntityTypeReference | None, Field(alias="companyEntityType")] = None + country: CountryReference | None = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + date_acquired: Annotated[datetime | None, Field(alias="dateAcquired")] = None + date_deleted: Annotated[datetime | None, Field(alias="dateDeleted")] = None + default_contact: Annotated[ContactReference | None, Field(alias="defaultContact")] = None + deleted_by: Annotated[str | None, Field(alias="deletedBy")] = None + deleted_flag: Annotated[bool | None, Field(alias="deletedFlag")] = None + facebook_url: Annotated[str | None, Field(alias="facebookUrl")] = None + fax_number: Annotated[str | None, Field(alias="faxNumber")] = None """ - Gets or sets at least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country. Max length: 50; + Max length: 30; """ - city: str | None = None + id: int | None = None + identifier: str """ - Gets or sets at least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country. Max length: 50; + Max length: 30; """ - state: str | None = None + integrator_tags: Annotated[list[str] | None, Field(alias="integratorTags")] = None + invoice_cc_email_address: Annotated[str | None, Field(alias="invoiceCCEmailAddress")] = None + invoice_delivery_method: Annotated[BillingDeliveryReference | None, Field(alias="invoiceDeliveryMethod")] = None + invoice_template: Annotated[InvoiceTemplateReference | None, Field(alias="invoiceTemplate")] = None + invoice_to_email_address: Annotated[str | None, Field(alias="invoiceToEmailAddress")] = None + is_vendor_flag: Annotated[bool | None, Field(alias="isVendorFlag")] = None + lead_flag: Annotated[bool | None, Field(alias="leadFlag")] = None + lead_source: Annotated[str | None, Field(alias="leadSource")] = None """ - Gets or sets at least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country. Max length: 50; + Max length: 50; """ - zip: str | None = None + linked_in_url: Annotated[str | None, Field(alias="linkedInUrl")] = None + market: MarketDescriptionReference | None = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + name: str """ - Gets or sets at least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country. Max length: 12; + Max length: 50; """ - country: CountryReference | None = None - phone_number: str | None = Field(default=None, alias="phoneNumber") + number_of_employees: Annotated[int | None, Field(alias="numberOfEmployees")] = None + ownership_type: Annotated[OwnershipTypeReference | None, Field(alias="ownershipType")] = None + parent_company: Annotated[CompanyReference | None, Field(alias="parentCompany")] = None + phone_number: Annotated[str | None, Field(alias="phoneNumber")] = None """ Max length: 30; """ - fax_number: str | None = Field(default=None, alias="faxNumber") + pricing_schedule: Annotated[PricingScheduleReference | None, Field(alias="pricingSchedule")] = None + reseller_identifier: Annotated[str | None, Field(alias="resellerIdentifier")] = None + revenue_year: Annotated[int | None, Field(alias="revenueYear")] = None + sic_code: Annotated[SicCodeReference | None, Field(alias="sicCode")] = None + site: SiteReference | None = None + state: str | None = None """ - Max length: 30; + At least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country Max length: 50; """ - website: str | None = None + status: CompanyStatusReference | None = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_identifier: Annotated[str | None, Field(alias="taxIdentifier")] = None + territory: SystemLocationReference | None = None + territory_manager: Annotated[MemberReference | None, Field(alias="territoryManager")] = None + time_zone_setup: Annotated[TimeZoneSetupReference | None, Field(alias="timeZoneSetup")] = None + twitter_url: Annotated[str | None, Field(alias="twitterUrl")] = None + types: list[CompanyTypeReference] | None = None """ - Max length: 255; + Integrer array of Company_Type_Recids to be assigned to company that can be passed in only during new company creation (post) + To update existing companies type, use the /company/companyTypeAssociations or /company/companies/{ID}/typeAssociations endpoints """ - territory: SystemLocationReference | None = None - market: MarketDescriptionReference | None = None - account_number: str | None = Field(default=None, alias="accountNumber") - default_contact: ContactReference | None = Field( - default=None, alias="defaultContact" - ) - date_acquired: datetime | None = Field(default=None, alias="dateAcquired") - sic_code: SicCodeReference | None = Field(default=None, alias="sicCode") - parent_company: CompanyReference | None = Field(default=None, alias="parentCompany") - annual_revenue: float | None = Field(default=None, alias="annualRevenue") - number_of_employees: int | None = Field(default=None, alias="numberOfEmployees") - year_established: int | None = Field(default=None, alias="yearEstablished") - revenue_year: int | None = Field(default=None, alias="revenueYear") - ownership_type: OwnershipTypeReference | None = Field( - default=None, alias="ownershipType" - ) - time_zone_setup: TimeZoneSetupReference | None = Field( - default=None, alias="timeZoneSetup" - ) - lead_source: str | None = Field(default=None, alias="leadSource") - """ - Max length: 50; - """ - lead_flag: bool | None = Field(default=None, alias="leadFlag") - unsubscribe_flag: bool | None = Field(default=None, alias="unsubscribeFlag") - calendar: CalendarReference | None = None - user_defined_field1: str | None = Field(default=None, alias="userDefinedField1") + unsubscribe_flag: Annotated[bool | None, Field(alias="unsubscribeFlag")] = None + user_defined_field1: Annotated[str | None, Field(alias="userDefinedField1")] = None """ Max length: 50; """ - user_defined_field2: str | None = Field(default=None, alias="userDefinedField2") + user_defined_field10: Annotated[str | None, Field(alias="userDefinedField10")] = None """ Max length: 50; """ - user_defined_field3: str | None = Field(default=None, alias="userDefinedField3") + user_defined_field2: Annotated[str | None, Field(alias="userDefinedField2")] = None """ Max length: 50; """ - user_defined_field4: str | None = Field(default=None, alias="userDefinedField4") + user_defined_field3: Annotated[str | None, Field(alias="userDefinedField3")] = None """ Max length: 50; """ - user_defined_field5: str | None = Field(default=None, alias="userDefinedField5") + user_defined_field4: Annotated[str | None, Field(alias="userDefinedField4")] = None """ Max length: 50; """ - user_defined_field6: str | None = Field(default=None, alias="userDefinedField6") + user_defined_field5: Annotated[str | None, Field(alias="userDefinedField5")] = None """ Max length: 50; """ - user_defined_field7: str | None = Field(default=None, alias="userDefinedField7") + user_defined_field6: Annotated[str | None, Field(alias="userDefinedField6")] = None """ Max length: 50; """ - user_defined_field8: str | None = Field(default=None, alias="userDefinedField8") + user_defined_field7: Annotated[str | None, Field(alias="userDefinedField7")] = None """ Max length: 50; """ - user_defined_field9: str | None = Field(default=None, alias="userDefinedField9") + user_defined_field8: Annotated[str | None, Field(alias="userDefinedField8")] = None """ Max length: 50; """ - user_defined_field10: str | None = Field(default=None, alias="userDefinedField10") + user_defined_field9: Annotated[str | None, Field(alias="userDefinedField9")] = None """ Max length: 50; """ - vendor_identifier: str | None = Field(default=None, alias="vendorIdentifier") - tax_identifier: str | None = Field(default=None, alias="taxIdentifier") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - invoice_template: InvoiceTemplateReference | None = Field( - default=None, alias="invoiceTemplate" - ) - pricing_schedule: PricingScheduleReference | None = Field( - default=None, alias="pricingSchedule" - ) - company_entity_type: EntityTypeReference | None = Field( - default=None, alias="companyEntityType" - ) - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - billing_site: SiteReference | None = Field(default=None, alias="billingSite") - billing_contact: ContactReference | None = Field( - default=None, alias="billingContact" - ) - invoice_delivery_method: BillingDeliveryReference | None = Field( - default=None, alias="invoiceDeliveryMethod" - ) - invoice_to_email_address: str | None = Field( - default=None, alias="invoiceToEmailAddress" - ) - invoice_cc_email_address: str | None = Field( - default=None, alias="invoiceCCEmailAddress" - ) - deleted_flag: bool | None = Field(default=None, alias="deletedFlag") - date_deleted: datetime | None = Field(default=None, alias="dateDeleted") - deleted_by: str | None = Field(default=None, alias="deletedBy") - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - facebook_url: str | None = Field(default=None, alias="facebookUrl") - twitter_url: str | None = Field(default=None, alias="twitterUrl") - linked_in_url: str | None = Field(default=None, alias="linkedInUrl") - currency: CurrencyReference | None = None - territory_manager: MemberReference | None = Field( - default=None, alias="territoryManager" - ) - reseller_identifier: str | None = Field(default=None, alias="resellerIdentifier") - is_vendor_flag: bool | None = Field(default=None, alias="isVendorFlag") - types: list[CompanyTypeReference] | None = None + vendor_identifier: Annotated[str | None, Field(alias="vendorIdentifier")] = None + website: str | None = None + """ + Max length: 255; + """ + year_established: Annotated[int | None, Field(alias="yearEstablished")] = None + zip: str | None = None """ - Gets or sets integrer array of Company_Type_Recids to be assigned to company that can be passed in only during new company creation (post) - To update existing companies type, use the /company/companyTypeAssociations or /company/companies/{ID}/typeAssociations endpoints. + At least one address field is required -- addressLine1, addressLine2, city, state, zip and/or country Max length: 12; """ - site: SiteReference | None = None - integrator_tags: list[str] | None = Field(default=None, alias="integratorTags") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class CompanyCompanyTypeAssociation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None id: int | None = None type: CompanyTypeReference | None = None - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanyConfiguration(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 100; - """ - type: ConfigurationTypeReference | None = None - status: ConfigurationStatusReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + active_flag: Annotated[bool | None, Field(alias="activeFlag")] = None + backup_billable_space_gb: Annotated[float | None, Field(alias="backupBillableSpaceGb")] = None + backup_failed: Annotated[int | None, Field(alias="backupFailed")] = None + backup_incomplete: Annotated[int | None, Field(alias="backupIncomplete")] = None + backup_month: Annotated[int | None, Field(alias="backupMonth")] = None + backup_protected_device_list: Annotated[str | None, Field(alias="backupProtectedDeviceList")] = None + backup_restores: Annotated[int | None, Field(alias="backupRestores")] = None + backup_server_name: Annotated[str | None, Field(alias="backupServerName")] = None + """ + Max length: 50; + """ + backup_successes: Annotated[int | None, Field(alias="backupSuccesses")] = None + backup_year: Annotated[int | None, Field(alias="backupYear")] = None + bill_flag: Annotated[bool | None, Field(alias="billFlag")] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None company: CompanyReference | None = None + company_location_id: Annotated[int | None, Field(alias="companyLocationId")] = None contact: ContactReference | None = None - site: SiteReference | None = None - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - device_identifier: str | None = Field(default=None, alias="deviceIdentifier") + cpu_speed: Annotated[str | None, Field(alias="cpuSpeed")] = None """ Max length: 100; """ - serial_number: str | None = Field(default=None, alias="serialNumber") + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + default_gateway: Annotated[str | None, Field(alias="defaultGateway")] = None """ - Max length: 250; + Max length: 50; """ - model_number: str | None = Field(default=None, alias="modelNumber") + device_identifier: Annotated[str | None, Field(alias="deviceIdentifier")] = None """ - Max length: 50; + Max length: 100; """ - tag_number: str | None = Field(default=None, alias="tagNumber") + display_vendor_flag: Annotated[bool | None, Field(alias="displayVendorFlag")] = None + id: int | None = None + installation_date: Annotated[datetime | None, Field(alias="installationDate")] = None + installed_by: Annotated[MemberReference | None, Field(alias="installedBy")] = None + ip_address: Annotated[str | None, Field(alias="ipAddress")] = None """ Max length: 50; """ - purchase_date: datetime | None = Field(default=None, alias="purchaseDate") - installation_date: datetime | None = Field(default=None, alias="installationDate") - installed_by: MemberReference | None = Field(default=None, alias="installedBy") - warranty_expiration_date: datetime | None = Field( - default=None, alias="warrantyExpirationDate" - ) - vendor_notes: str | None = Field(default=None, alias="vendorNotes") - notes: str | None = None - mac_address: str | None = Field(default=None, alias="macAddress") + last_backup_date: Annotated[datetime | None, Field(alias="lastBackupDate")] = None + last_login_name: Annotated[str | None, Field(alias="lastLoginName")] = None """ - Max length: 25; + Max length: 100; """ - last_login_name: str | None = Field(default=None, alias="lastLoginName") + local_hard_drives: Annotated[str | None, Field(alias="localHardDrives")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + mac_address: Annotated[str | None, Field(alias="macAddress")] = None """ - Max length: 100; + Max length: 25; """ - bill_flag: bool | None = Field(default=None, alias="billFlag") - backup_successes: int | None = Field(default=None, alias="backupSuccesses") - backup_incomplete: int | None = Field(default=None, alias="backupIncomplete") - backup_failed: int | None = Field(default=None, alias="backupFailed") - backup_restores: int | None = Field(default=None, alias="backupRestores") - last_backup_date: datetime | None = Field(default=None, alias="lastBackupDate") - backup_server_name: str | None = Field(default=None, alias="backupServerName") + management_link: Annotated[str | None, Field(alias="managementLink")] = None """ - Max length: 50; + Max length: 1000; """ - backup_billable_space_gb: float | None = Field( - default=None, alias="backupBillableSpaceGb" - ) - backup_protected_device_list: str | None = Field( - default=None, alias="backupProtectedDeviceList" - ) - backup_year: int | None = Field(default=None, alias="backupYear") - backup_month: int | None = Field(default=None, alias="backupMonth") - ip_address: str | None = Field(default=None, alias="ipAddress") + manufacturer: ManufacturerReference | None = None + manufacturer_part_number: Annotated[str | None, Field(alias="manufacturerPartNumber")] = None """ Max length: 50; """ - default_gateway: str | None = Field(default=None, alias="defaultGateway") + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + model_number: Annotated[str | None, Field(alias="modelNumber")] = None """ Max length: 50; """ - os_type: str | None = Field(default=None, alias="osType") + name: str """ - Max length: 250; + Max length: 100; """ - os_info: str | None = Field(default=None, alias="osInfo") + needs_renewal_flag: Annotated[bool | None, Field(alias="needsRenewalFlag")] = None + notes: str | None = None + os_info: Annotated[str | None, Field(alias="osInfo")] = None """ Max length: 250; """ - cpu_speed: str | None = Field(default=None, alias="cpuSpeed") + os_type: Annotated[str | None, Field(alias="osType")] = None """ - Max length: 100; + Max length: 250; """ + parent_configuration_id: Annotated[int | None, Field(alias="parentConfigurationId")] = None + purchase_date: Annotated[datetime | None, Field(alias="purchaseDate")] = None + questions: list[ConfigurationQuestion] | None = None ram: str | None = None """ Max length: 25; """ - local_hard_drives: str | None = Field(default=None, alias="localHardDrives") - parent_configuration_id: int | None = Field( - default=None, alias="parentConfigurationId" - ) - vendor: CompanyReference | None = None - manufacturer: ManufacturerReference | None = None - questions: list[ConfigurationQuestion] | None = None - active_flag: bool | None = Field(default=None, alias="activeFlag") - management_link: str | None = Field(default=None, alias="managementLink") + remote_link: Annotated[str | None, Field(alias="remoteLink")] = None """ Max length: 1000; """ - remote_link: str | None = Field(default=None, alias="remoteLink") + serial_number: Annotated[str | None, Field(alias="serialNumber")] = None """ - Max length: 1000; + Max length: 250; """ + show_automate_flag: Annotated[bool | None, Field(alias="showAutomateFlag")] = None + show_remote_flag: Annotated[bool | None, Field(alias="showRemoteFlag")] = None + site: SiteReference | None = None sla: SLAReference | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - display_vendor_flag: bool | None = Field(default=None, alias="displayVendorFlag") - company_location_id: int | None = Field(default=None, alias="companyLocationId") - show_remote_flag: bool | None = Field(default=None, alias="showRemoteFlag") - show_automate_flag: bool | None = Field(default=None, alias="showAutomateFlag") - needs_renewal_flag: bool | None = Field(default=None, alias="needsRenewalFlag") - manufacturer_part_number: str | None = Field( - default=None, alias="manufacturerPartNumber" - ) + status: ConfigurationStatusReference | None = None + tag_number: Annotated[str | None, Field(alias="tagNumber")] = None """ Max length: 50; """ - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + type: ConfigurationTypeReference | None = None + vendor: CompanyReference | None = None + vendor_notes: Annotated[str | None, Field(alias="vendorNotes")] = None + warranty_expiration_date: Annotated[datetime | None, Field(alias="warrantyExpirationDate")] = None class CompanyContactTypeAssociation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + contact: ContactReference | None = None id: int | None = None type: ContactTypeReference | None = None - contact: ContactReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") -class CompanyCompanyTypeAssociationCompanyTypeAssociation( - CompanyCompanyTypeAssociation -): +class CompanyCompanyTypeAssociationCompanyTypeAssociation(CompanyCompanyTypeAssociation): pass class CompanyCustomNote(ConnectWiseModel): - id: int | None = None - custom_note: str = Field(..., alias="customNote") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None + custom_note: Annotated[str, Field(alias="customNote")] """ Max length: 1500; """ + id: int | None = None status: CompanyStatusReference | None = None - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanyFinance(ConnectWiseModel): - id: int | None = None - bill_override_flag: bool | None = Field(default=None, alias="billOverrideFlag") - bill_sr_flag: bool | None = Field(default=None, alias="billSrFlag") - bill_complete_sr_flag: bool | None = Field(default=None, alias="billCompleteSrFlag") - bill_unapproved_sr_flag: bool | None = Field( - default=None, alias="billUnapprovedSrFlag" - ) - bill_restrict_pm_flag: bool | None = Field(default=None, alias="billRestrictPmFlag") - bill_complete_pm_flag: bool | None = Field(default=None, alias="billCompletePmFlag") - bill_unapproved_pm_flag: bool | None = Field( - default=None, alias="billUnapprovedPmFlag" - ) - email_template: EmailTemplateReference | None = Field( - default=None, alias="emailTemplate" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + bill_complete_pm_flag: Annotated[bool | None, Field(alias="billCompletePmFlag")] = None + bill_complete_sr_flag: Annotated[bool | None, Field(alias="billCompleteSrFlag")] = None + bill_override_flag: Annotated[bool | None, Field(alias="billOverrideFlag")] = None + bill_restrict_pm_flag: Annotated[bool | None, Field(alias="billRestrictPmFlag")] = None + bill_sr_flag: Annotated[bool | None, Field(alias="billSrFlag")] = None + bill_unapproved_pm_flag: Annotated[bool | None, Field(alias="billUnapprovedPmFlag")] = None + bill_unapproved_sr_flag: Annotated[bool | None, Field(alias="billUnapprovedSrFlag")] = None company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + email_template: Annotated[EmailTemplateReference | None, Field(alias="emailTemplate")] = None + id: int | None = None class CompanyGroup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_contacts_flag: Annotated[bool | None, Field(alias="allContactsFlag")] = None + company: CompanyReference | None = None + contact_ids: Annotated[list[int] | None, Field(alias="contactIds")] = None + default_contact_flag: Annotated[bool | None, Field(alias="defaultContactFlag")] = None + group: GroupReference | None = None id: int | None = None """ Required On Updates; """ - group: GroupReference | None = None - company: CompanyReference | None = None - default_contact_flag: bool | None = Field(default=None, alias="defaultContactFlag") - all_contacts_flag: bool | None = Field(default=None, alias="allContactsFlag") - remove_all_contacts_flag: bool | None = Field( - default=None, alias="removeAllContactsFlag" - ) - unsubscribe_flag: bool | None = Field(default=None, alias="unsubscribeFlag") - contact_ids: list[int] | None = Field(default=None, alias="contactIds") - info: dict[str, str] | None = Field(default=None, alias="_info") + remove_all_contacts_flag: Annotated[bool | None, Field(alias="removeAllContactsFlag")] = None + unsubscribe_flag: Annotated[bool | None, Field(alias="unsubscribeFlag")] = None class CompanyManagementSummary(ConnectWiseModel): - id: int | None = None - management_solution: ManagementSolutionReference | None = Field( - default=None, alias="managementSolution" - ) - group_identifier: str = Field(..., alias="groupIdentifier") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement: AgreementReference | None = None + alerts_generated: Annotated[str | None, Field(alias="alertsGenerated")] = None + company: CompanyReference | None = None + cpu_utilization: Annotated[float | None, Field(alias="cpuUtilization")] = None + device_type: Annotated[ + Literal["WorkstationsAndServers", "BackupStats", "Servers", "Workstations"] | None, Field(alias="deviceType") + ] = None """ - Max length: 100; + deviceType is required if the managementSolution is Legacy """ - device_type: Literal[ - "WorkstationsAndServers", "BackupStats", "Servers", "Workstations" - ] | None = Field(default=None, alias="deviceType") + disk_cleanups: Annotated[int | None, Field(alias="diskCleanups")] = None + disk_defragmentations: Annotated[int | None, Field(alias="diskDefragmentations")] = None + disk_space_cleaned_mb: Annotated[int | None, Field(alias="diskSpaceCleanedMb")] = None + failed_backup_jobs: Annotated[int | None, Field(alias="failedBackupJobs")] = None + fully_patched_machines: Annotated[int | None, Field(alias="fullyPatchedMachines")] = None + group_identifier: Annotated[str, Field(alias="groupIdentifier")] """ - Gets or sets deviceType is required if the managementSolution is Legacy. + Max length: 100; """ - agreement: AgreementReference | None = None - snmp_machines: int | None = Field(default=None, alias="snmpMachines") - total_workstations: int | None = Field(default=None, alias="totalWorkstations") - total_servers: int | None = Field(default=None, alias="totalServers") - total_windows_servers: int | None = Field(default=None, alias="totalWindowsServers") - total_windows_workstations: int | None = Field( - default=None, alias="totalWindowsWorkstations" - ) - total_managed_machines: int | None = Field( - default=None, alias="totalManagedMachines" - ) - servers_offline: int | None = Field(default=None, alias="serversOffline") - servers_disk_space_low: int | None = Field( - default=None, alias="serversDiskSpaceLow" - ) - failed_backup_jobs: int | None = Field(default=None, alias="failedBackupJobs") - total_notifications: int | None = Field(default=None, alias="totalNotifications") - successful_backup_jobs: int | None = Field( - default=None, alias="successfulBackupJobs" - ) - server_availability: int | None = Field(default=None, alias="serverAvailability") - viruses_removed: int | None = Field(default=None, alias="virusesRemoved") - spyware_items_removed: int | None = Field(default=None, alias="spywareItemsRemoved") - windows_patches_installed: int | None = Field( - default=None, alias="windowsPatchesInstalled" - ) - disk_cleanups: int | None = Field(default=None, alias="diskCleanups") - disk_defragmentations: int | None = Field( - default=None, alias="diskDefragmentations" - ) - fully_patched_machines: int | None = Field( - default=None, alias="fullyPatchedMachines" - ) - missing_one_two_patches_machines: int | None = Field( - default=None, alias="missingOneTwoPatchesMachines" - ) - missing_three_five_patches_machines: int | None = Field( - default=None, alias="missingThreeFivePatchesMachines" - ) - missing_more_five_patches_machines: int | None = Field( - default=None, alias="missingMoreFivePatchesMachines" - ) - missing_unscanned_patches_machines: int | None = Field( - default=None, alias="missingUnscannedPatchesMachines" - ) - alerts_generated: str | None = Field(default=None, alias="alertsGenerated") - internet_connectivity: float | None = Field( - default=None, alias="internetConnectivity" - ) - disk_space_cleaned_mb: int | None = Field(default=None, alias="diskSpaceCleanedMb") - missing_security_patches: str | None = Field( - default=None, alias="missingSecurityPatches" - ) - cpu_utilization: float | None = Field(default=None, alias="cpuUtilization") - memory_utilization: float | None = Field(default=None, alias="memoryUtilization") - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + internet_connectivity: Annotated[float | None, Field(alias="internetConnectivity")] = None + management_solution: Annotated[ManagementSolutionReference | None, Field(alias="managementSolution")] = None + memory_utilization: Annotated[float | None, Field(alias="memoryUtilization")] = None + missing_more_five_patches_machines: Annotated[int | None, Field(alias="missingMoreFivePatchesMachines")] = None + missing_one_two_patches_machines: Annotated[int | None, Field(alias="missingOneTwoPatchesMachines")] = None + missing_security_patches: Annotated[str | None, Field(alias="missingSecurityPatches")] = None + missing_three_five_patches_machines: Annotated[int | None, Field(alias="missingThreeFivePatchesMachines")] = None + missing_unscanned_patches_machines: Annotated[int | None, Field(alias="missingUnscannedPatchesMachines")] = None + server_availability: Annotated[int | None, Field(alias="serverAvailability")] = None + servers_disk_space_low: Annotated[int | None, Field(alias="serversDiskSpaceLow")] = None + servers_offline: Annotated[int | None, Field(alias="serversOffline")] = None + snmp_machines: Annotated[int | None, Field(alias="snmpMachines")] = None + spyware_items_removed: Annotated[int | None, Field(alias="spywareItemsRemoved")] = None + successful_backup_jobs: Annotated[int | None, Field(alias="successfulBackupJobs")] = None + total_managed_machines: Annotated[int | None, Field(alias="totalManagedMachines")] = None + total_notifications: Annotated[int | None, Field(alias="totalNotifications")] = None + total_servers: Annotated[int | None, Field(alias="totalServers")] = None + total_windows_servers: Annotated[int | None, Field(alias="totalWindowsServers")] = None + total_windows_workstations: Annotated[int | None, Field(alias="totalWindowsWorkstations")] = None + total_workstations: Annotated[int | None, Field(alias="totalWorkstations")] = None + viruses_removed: Annotated[int | None, Field(alias="virusesRemoved")] = None + windows_patches_installed: Annotated[int | None, Field(alias="windowsPatchesInstalled")] = None class CompanyNote(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None + flagged: bool | None = None id: int | None = None text: str type: NoteTypeReference | None = None - flagged: bool | None = None - entered_by: str | None = Field(default=None, alias="enteredBy") - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanyPickerItem(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None + company_country: Annotated[CountryReference | None, Field(alias="companyCountry")] = None + company_location: Annotated[SystemLocationReference | None, Field(alias="companyLocation")] = None + company_site: Annotated[SiteReference | None, Field(alias="companySite")] = None + company_status: Annotated[CompanyStatusReference | None, Field(alias="companyStatus")] = None + company_type: Annotated[CompanyTypeReference | None, Field(alias="companyType")] = None id: int | None = None member: MemberReference | None = None - company: CompanyReference | None = None - company_status: CompanyStatusReference | None = Field( - default=None, alias="companyStatus" - ) - company_type: CompanyTypeReference | None = Field(default=None, alias="companyType") - company_site: SiteReference | None = Field(default=None, alias="companySite") - company_location: SystemLocationReference | None = Field( - default=None, alias="companyLocation" - ) - company_country: CountryReference | None = Field( - default=None, alias="companyCountry" - ) - vendor_picker_flag: bool | None = Field(default=None, alias="vendorPickerFlag") + vendor_picker_flag: Annotated[bool | None, Field(alias="vendorPickerFlag")] = None """ - Gets or sets if true, this record was created by the vendor picker component. Otherwise, the record was created by the company picker component. + If true, this record was created by the vendor picker component. Otherwise, the record was created by the company picker component. """ - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanySite(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 50; - """ - address_line1: str | None = Field(default=None, alias="addressLine1") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + address_format: Annotated[str | None, Field(alias="addressFormat")] = None + address_line1: Annotated[str | None, Field(alias="addressLine1")] = None """ Max length: 50; """ - address_line2: str | None = Field(default=None, alias="addressLine2") + address_line2: Annotated[str | None, Field(alias="addressLine2")] = None """ Max length: 50; """ + bill_separate_flag: Annotated[bool | None, Field(alias="billSeparateFlag")] = None + calendar: CalendarReference | None = None city: str | None = None """ Max length: 50; """ - state_reference: StateReference | None = Field(default=None, alias="stateReference") - zip: str | None = None + company: CompanyReference | None = None + core_entity_site_identifier: Annotated[str | None, Field(alias="coreEntitySiteIdentifier")] = None """ - Max length: 12; + Max length: 36; """ country: CountryReference | None = None - address_format: str | None = Field(default=None, alias="addressFormat") - phone_number: str | None = Field(default=None, alias="phoneNumber") + default_billing_flag: Annotated[bool | None, Field(alias="defaultBillingFlag")] = None + default_mailing_flag: Annotated[bool | None, Field(alias="defaultMailingFlag")] = None + default_shipping_flag: Annotated[bool | None, Field(alias="defaultShippingFlag")] = None + entity_type: Annotated[EntityTypeReference | None, Field(alias="entityType")] = None + expense_reimbursement: Annotated[float | None, Field(alias="expenseReimbursement")] = None + fax_number: Annotated[str | None, Field(alias="faxNumber")] = None """ Max length: 30; """ - phone_number_ext: str | None = Field(default=None, alias="phoneNumberExt") + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + name: str """ - Max length: 30; + Max length: 50; """ - fax_number: str | None = Field(default=None, alias="faxNumber") + phone_number: Annotated[str | None, Field(alias="phoneNumber")] = None """ Max length: 30; """ - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - entity_type: EntityTypeReference | None = Field(default=None, alias="entityType") - expense_reimbursement: float | None = Field( - default=None, alias="expenseReimbursement" - ) - primary_address_flag: bool | None = Field(default=None, alias="primaryAddressFlag") - default_shipping_flag: bool | None = Field( - default=None, alias="defaultShippingFlag" - ) - default_billing_flag: bool | None = Field(default=None, alias="defaultBillingFlag") - default_mailing_flag: bool | None = Field(default=None, alias="defaultMailingFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - bill_separate_flag: bool | None = Field(default=None, alias="billSeparateFlag") - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - calendar: CalendarReference | None = None - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + primary_address_flag: Annotated[bool | None, Field(alias="primaryAddressFlag")] = None + state_reference: Annotated[StateReference | None, Field(alias="stateReference")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="timeZone")] = None + zip: str | None = None + """ + Max length: 12; + """ class CompanyStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + cancel_open_tracks_flag: Annotated[bool | None, Field(alias="cancelOpenTracksFlag")] = None + custom_note_flag: Annotated[bool | None, Field(alias="customNoteFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + disallow_saving_flag: Annotated[bool | None, Field(alias="disallowSavingFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - notify_flag: bool | None = Field(default=None, alias="notifyFlag") - disallow_saving_flag: bool | None = Field(default=None, alias="disallowSavingFlag") - notification_message: str | None = Field(default=None, alias="notificationMessage") + notification_message: Annotated[str | None, Field(alias="notificationMessage")] = None """ Max length: 500; """ - custom_note_flag: bool | None = Field(default=None, alias="customNoteFlag") - cancel_open_tracks_flag: bool | None = Field( - default=None, alias="cancelOpenTracksFlag" - ) + notify_flag: Annotated[bool | None, Field(alias="notifyFlag")] = None track: TrackReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class CompanyTeam(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_manager_flag: Annotated[bool | None, Field(alias="accountManagerFlag")] = None company: CompanyReference | None = None - team_role: TeamRoleReference | None = Field(default=None, alias="teamRole") - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None contact: ContactReference | None = None + department: SystemDepartmentReference | None = None + id: int | None = None + location: SystemLocationReference | None = None member: MemberReference | None = None - account_manager_flag: bool | None = Field(default=None, alias="accountManagerFlag") - tech_flag: bool | None = Field(default=None, alias="techFlag") - sales_flag: bool | None = Field(default=None, alias="salesFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + sales_flag: Annotated[bool | None, Field(alias="salesFlag")] = None + team_role: Annotated[TeamRoleReference | None, Field(alias="teamRole")] = None + tech_flag: Annotated[bool | None, Field(alias="techFlag")] = None class ConfigurationTypeQuestion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + configuration_type: Annotated[ConfigurationTypeReference | None, Field(alias="configurationType")] = None + entry_type: Annotated[Literal["Date", "EntryField", "List", "Option"], Field(alias="entryType")] + field_type: Annotated[ + Literal[ + "TextArea", + "Currency", + "Date", + "Hyperlink", + "IPAddress", + "Checkbox", + "Number", + "Percent", + "Text", + "Password", + ], + Field(alias="fieldType"), + ] id: int | None = None - configuration_type: ConfigurationTypeReference | None = Field( - default=None, alias="configurationType" - ) - field_type: Literal[ - "TextArea", - "Currency", - "Date", - "Hyperlink", - "IPAddress", - "Checkbox", - "Number", - "Percent", - "Text", - "Password", - ] = Field(..., alias="fieldType") - entry_type: Literal["Date", "EntryField", "List", "Option"] = Field( - ..., alias="entryType" - ) - sequence_number: float = Field(..., alias="sequenceNumber") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + number_of_decimals: Annotated[int | None, Field(alias="numberOfDecimals")] = None question: str """ Max length: 1000; """ - number_of_decimals: int | None = Field(default=None, alias="numberOfDecimals") - required_flag: bool | None = Field(default=None, alias="requiredFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + sequence_number: Annotated[float, Field(alias="sequenceNumber")] class ConfigurationTypeQuestionInfo(ConnectWiseModel): - id: int | None = None - configuration_type: ConfigurationTypeReference | None = Field( - default=None, alias="configurationType" - ) - field_type: Literal[ - "TextArea", - "Currency", - "Date", - "Hyperlink", - "IPAddress", - "Checkbox", - "Number", - "Percent", - "Text", - "Password", - ] | None = Field(default=None, alias="fieldType") - entry_type: Literal["Date", "EntryField", "List", "Option"] | None = Field( - default=None, alias="entryType" - ) - sequence_number: float | None = Field(default=None, alias="sequenceNumber") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + configuration_type: Annotated[ConfigurationTypeReference | None, Field(alias="configurationType")] = None + entry_type: Annotated[Literal["Date", "EntryField", "List", "Option"] | None, Field(alias="entryType")] = None + field_type: Annotated[ + Literal[ + "TextArea", + "Currency", + "Date", + "Hyperlink", + "IPAddress", + "Checkbox", + "Number", + "Percent", + "Text", + "Password", + ] + | None, + Field(alias="fieldType"), + ] = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + number_of_decimals: Annotated[int | None, Field(alias="numberOfDecimals")] = None question: str | None = None - number_of_decimals: int | None = Field(default=None, alias="numberOfDecimals") - required_flag: bool | None = Field(default=None, alias="requiredFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + sequence_number: Annotated[float | None, Field(alias="sequenceNumber")] = None class ConfigurationTypeQuestionValue(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + configuration_type: Annotated[ConfigurationTypeReference | None, Field(alias="configurationType")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - configuration_type: ConfigurationTypeReference | None = Field( - default=None, alias="configurationType" - ) + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None question: ConfigurationTypeQuestionReference | None = None value: str """ Max length: 1000; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ConfigurationTypeQuestionValueInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + configuration_type: Annotated[ConfigurationTypeReference | None, Field(alias="configurationType")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - configuration_type: ConfigurationTypeReference | None = Field( - default=None, alias="configurationType" - ) + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None question: ConfigurationTypeQuestionReference | None = None value: str | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class Contact(ConnectWiseModel): - id: int | None = None - first_name: str | None = Field(default=None, alias="firstName") - last_name: str | None = Field(default=None, alias="lastName") - company: CompanyReference | None = None - site: SiteReference | None = None - address_line1: str | None = Field(default=None, alias="addressLine1") - address_line2: str | None = Field(default=None, alias="addressLine2") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + address_line1: Annotated[str | None, Field(alias="addressLine1")] = None + address_line2: Annotated[str | None, Field(alias="addressLine2")] = None + anniversary: datetime | None = None + assistant_contact: Annotated[ContactReference | None, Field(alias="assistantContact")] = None + birth_day: Annotated[str | None, Field(alias="birthDay")] = None + children: str | None = None + children_flag: Annotated[bool | None, Field(alias="childrenFlag")] = None city: str | None = None - state: str | None = None - zip: str | None = None + communication_items: Annotated[list[ContactCommunicationItem] | None, Field(alias="communicationItems")] = None + company: CompanyReference | None = None + company_location: Annotated[SystemLocationReference | None, Field(alias="companyLocation")] = None country: CountryReference | None = None - relationship: RelationshipReference | None = None - relationship_override: str | None = Field( - default=None, alias="relationshipOverride" - ) + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + default_billing_flag: Annotated[bool | None, Field(alias="defaultBillingFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + default_merge_contact_id: Annotated[int | None, Field(alias="defaultMergeContactId")] = None + default_phone_extension: Annotated[str | None, Field(alias="defaultPhoneExtension")] = None + default_phone_nbr: Annotated[str | None, Field(alias="defaultPhoneNbr")] = None + default_phone_type: Annotated[str | None, Field(alias="defaultPhoneType")] = None department: ContactDepartmentReference | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - default_merge_contact_id: int | None = Field( - default=None, alias="defaultMergeContactId" - ) - security_identifier: str | None = Field(default=None, alias="securityIdentifier") - manager_contact: ContactReference | None = Field( - default=None, alias="managerContact" - ) - assistant_contact: ContactReference | None = Field( - default=None, alias="assistantContact" - ) - title: str | None = None - school: str | None = None - nick_name: str | None = Field(default=None, alias="nickName") - married_flag: bool | None = Field(default=None, alias="marriedFlag") - children_flag: bool | None = Field(default=None, alias="childrenFlag") - children: str | None = None - significant_other: str | None = Field(default=None, alias="significantOther") - portal_password: str | None = Field(default=None, alias="portalPassword") - portal_security_level: int | None = Field(default=None, alias="portalSecurityLevel") - disable_portal_login_flag: bool | None = Field( - default=None, alias="disablePortalLoginFlag" - ) - unsubscribe_flag: bool | None = Field(default=None, alias="unsubscribeFlag") + disable_portal_login_flag: Annotated[bool | None, Field(alias="disablePortalLoginFlag")] = None + facebook_url: Annotated[str | None, Field(alias="facebookUrl")] = None + first_name: Annotated[str | None, Field(alias="firstName")] = None gender: Literal["Female", "Male"] | None = None - birth_day: str | None = Field(default=None, alias="birthDay") - anniversary: str | None = None - presence: Literal[ - "NoAgent", "Online", "DoNotDisturb", "Away", "Offline" - ] | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - facebook_url: str | None = Field(default=None, alias="facebookUrl") - twitter_url: str | None = Field(default=None, alias="twitterUrl") - linked_in_url: str | None = Field(default=None, alias="linkedInUrl") - default_phone_type: str | None = Field(default=None, alias="defaultPhoneType") - default_phone_nbr: str | None = Field(default=None, alias="defaultPhoneNbr") - default_phone_extension: str | None = Field( - default=None, alias="defaultPhoneExtension" - ) - default_billing_flag: bool | None = Field(default=None, alias="defaultBillingFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - user_defined_field1: str | None = Field(default=None, alias="userDefinedField1") + id: int | None = None + ignore_duplicates: Annotated[bool | None, Field(alias="ignoreDuplicates")] = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + integrator_tags: Annotated[list[str] | None, Field(alias="integratorTags")] = None + last_name: Annotated[str | None, Field(alias="lastName")] = None + linked_in_url: Annotated[str | None, Field(alias="linkedInUrl")] = None + manager_contact: Annotated[ContactReference | None, Field(alias="managerContact")] = None + married_flag: Annotated[bool | None, Field(alias="marriedFlag")] = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + nick_name: Annotated[str | None, Field(alias="nickName")] = None + photo: DocumentReference | None = None + portal_password: Annotated[str | None, Field(alias="portalPassword")] = None + portal_security_level: Annotated[int | None, Field(alias="portalSecurityLevel")] = None + presence: Literal["NoAgent", "Online", "DoNotDisturb", "Away", "Offline"] | None = None + relationship: RelationshipReference | None = None + relationship_override: Annotated[str | None, Field(alias="relationshipOverride")] = None + school: str | None = None + security_identifier: Annotated[str | None, Field(alias="securityIdentifier")] = None + significant_other: Annotated[str | None, Field(alias="significantOther")] = None + site: SiteReference | None = None + state: str | None = None + title: str | None = None + twitter_url: Annotated[str | None, Field(alias="twitterUrl")] = None + type_ids: Annotated[list[int] | None, Field(alias="typeIds")] = None """ - Max length: 50; + Integrer array of Contact_Type_Recids to be assigned to contact that can be passed in only during new contact creation (post) + To update existing contacts type, use the /company/contactTypeAssociations or /company/contacts/{ID}/typeAssociations endpoints """ - user_defined_field2: str | None = Field(default=None, alias="userDefinedField2") + types: list[ContactTypeReference] | None = None + unsubscribe_flag: Annotated[bool | None, Field(alias="unsubscribeFlag")] = None + user_defined_field1: Annotated[str | None, Field(alias="userDefinedField1")] = None """ Max length: 50; """ - user_defined_field3: str | None = Field(default=None, alias="userDefinedField3") + user_defined_field10: Annotated[str | None, Field(alias="userDefinedField10")] = None """ Max length: 50; """ - user_defined_field4: str | None = Field(default=None, alias="userDefinedField4") + user_defined_field2: Annotated[str | None, Field(alias="userDefinedField2")] = None """ Max length: 50; """ - user_defined_field5: str | None = Field(default=None, alias="userDefinedField5") + user_defined_field3: Annotated[str | None, Field(alias="userDefinedField3")] = None """ Max length: 50; """ - user_defined_field6: str | None = Field(default=None, alias="userDefinedField6") + user_defined_field4: Annotated[str | None, Field(alias="userDefinedField4")] = None """ Max length: 50; """ - user_defined_field7: str | None = Field(default=None, alias="userDefinedField7") + user_defined_field5: Annotated[str | None, Field(alias="userDefinedField5")] = None """ Max length: 50; """ - user_defined_field8: str | None = Field(default=None, alias="userDefinedField8") + user_defined_field6: Annotated[str | None, Field(alias="userDefinedField6")] = None """ Max length: 50; """ - user_defined_field9: str | None = Field(default=None, alias="userDefinedField9") + user_defined_field7: Annotated[str | None, Field(alias="userDefinedField7")] = None """ Max length: 50; """ - user_defined_field10: str | None = Field(default=None, alias="userDefinedField10") + user_defined_field8: Annotated[str | None, Field(alias="userDefinedField8")] = None """ Max length: 50; """ - company_location: SystemLocationReference | None = Field( - default=None, alias="companyLocation" - ) - communication_items: list[ContactCommunicationItem] | None = Field( - default=None, alias="communicationItems" - ) - types: list[ContactTypeReference] | None = None - integrator_tags: list[str] | None = Field(default=None, alias="integratorTags") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) - photo: DocumentReference | None = None - ignore_duplicates: bool | None = Field(default=None, alias="ignoreDuplicates") - info: dict[str, str] | None = Field(default=None, alias="_info") - type_ids: list[int] | None = Field(default=None, alias="typeIds") + user_defined_field9: Annotated[str | None, Field(alias="userDefinedField9")] = None """ - Gets or sets integrer array of Contact_Type_Recids to be assigned to contact that can be passed in only during new contact creation (post) - To update existing contacts type, use the /company/contactTypeAssociations or /company/contacts/{ID}/typeAssociations endpoints. + Max length: 50; """ + zip: str | None = None -class ContactContactTypeAssociationContactTypeAssociation( - CompanyContactTypeAssociation -): +class ContactContactTypeAssociationContactTypeAssociation(CompanyContactTypeAssociation): pass class ContactGroup(ConnectWiseModel): - id: int | None = None - group: GroupReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company_group_unsubscribed_email_message: Annotated[ + str | None, Field(alias="companyGroupUnsubscribedEmailMessage") + ] = None + company_unsubcribed_email_message: Annotated[str | None, Field(alias="companyUnsubcribedEmailMessage")] = None contact: ContactReference | None = None + contact_group_unsubscribed_email_message: Annotated[ + str | None, Field(alias="contactGroupUnsubscribedEmailMessage") + ] = None + contact_unsubscribed_email_message: Annotated[str | None, Field(alias="contactUnsubscribedEmailMessage")] = None description: str | None = None """ Max length: 50; """ - unsubscribe_flag: bool | None = Field(default=None, alias="unsubscribeFlag") - company_unsubcribed_email_message: str | None = Field( - default=None, alias="companyUnsubcribedEmailMessage" - ) - company_group_unsubscribed_email_message: str | None = Field( - default=None, alias="companyGroupUnsubscribedEmailMessage" - ) - contact_unsubscribed_email_message: str | None = Field( - default=None, alias="contactUnsubscribedEmailMessage" - ) - contact_group_unsubscribed_email_message: str | None = Field( - default=None, alias="contactGroupUnsubscribedEmailMessage" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + group: GroupReference | None = None + id: int | None = None + unsubscribe_flag: Annotated[bool | None, Field(alias="unsubscribeFlag")] = None class ContactNote(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + contact_id: Annotated[int | None, Field(alias="contactId")] = None + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None + flagged: bool | None = None id: int | None = None - contact_id: int | None = Field(default=None, alias="contactId") text: str type: NoteTypeReference | None = None - flagged: bool | None = None - entered_by: str | None = Field(default=None, alias="enteredBy") - info: dict[str, str] | None = Field(default=None, alias="_info") class Conversion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + parent_uom: Annotated[UnitOfMeasureReference | None, Field(alias="parentUOM")] = None quantity: float | None = None - uom_type: UnitOfMeasureReference | None = Field(default=None, alias="uomType") - parent_uom: UnitOfMeasureReference | None = Field(default=None, alias="parentUOM") - info: dict[str, str] | None = Field(default=None, alias="_info") + uom_type: Annotated[UnitOfMeasureReference | None, Field(alias="uomType")] = None class ConvertItem(ConnectWiseModel): id: int | None = None - record_type: Literal["ProjectIssue", "ProjectTicket", "ServiceTicket"] = Field( - ..., alias="recordType" - ) - project: ProjectReference | None = None phase: ProjectPhaseReference | None = None - wbs_code: str | None = Field(default=None, alias="wbsCode") + project: ProjectReference | None = None + record_type: Annotated[Literal["ProjectIssue", "ProjectTicket", "ServiceTicket"], Field(alias="recordType")] + wbs_code: Annotated[str | None, Field(alias="wbsCode")] = None class ConvertToProject(ConnectWiseModel): id: int | None = None - record_type: Literal[ - "ProjectIssue", "ProjectTicket", "ServiceTicket" - ] | None = Field(default=None, alias="recordType") - project: ProjectReference | None = None phase: ProjectPhaseReference | None = None - wbs_code: str = Field(..., alias="wbsCode") + project: ProjectReference | None = None + record_type: Annotated[ + Literal["ProjectIssue", "ProjectTicket", "ServiceTicket"] | None, Field(alias="recordType") + ] = None + wbs_code: Annotated[str, Field(alias="wbsCode")] class CorporateStructure(ConnectWiseModel): - id: int | None = None - level_count: Literal[ - "Level1", "Level2", "Level3", "Level4", "Level5" - ] | None = Field(default=None, alias="levelCount") - level1_name: str | None = Field(default=None, alias="level1Name") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + base_currency: Annotated[CurrencyReference, Field(alias="baseCurrency")] + chief_operating_officer: Annotated[MemberReference | None, Field(alias="chiefOperatingOfficer")] = None + controller: MemberReference | None = None + dispatcher: MemberReference | None = None + duty_manager: Annotated[MemberReference | None, Field(alias="dutyManager")] = None + fiscal_year_start: Annotated[ + Literal[ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", + ], + Field(alias="fiscalYearStart"), + ] + group_caption: Annotated[str, Field(alias="groupCaption")] """ - Max length: 20; + Max length: 50; """ - level2_name: str | None = Field(default=None, alias="level2Name") + id: int | None = None + level1_name: Annotated[str | None, Field(alias="level1Name")] = None """ Max length: 20; """ - level3_name: str | None = Field(default=None, alias="level3Name") + level2_name: Annotated[str | None, Field(alias="level2Name")] = None """ Max length: 20; """ - level4_name: str | None = Field(default=None, alias="level4Name") + level3_name: Annotated[str | None, Field(alias="level3Name")] = None """ Max length: 20; """ - level5_name: str | None = Field(default=None, alias="level5Name") + level4_name: Annotated[str | None, Field(alias="level4Name")] = None """ Max length: 20; """ - fiscal_year_start: Literal[ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", - ] = Field(..., alias="fiscalYearStart") - location_caption: str = Field(..., alias="locationCaption") + level5_name: Annotated[str | None, Field(alias="level5Name")] = None """ - Max length: 50; + Max length: 20; """ - group_caption: str = Field(..., alias="groupCaption") + level_count: Annotated[ + Literal["Level1", "Level2", "Level3", "Level4", "Level5"] | None, Field(alias="levelCount") + ] = None + location_caption: Annotated[str, Field(alias="locationCaption")] """ Max length: 50; """ - base_currency: CurrencyReference = Field(..., alias="baseCurrency") president: MemberReference | None = None - chief_operating_officer: MemberReference | None = Field( - default=None, alias="chiefOperatingOfficer" - ) - controller: MemberReference | None = None - dispatcher: MemberReference | None = None - service_manager: MemberReference | None = Field( - default=None, alias="serviceManager" - ) - duty_manager: MemberReference | None = Field(default=None, alias="dutyManager") - info: dict[str, str] | None = Field(default=None, alias="_info") + service_manager: Annotated[MemberReference | None, Field(alias="serviceManager")] = None class CorporateStructureInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + base_currency: Annotated[CurrencyReference | None, Field(alias="baseCurrency")] = None + group_caption: Annotated[str | None, Field(alias="groupCaption")] = None id: int | None = None - location_caption: str | None = Field(default=None, alias="locationCaption") - group_caption: str | None = Field(default=None, alias="groupCaption") - base_currency: CurrencyReference | None = Field(default=None, alias="baseCurrency") - info: dict[str, str] | None = Field(default=None, alias="_info") + location_caption: Annotated[str | None, Field(alias="locationCaption")] = None class Country(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + address_format: Annotated[AddressFormatReference | None, Field(alias="addressFormat")] = None + city_caption: Annotated[str | None, Field(alias="cityCaption")] = None """ - Max length: 50; + Max length: 25; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - currency: CurrencyReference | None = None - city_caption: str | None = Field(default=None, alias="cityCaption") + core_entity_country_code: Annotated[ + Literal[ + "AF", + "AX", + "AL", + "DZ", + "AS", + "AD", + "AO", + "AI", + "AQ", + "AR", + "AM", + "AW", + "AT", + "AZ", + "BH", + "BD", + "BB", + "BY", + "BZ", + "BJ", + "BM", + "BT", + "BO", + "BQ", + "BA", + "BW", + "BV", + "IO", + "BN", + "BG", + "BF", + "BI", + "CM", + "CV", + "KY", + "CF", + "TD", + "CL", + "CX", + "CC", + "CO", + "KM", + "CG", + "CK", + "CI", + "HR", + "CU", + "CW", + "CY", + "CZ", + "CD", + "DK", + "DJ", + "DM", + "EC", + "EG", + "GQ", + "ER", + "EE", + "ET", + "FK", + "FO", + "FJ", + "FI", + "FR", + "GF", + "PF", + "TF", + "GA", + "GM", + "GE", + "GH", + "GI", + "GR", + "GL", + "GD", + "GP", + "GU", + "GT", + "GG", + "GN", + "GW", + "GY", + "HT", + "HM", + "HN", + "HK", + "HU", + "IS", + "IN", + "IR", + "IQ", + "IE", + "IM", + "IT", + "JM", + "JP", + "JE", + "JO", + "KZ", + "KE", + "KI", + "XK", + "KW", + "KG", + "LA", + "LV", + "LB", + "LS", + "LR", + "LY", + "LI", + "LT", + "LU", + "MO", + "MK", + "MG", + "MW", + "MY", + "ML", + "MT", + "MH", + "MQ", + "MR", + "MU", + "YT", + "FM", + "MD", + "MC", + "MN", + "ME", + "MS", + "MZ", + "NA", + "NR", + "NP", + "NC", + "NZ", + "NI", + "NE", + "NG", + "NU", + "NF", + "KP", + "MP", + "OM", + "PK", + "PW", + "PS", + "PG", + "PY", + "PE", + "PN", + "PL", + "PT", + "PR", + "RE", + "RO", + "RU", + "RW", + "BL", + "SH", + "PM", + "VC", + "WS", + "SM", + "ST", + "SN", + "RS", + "SC", + "SL", + "SX", + "SK", + "SI", + "SB", + "SO", + "ZA", + "GS", + "KR", + "SS", + "ES", + "LK", + "SD", + "SR", + "SJ", + "SZ", + "SE", + "SY", + "TJ", + "TZ", + "TH", + "TL", + "TG", + "TK", + "TO", + "TN", + "TR", + "TV", + "UG", + "UA", + "GB", + "UM", + "UZ", + "VU", + "VN", + "WF", + "EH", + "YE", + "ZM", + "ZW", + "US", + "CR", + "MX", + "AE", + "VI", + "VG", + "SA", + "KH", + "AU", + "ID", + "CA", + "BR", + "TW", + "TM", + "TC", + "QA", + "MM", + "CN", + "SG", + "IL", + "VA", + "DE", + "NL", + "AG", + "BE", + "LC", + "UY", + "PH", + "BS", + "VE", + "CH", + "MF", + "KN", + "TT", + "DO", + "PA", + "MV", + "SV", + "NO", + "MA", + "AC", + "TA", + ] + | None, + Field(alias="coreEntityCountryCode"), + ] = None + country_code: Annotated[str | None, Field(alias="countryCode")] = None """ - Max length: 25; + Max length: 2; """ - state_caption: str | None = Field(default=None, alias="stateCaption") + currency: CurrencyReference | None = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + dialing_prefix: Annotated[str | None, Field(alias="dialingPrefix")] = None """ - Max length: 25; + Max length: 5; """ - zip_caption: str | None = Field(default=None, alias="zipCaption") + id: int | None = None + localization_caption_one: Annotated[str | None, Field(alias="localizationCaptionOne")] = None """ Max length: 25; """ - zip_minimum_length: int | None = Field(default=None, alias="zipMinimumLength") - dialing_prefix: str | None = Field(default=None, alias="dialingPrefix") + localization_value_one: Annotated[str | None, Field(alias="localizationValueOne")] = None """ - Max length: 5; + Max length: 50; """ - address_format: AddressFormatReference | None = Field( - default=None, alias="addressFormat" - ) - country_code: str | None = Field(default=None, alias="countryCode") + name: str """ - Max length: 2; + Max length: 50; """ - core_entity_country_code: Literal[ - "AF", - "AX", - "AL", - "DZ", - "AS", - "AD", - "AO", - "AI", - "AQ", - "AR", - "AM", - "AW", - "AT", - "AZ", - "BH", - "BD", - "BB", - "BY", - "BZ", - "BJ", - "BM", - "BT", - "BO", - "BQ", - "BA", - "BW", - "BV", - "IO", - "BN", - "BG", - "BF", - "BI", - "CM", - "CV", - "KY", - "CF", - "TD", - "CL", - "CX", - "CC", - "CO", - "KM", - "CG", - "CK", - "CI", - "HR", - "CU", - "CW", - "CY", - "CZ", - "CD", - "DK", - "DJ", - "DM", - "EC", - "EG", - "GQ", - "ER", - "EE", - "ET", - "FK", - "FO", - "FJ", - "FI", - "FR", - "GF", - "PF", - "TF", - "GA", - "GM", - "GE", - "GH", - "GI", - "GR", - "GL", - "GD", - "GP", - "GU", - "GT", - "GG", - "GN", - "GW", - "GY", - "HT", - "HM", - "HN", - "HK", - "HU", - "IS", - "IN", - "IR", - "IQ", - "IE", - "IM", - "IT", - "JM", - "JP", - "JE", - "JO", - "KZ", - "KE", - "KI", - "XK", - "KW", - "KG", - "LA", - "LV", - "LB", - "LS", - "LR", - "LY", - "LI", - "LT", - "LU", - "MO", - "MK", - "MG", - "MW", - "MY", - "ML", - "MT", - "MH", - "MQ", - "MR", - "MU", - "YT", - "FM", - "MD", - "MC", - "MN", - "ME", - "MS", - "MZ", - "NA", - "NR", - "NP", - "NC", - "NZ", - "NI", - "NE", - "NG", - "NU", - "NF", - "KP", - "MP", - "OM", - "PK", - "PW", - "PS", - "PG", - "PY", - "PE", - "PN", - "PL", - "PT", - "PR", - "RE", - "RO", - "RU", - "RW", - "BL", - "SH", - "PM", - "VC", - "WS", - "SM", - "ST", - "SN", - "RS", - "SC", - "SL", - "SX", - "SK", - "SI", - "SB", - "SO", - "ZA", - "GS", - "KR", - "SS", - "ES", - "LK", - "SD", - "SR", - "SJ", - "SZ", - "SE", - "SY", - "TJ", - "TZ", - "TH", - "TL", - "TG", - "TK", - "TO", - "TN", - "TR", - "TV", - "UG", - "UA", - "GB", - "UM", - "UZ", - "VU", - "VN", - "WF", - "EH", - "YE", - "ZM", - "ZW", - "US", - "CR", - "MX", - "AE", - "VI", - "VG", - "SA", - "KH", - "AU", - "ID", - "CA", - "BR", - "TW", - "TM", - "TC", - "QA", - "MM", - "CN", - "SG", - "IL", - "VA", - "DE", - "NL", - "AG", - "BE", - "LC", - "UY", - "PH", - "BS", - "VE", - "CH", - "MF", - "KN", - "TT", - "DO", - "PA", - "MV", - "SV", - "NO", - "MA", - "AC", - "TA", - ] | None = Field(default=None, alias="coreEntityCountryCode") - localization_caption_one: str | None = Field( - default=None, alias="localizationCaptionOne" - ) + state_caption: Annotated[str | None, Field(alias="stateCaption")] = None """ Max length: 25; """ - localization_value_one: str | None = Field( - default=None, alias="localizationValueOne" - ) + zip_caption: Annotated[str | None, Field(alias="zipCaption")] = None """ - Max length: 50; + Max length: 25; """ - info: dict[str, str] | None = Field(default=None, alias="_info") + zip_minimum_length: Annotated[int | None, Field(alias="zipMinimumLength")] = None class Crm(ConnectWiseModel): - id: int | None = None - company_list_count: int | None = Field(default=None, alias="companyListCount") - lock_probability_flag: bool | None = Field( - default=None, alias="lockProbabilityFlag" - ) - account_manager_role: TeamRoleReference | None = Field( - default=None, alias="accountManagerRole" - ) - technical_contact_role: TeamRoleReference | None = Field( - default=None, alias="technicalContactRole" - ) - sales_rep_role: TeamRoleReference | None = Field(default=None, alias="salesRepRole") - company_id_generation_flag: bool | None = Field( - default=None, alias="companyIdGenerationFlag" - ) - exclude_spaces_flag: bool | None = Field(default=None, alias="excludeSpacesFlag") - field1_caption: str | None = Field(default=None, alias="field1Caption") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_manager_role: Annotated[TeamRoleReference | None, Field(alias="accountManagerRole")] = None + company_id_generation_flag: Annotated[bool | None, Field(alias="companyIdGenerationFlag")] = None + company_list_count: Annotated[int | None, Field(alias="companyListCount")] = None + default_year: Annotated[bool | None, Field(alias="defaultYear")] = None + exclude_spaces_flag: Annotated[bool | None, Field(alias="excludeSpacesFlag")] = None + field10_caption: Annotated[str | None, Field(alias="field10Caption")] = None """ Max length: 25; """ - field2_caption: str | None = Field(default=None, alias="field2Caption") + field1_caption: Annotated[str | None, Field(alias="field1Caption")] = None """ Max length: 25; """ - field3_caption: str | None = Field(default=None, alias="field3Caption") + field2_caption: Annotated[str | None, Field(alias="field2Caption")] = None """ Max length: 25; """ - field4_caption: str | None = Field(default=None, alias="field4Caption") + field3_caption: Annotated[str | None, Field(alias="field3Caption")] = None """ Max length: 25; """ - field5_caption: str | None = Field(default=None, alias="field5Caption") + field4_caption: Annotated[str | None, Field(alias="field4Caption")] = None """ Max length: 25; """ - field6_caption: str | None = Field(default=None, alias="field6Caption") + field5_caption: Annotated[str | None, Field(alias="field5Caption")] = None """ Max length: 25; """ - field7_caption: str | None = Field(default=None, alias="field7Caption") + field6_caption: Annotated[str | None, Field(alias="field6Caption")] = None """ Max length: 25; """ - field8_caption: str | None = Field(default=None, alias="field8Caption") + field7_caption: Annotated[str | None, Field(alias="field7Caption")] = None """ Max length: 25; """ - field9_caption: str | None = Field(default=None, alias="field9Caption") + field8_caption: Annotated[str | None, Field(alias="field8Caption")] = None """ Max length: 25; """ - field10_caption: str | None = Field(default=None, alias="field10Caption") + field9_caption: Annotated[str | None, Field(alias="field9Caption")] = None """ Max length: 25; """ - primary_rep_caption: str | None = Field(default=None, alias="primaryRepCaption") + id: int | None = None + lock_probability_flag: Annotated[bool | None, Field(alias="lockProbabilityFlag")] = None + other1_caption: Annotated[str | None, Field(alias="other1Caption")] = None """ Max length: 50; """ - secondary_rep_caption: str | None = Field(default=None, alias="secondaryRepCaption") + other2_caption: Annotated[str | None, Field(alias="other2Caption")] = None """ Max length: 50; """ - other1_caption: str | None = Field(default=None, alias="other1Caption") + primary_rep_caption: Annotated[str | None, Field(alias="primaryRepCaption")] = None """ Max length: 50; """ - other2_caption: str | None = Field(default=None, alias="other2Caption") + sales_rep_role: Annotated[TeamRoleReference | None, Field(alias="salesRepRole")] = None + secondary_rep_caption: Annotated[str | None, Field(alias="secondaryRepCaption")] = None """ Max length: 50; """ - default_year: bool | None = Field(default=None, alias="defaultYear") - info: dict[str, str] | None = Field(default=None, alias="_info") + technical_contact_role: Annotated[TeamRoleReference | None, Field(alias="technicalContactRole")] = None class CrmInfo(ConnectWiseModel): - id: int | None = None - account_manager_role: TeamRoleReference | None = Field( - default=None, alias="accountManagerRole" - ) - technical_contact_role: TeamRoleReference | None = Field( - default=None, alias="technicalContactRole" - ) - sales_rep_role: TeamRoleReference | None = Field(default=None, alias="salesRepRole") - field1_caption: str | None = Field(default=None, alias="field1Caption") - field2_caption: str | None = Field(default=None, alias="field2Caption") - field3_caption: str | None = Field(default=None, alias="field3Caption") - field4_caption: str | None = Field(default=None, alias="field4Caption") - field5_caption: str | None = Field(default=None, alias="field5Caption") - field6_caption: str | None = Field(default=None, alias="field6Caption") - field7_caption: str | None = Field(default=None, alias="field7Caption") - field8_caption: str | None = Field(default=None, alias="field8Caption") - field9_caption: str | None = Field(default=None, alias="field9Caption") - field10_caption: str | None = Field(default=None, alias="field10Caption") - primary_rep_caption: str | None = Field(default=None, alias="primaryRepCaption") - secondary_rep_caption: str | None = Field(default=None, alias="secondaryRepCaption") - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_manager_role: Annotated[TeamRoleReference | None, Field(alias="accountManagerRole")] = None + field10_caption: Annotated[str | None, Field(alias="field10Caption")] = None + field1_caption: Annotated[str | None, Field(alias="field1Caption")] = None + field2_caption: Annotated[str | None, Field(alias="field2Caption")] = None + field3_caption: Annotated[str | None, Field(alias="field3Caption")] = None + field4_caption: Annotated[str | None, Field(alias="field4Caption")] = None + field5_caption: Annotated[str | None, Field(alias="field5Caption")] = None + field6_caption: Annotated[str | None, Field(alias="field6Caption")] = None + field7_caption: Annotated[str | None, Field(alias="field7Caption")] = None + field8_caption: Annotated[str | None, Field(alias="field8Caption")] = None + field9_caption: Annotated[str | None, Field(alias="field9Caption")] = None + id: int | None = None + primary_rep_caption: Annotated[str | None, Field(alias="primaryRepCaption")] = None + sales_rep_role: Annotated[TeamRoleReference | None, Field(alias="salesRepRole")] = None + secondary_rep_caption: Annotated[str | None, Field(alias="secondaryRepCaption")] = None + technical_contact_role: Annotated[TeamRoleReference | None, Field(alias="technicalContactRole")] = None class CustomReportParameter(ConnectWiseModel): - id: int | None = None - name: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + caption_name: Annotated[str | None, Field(alias="captionName")] = None """ - Either a caption name or parameter name is required. Max length: 50; + Either a caption name or parameter name is required Max length: 50; """ - caption_name: str | None = Field(default=None, alias="captionName") + custom_report: Annotated[CustomReportReference | None, Field(alias="customReport")] = None + id: int | None = None + name: str | None = None """ - Either a caption name or parameter name is required. Max length: 50; + Either a caption name or parameter name is required Max length: 50; """ - custom_report: CustomReportReference | None = Field( - default=None, alias="customReport" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class DepartmentLocation(ConnectWiseModel): - id: int | None = None - location: SystemLocationReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_locations: Annotated[bool | None, Field(alias="addAllLocations")] = None department: SystemDepartmentReference | None = None - department_manager: MemberReference | None = Field( - default=None, alias="departmentManager" - ) + department_manager: Annotated[MemberReference | None, Field(alias="departmentManager")] = None dispatch: MemberReference | None = None - service_manager: MemberReference | None = Field( - default=None, alias="serviceManager" - ) - duty_manager: MemberReference | None = Field(default=None, alias="dutyManager") - ldap_config: LdapConfigurationReference | None = Field( - default=None, alias="ldapConfig" - ) - add_all_locations: bool | None = Field(default=None, alias="addAllLocations") - remove_all_locations: bool | None = Field(default=None, alias="removeAllLocations") - info: dict[str, str] | None = Field(default=None, alias="_info") + duty_manager: Annotated[MemberReference | None, Field(alias="dutyManager")] = None + id: int | None = None + ldap_config: Annotated[LdapConfigurationReference | None, Field(alias="ldapConfig")] = None + location: SystemLocationReference | None = None + remove_all_locations: Annotated[bool | None, Field(alias="removeAllLocations")] = None + service_manager: Annotated[MemberReference | None, Field(alias="serviceManager")] = None class DepartmentLocationInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + department: SystemDepartmentReference | None = None id: int | None = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") -class DocumentInfo(ConnectWiseModel): +class EPayConfiguration(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + currency: CurrencyReference | None = None + encryption_key: Annotated[str | None, Field(alias="encryptionKey")] = None + """ + Max length: 500; + """ id: int | None = None - title: str | None = None - file_name: str | None = Field(default=None, alias="fileName") - server_file_name: str | None = Field(default=None, alias="serverFileName") - owner: str | None = None - link_flag: bool | None = Field(default=None, alias="linkFlag") - image_flag: bool | None = Field(default=None, alias="imageFlag") - public_flag: bool | None = Field(default=None, alias="publicFlag") - html_template_flag: bool | None = Field(default=None, alias="htmlTemplateFlag") - read_only_flag: bool | None = Field(default=None, alias="readOnlyFlag") - size: int | None = None - url_flag: bool | None = Field(default=None, alias="urlFlag") - created_on_date: str | None = Field(default=None, alias="createdOnDate") - document_type: DocumentTypeReference | None = Field( - default=None, alias="documentType" - ) - guid: UUID | None = Field( - default=None, example="00000000-0000-0000-0000-000000000000" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + initialization_vector: Annotated[str | None, Field(alias="initializationVector")] = None + """ + Max length: 500; + """ + location: SystemLocationReference | None = None + store_identifier: Annotated[str, Field(alias="storeIdentifier")] + """ + Max length: 500; + """ + url: str + """ + Max length: 400; + """ class EmailConnector(ConnectWiseModel): - id: int | None = None - email_server_type: Literal["IMAP", "Office365", "Google", "Asio365"] | None = Field( - default=None, alias="emailServerType" - ) - imap_setup: ImapSetupReference | None = Field(default=None, alias="imapSetup") - office365_email_setup: Office365EmailSetupReference | None = Field( - default=None, alias="office365EmailSetup" - ) - asio365_email_setup: Office365EmailSetupReference | None = Field( - default=None, alias="asio365EmailSetup" - ) - google_email_setup: GoogleEmailSetupReference | None = Field( - default=None, alias="googleEmailSetup" - ) - service_board: BoardReference | None = Field(default=None, alias="serviceBoard") - default_company: CompanyReference | None = Field( - default=None, alias="defaultCompany" - ) - default_member: MemberReference | None = Field(default=None, alias="defaultMember") - location: SystemLocationReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_cc_flag: Annotated[bool | None, Field(alias="addCcFlag")] = None + bcc_email_to: Annotated[str | None, Field(alias="bccEmailTo")] = None + """ + Max length: 250; + """ + create_contact_flag: Annotated[bool | None, Field(alias="createContactFlag")] = None + default_company: Annotated[CompanyReference | None, Field(alias="defaultCompany")] = None + default_member: Annotated[MemberReference | None, Field(alias="defaultMember")] = None department: SystemDepartmentReference | None = None - email_notify_from: str | None = Field(default=None, alias="emailNotifyFrom") + discard_duplicates_flag: Annotated[bool | None, Field(alias="discardDuplicatesFlag")] = None + email_errors_to: Annotated[str, Field(alias="emailErrorsTo")] """ Max length: 50; """ - bcc_email_to: str | None = Field(default=None, alias="bccEmailTo") + email_notify_from: Annotated[str | None, Field(alias="emailNotifyFrom")] = None """ - Max length: 250; + Max length: 50; """ - email_errors_to: str = Field(..., alias="emailErrorsTo") - """ - Max length: 50; - """ - set_email_to_default_contact_flag: bool | None = Field( - default=None, alias="setEmailToDefaultContactFlag" - ) - no_response_flag: bool | None = Field(default=None, alias="noResponseFlag") - never_respond_flag: bool | None = Field(default=None, alias="neverRespondFlag") - discard_duplicates_flag: bool | None = Field( - default=None, alias="discardDuplicatesFlag" - ) - post_replies_to_ticket_flag: bool | None = Field( - default=None, alias="postRepliesToTicketFlag" - ) - create_contact_flag: bool | None = Field(default=None, alias="createContactFlag") - response_email_for_new: str | None = Field( - default=None, alias="responseEmailForNew" - ) - response_email_for_existing: str | None = Field( - default=None, alias="responseEmailForExisting" - ) - source_override: ServiceSourceReference | None = Field( - default=None, alias="sourceOverride" - ) - priority_override: PriorityReference | None = Field( - default=None, alias="priorityOverride" - ) - type_override: ServiceTypeReference | None = Field( - default=None, alias="typeOverride" - ) - sub_type_override: ServiceSubTypeReference | None = Field( - default=None, alias="subTypeOverride" - ) - item_override: ServiceItemReference | None = Field( - default=None, alias="itemOverride" - ) - status_override: ServiceStatusReference | None = Field( - default=None, alias="statusOverride" - ) - add_cc_flag: bool | None = Field(default=None, alias="addCcFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + email_server_type: Annotated[Literal["IMAP", "Office365", "Google"] | None, Field(alias="emailServerType")] = None + google_email_setup: Annotated[GoogleEmailSetupReference | None, Field(alias="googleEmailSetup")] = None + id: int | None = None + imap_setup: Annotated[ImapSetupReference | None, Field(alias="imapSetup")] = None + item_override: Annotated[ServiceItemReference | None, Field(alias="itemOverride")] = None + location: SystemLocationReference | None = None + never_respond_flag: Annotated[bool | None, Field(alias="neverRespondFlag")] = None + no_response_flag: Annotated[bool | None, Field(alias="noResponseFlag")] = None + office365_email_setup: Annotated[Office365EmailSetupReference | None, Field(alias="office365EmailSetup")] = None + post_replies_to_ticket_flag: Annotated[bool | None, Field(alias="postRepliesToTicketFlag")] = None + priority_override: Annotated[PriorityReference | None, Field(alias="priorityOverride")] = None + response_email_for_existing: Annotated[str | None, Field(alias="responseEmailForExisting")] = None + response_email_for_new: Annotated[str | None, Field(alias="responseEmailForNew")] = None + service_board: Annotated[BoardReference | None, Field(alias="serviceBoard")] = None + set_email_to_default_contact_flag: Annotated[bool | None, Field(alias="setEmailToDefaultContactFlag")] = None + source_override: Annotated[ServiceSourceReference | None, Field(alias="sourceOverride")] = None + status_override: Annotated[ServiceStatusReference | None, Field(alias="statusOverride")] = None + sub_type_override: Annotated[ServiceSubTypeReference | None, Field(alias="subTypeOverride")] = None + type_override: Annotated[ServiceTypeReference | None, Field(alias="typeOverride")] = None class EmailConnectorInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - imap_setup: ImapSetupReference | None = Field(default=None, alias="imapSetup") - info: dict[str, str] | None = Field(default=None, alias="_info") + imap_setup: Annotated[ImapSetupReference | None, Field(alias="imapSetup")] = None class EmailConnectorParsingRule(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - parsing_style: EmailConnectorParsingStyleReference | None = Field( - default=None, alias="parsingStyle" - ) + parsing_style: Annotated[EmailConnectorParsingStyleReference | None, Field(alias="parsingStyle")] = None + parsing_variable: Annotated[EmailConnectorParsingVariableReference | None, Field(alias="parsingVariable")] = None priority: int - parsing_variable: EmailConnectorParsingVariableReference | None = Field( - default=None, alias="parsingVariable" - ) - search_term: str = Field(..., alias="searchTerm") + search_term: Annotated[str, Field(alias="searchTerm")] """ Max length: 250; """ - service_priority: PriorityReference | None = Field( - default=None, alias="servicePriority" - ) - service_status: ServiceStatusReference | None = Field( - default=None, alias="serviceStatus" - ) - service_type: ServiceTypeReference | None = Field(default=None, alias="serviceType") - service_sub_type: ServiceSubTypeReference | None = Field( - default=None, alias="serviceSubType" - ) - service_item: ServiceItemReference | None = Field(default=None, alias="serviceItem") - service_board: BoardReference | None = Field(default=None, alias="serviceBoard") - info: dict[str, str] | None = Field(default=None, alias="_info") + service_board: Annotated[BoardReference | None, Field(alias="serviceBoard")] = None + service_item: Annotated[ServiceItemReference | None, Field(alias="serviceItem")] = None + service_priority: Annotated[PriorityReference | None, Field(alias="servicePriority")] = None + service_status: Annotated[ServiceStatusReference | None, Field(alias="serviceStatus")] = None + service_sub_type: Annotated[ServiceSubTypeReference | None, Field(alias="serviceSubType")] = None + service_type: Annotated[ServiceTypeReference | None, Field(alias="serviceType")] = None class EmailConnectorParsingStyle(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - parsing_type: EmailConnectorParsingTypeReference | None = Field( - default=None, alias="parsingType" - ) - parse_rule: str = Field(..., alias="parseRule") + parse_rule: Annotated[str, Field(alias="parseRule")] """ Max length: 500; """ + parsing_type: Annotated[EmailConnectorParsingTypeReference | None, Field(alias="parsingType")] = None priority: int - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class EPayConfiguration(ConnectWiseModel): - id: int | None = None - location: SystemLocationReference | None = None - currency: CurrencyReference | None = None - url: str - """ - Max length: 400; - """ - store_identifier: str = Field(..., alias="storeIdentifier") - """ - Max length: 500; - """ - encryption_key: str | None = Field(default=None, alias="encryptionKey") - """ - Max length: 500; - """ - initialization_vector: str | None = Field( - default=None, alias="initializationVector" - ) - """ - Max length: 500; - """ - info: dict[str, str] | None = Field(default=None, alias="_info") class ErrorResponseMessage(ConnectWiseModel): code: str | None = None - message: str | None = None errors: list[ValidationError] | None = None + message: str | None = None class ExpenseEntryAudit(TimeEntryAudit): @@ -10715,12 +8759,13 @@ class ExpenseEntryAudit(TimeEntryAudit): class ExpenseReport(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + date_end: Annotated[datetime | None, Field(alias="dateEnd")] = None + date_start: Annotated[datetime | None, Field(alias="dateStart")] = None + due_date: Annotated[datetime | None, Field(alias="dueDate")] = None id: int | None = None member: MemberReference | None = None - year: int | None = None period: int | None = None - date_start: str | None = Field(default=None, alias="dateStart") - date_end: str | None = Field(default=None, alias="dateEnd") status: Literal[ "Open", "Rejected", @@ -10736,8 +8781,7 @@ class ExpenseReport(ConnectWiseModel): "BilledAgreement", ] | None = None total: float | None = None - due_date: str | None = Field(default=None, alias="dueDate") - info: dict[str, str] | None = Field(default=None, alias="_info") + year: int | None = None class ExpenseReportAudit(TimeEntryAudit): @@ -10745,805 +8789,652 @@ class ExpenseReportAudit(TimeEntryAudit): class ExpenseTax(ConnectWiseModel): - id: int | None = None amount: float | None = None + id: int | None = None type: ExpenseTaxTypeReference | None = None class ExpenseTypeExemption(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + expense_type: Annotated[ExpenseTypeReference, Field(alias="expenseType")] id: int | None = None - expense_type: ExpenseTypeReference = Field(..., alias="expenseType") - taxable_levels: list[int] | None = Field(default=None, alias="taxableLevels") - info: dict[str, str] | None = Field(default=None, alias="_info") + taxable_levels: Annotated[list[int] | None, Field(alias="taxableLevels")] = None class ForecastItem(ConnectWiseModel): - id: int | None = None - forecast_description: str | None = Field(default=None, alias="forecastDescription") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + bill_cycle: Annotated[BillingCycleReference | None, Field(alias="billCycle")] = None + catalog_item: Annotated[IvItemReference | None, Field(alias="catalogItem")] = None + cost: float | None = None + cycle_basis: Annotated[str | None, Field(alias="cycleBasis")] = None + cycles: int | None = None + forecast_description: Annotated[str | None, Field(alias="forecastDescription")] = None """ Max length: 50; """ - opportunity: OpportunityReference | None = None - quantity: float | None = None - status: OpportunityStatusReference | None = None - catalog_item: IvItemReference | None = Field(default=None, alias="catalogItem") - product_description: str | None = Field(default=None, alias="productDescription") - product_class: str | None = Field(default=None, alias="productClass") - revenue: float | None = None - cost: float | None = None + forecast_type: Annotated[ + Literal["Other1", "Other2", "Agreement", "Product", "Service"], Field(alias="forecastType") + ] + id: int | None = None + include_flag: Annotated[bool | None, Field(alias="includeFlag")] = None + link_flag: Annotated[bool | None, Field(alias="linkFlag")] = None margin: float | None = None + opportunity: OpportunityReference | None = None percentage: int | None = None - include_flag: bool | None = Field(default=None, alias="includeFlag") - quote_werks_doc_no: str | None = Field(default=None, alias="quoteWerksDocNo") + product_class: Annotated[str | None, Field(alias="productClass")] = None + product_description: Annotated[str | None, Field(alias="productDescription")] = None + quantity: float | None = None + quote_werks_doc_name: Annotated[str | None, Field(alias="quoteWerksDocName")] = None """ - Max length: 20; + Max length: 255; """ - quote_werks_doc_name: str | None = Field(default=None, alias="quoteWerksDocName") + quote_werks_doc_no: Annotated[str | None, Field(alias="quoteWerksDocNo")] = None """ - Max length: 255; + Max length: 20; """ - quote_werks_quantity: int | None = Field(default=None, alias="quoteWerksQuantity") - forecast_type: Literal[ - "Other1", "Other2", "Agreement", "Product", "Service" - ] = Field(..., alias="forecastType") - link_flag: bool | None = Field(default=None, alias="linkFlag") - recurring_revenue: float | None = Field(default=None, alias="recurringRevenue") - recurring_cost: float | None = Field(default=None, alias="recurringCost") - recurring_date_start: datetime | None = Field( - default=None, alias="recurringDateStart" - ) - recurring_date_end: datetime | None = Field(default=None, alias="recurringDateEnd") - bill_cycle: BillingCycleReference | None = Field(default=None, alias="billCycle") - cycle_basis: str | None = Field(default=None, alias="cycleBasis") - cycles: int | None = None - recurring_flag: bool | None = Field(default=None, alias="recurringFlag") - sequence_number: float | None = Field(default=None, alias="sequenceNumber") - sub_number: int | None = Field(default=None, alias="subNumber") - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + quote_werks_quantity: Annotated[int | None, Field(alias="quoteWerksQuantity")] = None + recurring_cost: Annotated[float | None, Field(alias="recurringCost")] = None + recurring_date_end: Annotated[datetime | None, Field(alias="recurringDateEnd")] = None + recurring_date_start: Annotated[datetime | None, Field(alias="recurringDateStart")] = None + recurring_flag: Annotated[bool | None, Field(alias="recurringFlag")] = None + recurring_revenue: Annotated[float | None, Field(alias="recurringRevenue")] = None + revenue: float | None = None + sequence_number: Annotated[float | None, Field(alias="sequenceNumber")] = None + status: OpportunityStatusReference | None = None + sub_number: Annotated[int | None, Field(alias="subNumber")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None class GLAccount(ConnectWiseModel): - id: int | None = None - gl_type: Literal[ - "AP", - "AR", - "EE", - "EI", - "EO", - "IA", - "IT", - "P", - "PF", - "R", - "RA", - "RD", - "RE", - "RP", - "ST", - "SD", - "ET", - "FT", - "PT", - "WP", - "WR", - ] = Field(..., alias="glType") - mapped_type: MappedTypeReference = Field(..., alias="mappedType") - mapped_record: MappedRecordReference = Field(..., alias="mappedRecord") - segment1: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + cogs1: str | None = None """ Max length: 255; """ - segment2: str | None = None + cogs10: str | None = None """ Max length: 255; """ - segment3: str | None = None + cogs2: str | None = None """ Max length: 255; """ - segment4: str | None = None + cogs3: str | None = None """ Max length: 255; """ - segment5: str | None = None + cogs4: str | None = None """ Max length: 255; """ - segment6: str | None = None + cogs5: str | None = None """ Max length: 255; """ - segment7: str | None = None + cogs6: str | None = None """ Max length: 255; """ - segment8: str | None = None + cogs7: str | None = None """ Max length: 255; """ - segment9: str | None = None + cogs8: str | None = None """ Max length: 255; """ - segment10: str | None = None + cogs9: str | None = None """ Max length: 255; """ - cogs1: str | None = None + gl_type: Annotated[ + Literal[ + "AP", + "AR", + "EE", + "EI", + "EO", + "IA", + "IT", + "P", + "PF", + "R", + "RA", + "RD", + "RE", + "RP", + "ST", + "SD", + "ET", + "FT", + "PT", + ], + Field(alias="glType"), + ] + id: int | None = None + inventory: str | None = None """ Max length: 255; """ - cogs2: str | None = None + mapped_record: Annotated[MappedRecordReference, Field(alias="mappedRecord")] + mapped_type: Annotated[MappedTypeReference, Field(alias="mappedType")] + product_id: Annotated[str | None, Field(alias="productId")] = None """ Max length: 255; """ - cogs3: str | None = None + sales_code: Annotated[str | None, Field(alias="salesCode")] = None """ Max length: 255; """ - cogs4: str | None = None + segment1: str | None = None """ Max length: 255; """ - cogs5: str | None = None + segment10: str | None = None """ Max length: 255; """ - cogs6: str | None = None + segment2: str | None = None """ Max length: 255; """ - cogs7: str | None = None + segment3: str | None = None """ Max length: 255; """ - cogs8: str | None = None + segment4: str | None = None """ Max length: 255; """ - cogs9: str | None = None + segment5: str | None = None """ Max length: 255; """ - cogs10: str | None = None + segment6: str | None = None """ Max length: 255; """ - product_id: str | None = Field(default=None, alias="productId") + segment7: str | None = None """ Max length: 255; """ - inventory: str | None = None + segment8: str | None = None """ Max length: 255; """ - sales_code: str | None = Field(default=None, alias="salesCode") + segment9: str | None = None """ Max length: 255; """ - info: dict[str, str] | None = Field(default=None, alias="_info") class GLExportAdjustmentTransactionDetail(ConnectWiseModel): - gl_class: str | None = Field(default=None, alias="glClass") + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + cost: float | None = None + cost_account_number: Annotated[str | None, Field(alias="costAccountNumber")] = None description: str | None = None - memo: str | None = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + inventory_account_number: Annotated[str | None, Field(alias="inventoryAccountNumber")] = None item: IvItemReference | None = None + memo: str | None = None + product_account_number: Annotated[str | None, Field(alias="productAccountNumber")] = None quantity: int | None = None total: float | None = None - cost: float | None = None - cost_account_number: str | None = Field(default=None, alias="costAccountNumber") - inventory_account_number: str | None = Field( - default=None, alias="inventoryAccountNumber" - ) - account_number: str | None = Field(default=None, alias="accountNumber") - product_account_number: str | None = Field( - default=None, alias="productAccountNumber" - ) class GLExportCustomer(ConnectWiseModel): + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + billing_terms_xref: Annotated[str | None, Field(alias="billingTermsXref")] = None + city_tax_agency_xref: Annotated[str | None, Field(alias="cityTaxAgencyXref")] = None + city_tax_rate: Annotated[float | None, Field(alias="cityTaxRate")] = None + city_tax_xref: Annotated[str | None, Field(alias="cityTaxXref")] = None company: CompanyReference | None = None - company_type: CompanyTypeReference | None = Field(default=None, alias="companyType") + company_type: Annotated[CompanyTypeReference | None, Field(alias="companyType")] = None + composite_tax_agency_xref: Annotated[str | None, Field(alias="compositeTaxAgencyXref")] = None + composite_tax_rate: Annotated[float | None, Field(alias="compositeTaxRate")] = None + composite_tax_xref: Annotated[str | None, Field(alias="compositeTaxXref")] = None contact: ContactReference | None = None + country_tax_agency_xref: Annotated[str | None, Field(alias="countryTaxAgencyXref")] = None + country_tax_rate: Annotated[float | None, Field(alias="countryTaxRate")] = None + country_tax_xref: Annotated[str | None, Field(alias="countryTaxXref")] = None + county_tax_agency_xref: Annotated[str | None, Field(alias="countyTaxAgencyXref")] = None + county_tax_rate: Annotated[float | None, Field(alias="countyTaxRate")] = None + county_tax_xref: Annotated[str | None, Field(alias="countyTaxXref")] = None + currency: CurrencyReference | None = None + due_days: Annotated[int | None, Field(alias="dueDays")] = None site: SiteReference | None = None - account_number: str | None = Field(default=None, alias="accountNumber") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - billing_terms_xref: str | None = Field(default=None, alias="billingTermsXref") - due_days: int | None = Field(default=None, alias="dueDays") + state_tax_agency_xref: Annotated[str | None, Field(alias="stateTaxAgencyXref")] = None + state_tax_rate: Annotated[float | None, Field(alias="stateTaxRate")] = None + state_tax_xref: Annotated[str | None, Field(alias="stateTaxXref")] = None + tax_agency_xref: Annotated[str | None, Field(alias="taxAgencyXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_group_rate: Annotated[float | None, Field(alias="taxGroupRate")] = None + tax_levels: Annotated[list[GLExportCustomerTaxLevel] | None, Field(alias="taxLevels")] = None taxable: bool | None = None - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - currency: CurrencyReference | None = None - state_tax_xref: str | None = Field(default=None, alias="stateTaxXref") - county_tax_xref: str | None = Field(default=None, alias="countyTaxXref") - city_tax_xref: str | None = Field(default=None, alias="cityTaxXref") - country_tax_xref: str | None = Field(default=None, alias="countryTaxXref") - composite_tax_xref: str | None = Field(default=None, alias="compositeTaxXref") - state_tax_rate: float | None = Field(default=None, alias="stateTaxRate") - county_tax_rate: float | None = Field(default=None, alias="countyTaxRate") - city_tax_rate: float | None = Field(default=None, alias="cityTaxRate") - country_tax_rate: float | None = Field(default=None, alias="countryTaxRate") - composite_tax_rate: float | None = Field(default=None, alias="compositeTaxRate") - tax_group_rate: float | None = Field(default=None, alias="taxGroupRate") - tax_agency_xref: str | None = Field(default=None, alias="taxAgencyXref") - state_tax_agency_xref: str | None = Field(default=None, alias="stateTaxAgencyXref") - county_tax_agency_xref: str | None = Field( - default=None, alias="countyTaxAgencyXref" - ) - city_tax_agency_xref: str | None = Field(default=None, alias="cityTaxAgencyXref") - country_tax_agency_xref: str | None = Field( - default=None, alias="countryTaxAgencyXref" - ) - composite_tax_agency_xref: str | None = Field( - default=None, alias="compositeTaxAgencyXref" - ) - tax_levels: list[GLExportCustomerTaxLevel] | None = Field( - default=None, alias="taxLevels" - ) class GLExportExpenseBill(ConnectWiseModel): + ap_account_number: Annotated[str | None, Field(alias="apAccountNumber")] = None + currency: CurrencyReference | None = None + detail: list[GLExportExpenseBillDetail] | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_number: Annotated[str | None, Field(alias="documentNumber")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None id: int | None = None - document_date: str | None = Field(default=None, alias="documentDate") - document_type: str | None = Field(default=None, alias="documentType") - document_number: str | None = Field(default=None, alias="documentNumber") - memo: str | None = None - gl_class: str | None = Field(default=None, alias="glClass") - ap_account_number: str | None = Field(default=None, alias="apAccountNumber") member: MemberReference | None = None - vendor_number: str | None = Field(default=None, alias="vendorNumber") - currency: CurrencyReference | None = None + memo: str | None = None total: float | None = None - detail: list[GLExportExpenseBillDetail] | None = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None class GLExportExpenseOffset(ConnectWiseModel): + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + description: str | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None id: int | None = None - document_date: str | None = Field(default=None, alias="documentDate") - document_type: str | None = Field(default=None, alias="documentType") - account_number: str | None = Field(default=None, alias="accountNumber") - gl_type_id: str | None = Field(default=None, alias="glTypeId") - gl_class: str | None = Field(default=None, alias="glClass") member: MemberReference | None = None memo: str | None = None - description: str | None = None total: float | None = None class GLExportInventoryTransfer(ConnectWiseModel): - id: str | None = None - document_type: str | None = Field(default=None, alias="documentType") - document_date: str | None = Field(default=None, alias="documentDate") - account_number: str | None = Field(default=None, alias="accountNumber") - gl_class: str | None = Field(default=None, alias="glClass") - gl_type_id: str | None = Field(default=None, alias="glTypeId") + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + bin: WarehouseBinReference | None = None + cogs_xref: Annotated[str | None, Field(alias="cogsXref")] = None + cost: float | None = None + cost_account_number: Annotated[str | None, Field(alias="costAccountNumber")] = None + currency: CurrencyReference | None = None description: str | None = None - sales_code: str | None = Field(default=None, alias="salesCode") - memo: str | None = None - cost_account_number: str | None = Field(default=None, alias="costAccountNumber") - inventory_account_number: str | None = Field( - default=None, alias="inventoryAccountNumber" - ) - transfer_id: int | None = Field(default=None, alias="transferId") + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_item_id: Annotated[str | None, Field(alias="glItemId")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None + id: str | None = None + inventory_account_number: Annotated[str | None, Field(alias="inventoryAccountNumber")] = None + inventory_xref: Annotated[str | None, Field(alias="inventoryXref")] = None item: IvItemReference | None = None - gl_item_id: str | None = Field(default=None, alias="glItemId") - sales_description: str | None = Field(default=None, alias="salesDescription") - item_description: str | None = Field(default=None, alias="itemDescription") - currency: CurrencyReference | None = None - item_price: float | None = Field(default=None, alias="itemPrice") - taxable: bool | None = None - unit_of_measure: UnitOfMeasureReference | None = Field( - default=None, alias="unitOfMeasure" - ) + item_description: Annotated[str | None, Field(alias="itemDescription")] = None + item_price: Annotated[float | None, Field(alias="itemPrice")] = None + item_type_xref: Annotated[str | None, Field(alias="itemTypeXref")] = None + location_xref: Annotated[str | None, Field(alias="locationXref")] = None + memo: str | None = None + offset: GLExportInventoryTransferOffset | None = None + price_level_xref: Annotated[str | None, Field(alias="priceLevelXref")] = None quantity: float | None = None - cost: float | None = None + sales_code: Annotated[str | None, Field(alias="salesCode")] = None + sales_description: Annotated[str | None, Field(alias="salesDescription")] = None + serial_numbers: Annotated[str | None, Field(alias="serialNumbers")] = None + serialized_flag: Annotated[bool | None, Field(alias="serializedFlag")] = None + sub_category: Annotated[ProductSubCategoryReference | None, Field(alias="subCategory")] = None + tax_note: Annotated[str | None, Field(alias="taxNote")] = None + taxable: bool | None = None total: float | None = None - sub_category: ProductSubCategoryReference | None = Field( - default=None, alias="subCategory" - ) - serialized_flag: bool | None = Field(default=None, alias="serializedFlag") - serial_numbers: str | None = Field(default=None, alias="serialNumbers") - bin: WarehouseBinReference | None = None + transfer_from_bin: Annotated[WarehouseBinReference | None, Field(alias="transferFromBin")] = None + transfer_from_location_xref: Annotated[str | None, Field(alias="transferFromLocationXref")] = None + transfer_id: Annotated[int | None, Field(alias="transferId")] = None + transfer_to_bin: Annotated[WarehouseBinReference | None, Field(alias="transferToBin")] = None + transfer_to_location_xref: Annotated[str | None, Field(alias="transferToLocationXref")] = None + unit_of_measure: Annotated[UnitOfMeasureReference | None, Field(alias="unitOfMeasure")] = None + uom_schedule_xref: Annotated[str | None, Field(alias="uomScheduleXref")] = None warehouse: WarehouseReference | None = None - transfer_from_bin: WarehouseBinReference | None = Field( - default=None, alias="transferFromBin" - ) - transfer_from_location_xref: str | None = Field( - default=None, alias="transferFromLocationXref" - ) - transfer_to_bin: WarehouseBinReference | None = Field( - default=None, alias="transferToBin" - ) - transfer_to_location_xref: str | None = Field( - default=None, alias="transferToLocationXref" - ) - location_xref: str | None = Field(default=None, alias="locationXref") - price_level_xref: str | None = Field(default=None, alias="priceLevelXref") - uom_schedule_xref: str | None = Field(default=None, alias="uomScheduleXref") - item_type_xref: str | None = Field(default=None, alias="itemTypeXref") - inventory_xref: str | None = Field(default=None, alias="inventoryXref") - cogs_xref: str | None = Field(default=None, alias="cogsXref") - tax_note: str | None = Field(default=None, alias="taxNote") - offset: GLExportInventoryTransferOffset | None = None class GLExportPurchaseTransactionDetail(ConnectWiseModel): - id: int | None = None - document_date: str | None = Field(default=None, alias="documentDate") - gl_class: str | None = Field(default=None, alias="glClass") - gl_type_id: str | None = Field(default=None, alias="glTypeId") - gl_item_id: str | None = Field(default=None, alias="glItemId") - sales_code: str | None = Field(default=None, alias="salesCode") - description: str | None = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + cogs_xref: Annotated[str | None, Field(alias="cogsXref")] = None cost: float | None = None - memo: str | None = None - tax_note: str | None = Field(default=None, alias="taxNote") - vendor_number: str | None = Field(default=None, alias="vendorNumber") - account_number: str | None = Field(default=None, alias="accountNumber") - cost_account_number: str | None = Field(default=None, alias="costAccountNumber") - inventory_account_number: str | None = Field( - default=None, alias="inventoryAccountNumber" - ) - vendor_account_number: str | None = Field(default=None, alias="vendorAccountNumber") + cost_account_number: Annotated[str | None, Field(alias="costAccountNumber")] = None + currency: CurrencyReference | None = None + description: str | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + drop_shipped_flag: Annotated[bool | None, Field(alias="dropShippedFlag")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_item_id: Annotated[str | None, Field(alias="glItemId")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None + id: int | None = None + inventory_account_number: Annotated[str | None, Field(alias="inventoryAccountNumber")] = None + inventory_xref: Annotated[str | None, Field(alias="inventoryXref")] = None item: IvItemReference | None = None - item_description: str | None = Field(default=None, alias="itemDescription") - sales_description: str | None = Field(default=None, alias="salesDescription") - taxable: bool | None = None - item_price: float | None = Field(default=None, alias="itemPrice") - item_cost: float | None = Field(default=None, alias="itemCost") - unit_of_measure: UnitOfMeasureReference | None = Field( - default=None, alias="unitOfMeasure" - ) + item_cost: Annotated[float | None, Field(alias="itemCost")] = None + item_description: Annotated[str | None, Field(alias="itemDescription")] = None + item_price: Annotated[float | None, Field(alias="itemPrice")] = None + item_type_xref: Annotated[str | None, Field(alias="itemTypeXref")] = None + line_number: Annotated[int | None, Field(alias="lineNumber")] = None + location_xref: Annotated[str | None, Field(alias="locationXref")] = None + memo: str | None = None + price_level_xref: Annotated[str | None, Field(alias="priceLevelXref")] = None + purchase_header_tax_group: Annotated[str | None, Field(alias="purchaseHeaderTaxGroup")] = None quantity: float | None = None + sales_code: Annotated[str | None, Field(alias="salesCode")] = None + sales_description: Annotated[str | None, Field(alias="salesDescription")] = None + serial_numbers: Annotated[str | None, Field(alias="serialNumbers")] = None + serialized_flag: Annotated[bool | None, Field(alias="serializedFlag")] = None + shipment_method: Annotated[ShipmentMethodReference | None, Field(alias="shipmentMethod")] = None + sub_category: Annotated[ProductSubCategoryReference | None, Field(alias="subCategory")] = None + tax_agency_xref: Annotated[str | None, Field(alias="taxAgencyXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_code_xref: Annotated[str | None, Field(alias="taxCodeXref")] = None + tax_note: Annotated[str | None, Field(alias="taxNote")] = None + tax_rate: Annotated[float | None, Field(alias="taxRate")] = None + taxable: bool | None = None total: float | None = None - currency: CurrencyReference | None = None - serialized_flag: bool | None = Field(default=None, alias="serializedFlag") - serial_numbers: str | None = Field(default=None, alias="serialNumbers") - drop_shipped_flag: bool | None = Field(default=None, alias="dropShippedFlag") - line_number: int | None = Field(default=None, alias="lineNumber") - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - warehouse_site: SiteReference | None = Field(default=None, alias="warehouseSite") - sub_category: ProductSubCategoryReference | None = Field( - default=None, alias="subCategory" - ) - shipment_method: ShipmentMethodReference | None = Field( - default=None, alias="shipmentMethod" - ) - item_type_xref: str | None = Field(default=None, alias="itemTypeXref") - inventory_xref: str | None = Field(default=None, alias="inventoryXref") - cogs_xref: str | None = Field(default=None, alias="cogsXref") - uom_schedule_xref: str | None = Field(default=None, alias="uomScheduleXref") - price_level_xref: str | None = Field(default=None, alias="priceLevelXref") - location_xref: str | None = Field(default=None, alias="locationXref") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - purchase_header_tax_group: str | None = Field( - default=None, alias="purchaseHeaderTaxGroup" - ) - tax_code_xref: str | None = Field(default=None, alias="taxCodeXref") - tax_rate: float | None = Field(default=None, alias="taxRate") - tax_agency_xref: str | None = Field(default=None, alias="taxAgencyXref") + unit_of_measure: Annotated[UnitOfMeasureReference | None, Field(alias="unitOfMeasure")] = None + uom_schedule_xref: Annotated[str | None, Field(alias="uomScheduleXref")] = None + vendor_account_number: Annotated[str | None, Field(alias="vendorAccountNumber")] = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None + warehouse_site: Annotated[SiteReference | None, Field(alias="warehouseSite")] = None class GLExportPurchaseTransactionDetailTax(ConnectWiseModel): - id: int | None = None - document_date: str | None = Field(default=None, alias="documentDate") - account_number: str | None = Field(default=None, alias="accountNumber") - gl_class: str | None = Field(default=None, alias="glClass") + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + cogs_xref: Annotated[str | None, Field(alias="cogsXref")] = None cost: float | None = None - sales_code: str | None = Field(default=None, alias="salesCode") - gl_type_id: str | None = Field(default=None, alias="glTypeId") - gl_item_id: str | None = Field(default=None, alias="glItemId") - memo: str | None = None - vendor_number: str | None = Field(default=None, alias="vendorNumber") - vendor_account_number: str | None = Field(default=None, alias="vendorAccountNumber") - cost_account_number: str | None = Field(default=None, alias="costAccountNumber") - inventory_account_number: str | None = Field( - default=None, alias="inventoryAccountNumber" - ) - item_type_xref: str | None = Field(default=None, alias="itemTypeXref") - inventory_xref: str | None = Field(default=None, alias="inventoryXref") - cogs_xref: str | None = Field(default=None, alias="cogsXref") - uom_schedule_xref: str | None = Field(default=None, alias="uomScheduleXref") - price_level_xref: str | None = Field(default=None, alias="priceLevelXref") - location_xref: str | None = Field(default=None, alias="locationXref") + cost_account_number: Annotated[str | None, Field(alias="costAccountNumber")] = None + currency: CurrencyReference | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + drop_shipped_flag: Annotated[bool | None, Field(alias="dropShippedFlag")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_item_id: Annotated[str | None, Field(alias="glItemId")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None + id: int | None = None + inventory_account_number: Annotated[str | None, Field(alias="inventoryAccountNumber")] = None + inventory_xref: Annotated[str | None, Field(alias="inventoryXref")] = None item: IvItemReference | None = None - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - sales_description: str | None = Field(default=None, alias="salesDescription") - item_description: str | None = Field(default=None, alias="itemDescription") - item_price: float | None = Field(default=None, alias="itemPrice") - item_cost: float | None = Field(default=None, alias="itemCost") - unit_of_measure: UnitOfMeasureReference | None = Field( - default=None, alias="unitOfMeasure" - ) + item_cost: Annotated[float | None, Field(alias="itemCost")] = None + item_description: Annotated[str | None, Field(alias="itemDescription")] = None + item_price: Annotated[float | None, Field(alias="itemPrice")] = None + item_type_xref: Annotated[str | None, Field(alias="itemTypeXref")] = None + line_number: Annotated[int | None, Field(alias="lineNumber")] = None + location_xref: Annotated[str | None, Field(alias="locationXref")] = None + memo: str | None = None + price_level_xref: Annotated[str | None, Field(alias="priceLevelXref")] = None + purchase_header_tax_group: Annotated[str | None, Field(alias="purchaseHeaderTaxGroup")] = None quantity: float | None = None + sales_code: Annotated[str | None, Field(alias="salesCode")] = None + sales_description: Annotated[str | None, Field(alias="salesDescription")] = None + serial_numbers: Annotated[str | None, Field(alias="serialNumbers")] = None + serialized_flag: Annotated[bool | None, Field(alias="serializedFlag")] = None + shipment_method: Annotated[ShipmentMethodReference | None, Field(alias="shipmentMethod")] = None + sub_category: Annotated[ProductSubCategoryReference | None, Field(alias="subCategory")] = None + tax_agency_xref: Annotated[str | None, Field(alias="taxAgencyXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_note: Annotated[str | None, Field(alias="taxNote")] = None + tax_rate: Annotated[float | None, Field(alias="taxRate")] = None + tax_rate_percent: Annotated[float | None, Field(alias="taxRatePercent")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None total: float | None = None - currency: CurrencyReference | None = None - serialized_flag: bool | None = Field(default=None, alias="serializedFlag") - serial_numbers: str | None = Field(default=None, alias="serialNumbers") - drop_shipped_flag: bool | None = Field(default=None, alias="dropShippedFlag") - line_number: int | None = Field(default=None, alias="lineNumber") - warehouse_site: SiteReference | None = Field(default=None, alias="warehouseSite") - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - shipment_method: ShipmentMethodReference | None = Field( - default=None, alias="shipmentMethod" - ) - sub_category: ProductSubCategoryReference | None = Field( - default=None, alias="subCategory" - ) - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - tax_rate: float | None = Field(default=None, alias="taxRate") - tax_rate_percent: float | None = Field(default=None, alias="taxRatePercent") - tax_agency_xref: str | None = Field(default=None, alias="taxAgencyXref") - tax_note: str | None = Field(default=None, alias="taxNote") - purchase_header_tax_group: str | None = Field( - default=None, alias="purchaseHeaderTaxGroup" - ) + unit_of_measure: Annotated[UnitOfMeasureReference | None, Field(alias="unitOfMeasure")] = None + uom_schedule_xref: Annotated[str | None, Field(alias="uomScheduleXref")] = None + vendor_account_number: Annotated[str | None, Field(alias="vendorAccountNumber")] = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None + warehouse_site: Annotated[SiteReference | None, Field(alias="warehouseSite")] = None class GLExportTransactionDetail(ConnectWiseModel): - id: int | None = None - document_date: str | None = Field(default=None, alias="documentDate") - document_type: str | None = Field(default=None, alias="documentType") - account_number: str | None = Field(default=None, alias="accountNumber") - gl_class: str | None = Field(default=None, alias="glClass") - gl_type_id: str | None = Field(default=None, alias="glTypeId") - gl_item_id: str | None = Field(default=None, alias="glItemId") - invoice_summary_option: str | None = Field( - default=None, alias="invoiceSummaryOption" - ) + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + cogs_xref: Annotated[str | None, Field(alias="cogsXref")] = None cost: float | None = None - sales_code: str | None = Field(default=None, alias="salesCode") - memo: str | None = None - description: str | None = None - quantity: float | None = None - total: float | None = None + cost_account_number: Annotated[str | None, Field(alias="costAccountNumber")] = None currency: CurrencyReference | None = None - time_entry: TimeEntryReference | None = Field(default=None, alias="timeEntry") - cost_account_number: str | None = Field(default=None, alias="costAccountNumber") - inventory_account_number: str | None = Field( - default=None, alias="inventoryAccountNumber" - ) - product_account_number: str | None = Field( - default=None, alias="productAccountNumber" - ) - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - tax_code_xref: str | None = Field(default=None, alias="taxCodeXref") - tax_agency_xref: str | None = Field(default=None, alias="taxAgencyXref") - tax_note: str | None = Field(default=None, alias="taxNote") - tax_rate: float | None = Field(default=None, alias="taxRate") - tax_rate_percent: float | None = Field(default=None, alias="taxRatePercent") - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - taxable2_flag: bool | None = Field(default=None, alias="taxable2Flag") - taxable3_flag: bool | None = Field(default=None, alias="taxable3Flag") - taxable4_flag: bool | None = Field(default=None, alias="taxable4Flag") - taxable5_flag: bool | None = Field(default=None, alias="taxable5Flag") + description: str | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + drop_shipped_flag: Annotated[bool | None, Field(alias="dropShippedFlag")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_item_id: Annotated[str | None, Field(alias="glItemId")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None + id: int | None = None + inventory_account_number: Annotated[str | None, Field(alias="inventoryAccountNumber")] = None + inventory_xref: Annotated[str | None, Field(alias="inventoryXref")] = None + invoice_summary_option: Annotated[str | None, Field(alias="invoiceSummaryOption")] = None item: IvItemReference | None = None + item_cost: Annotated[float | None, Field(alias="itemCost")] = None + item_description: Annotated[str | None, Field(alias="itemDescription")] = None + item_price: Annotated[float | None, Field(alias="itemPrice")] = None + item_taxable_flag: Annotated[bool | None, Field(alias="itemTaxableFlag")] = None + item_type_xref: Annotated[str | None, Field(alias="itemTypeXref")] = None + location_xref: Annotated[str | None, Field(alias="locationXref")] = None + memo: str | None = None + price_level_xref: Annotated[str | None, Field(alias="priceLevelXref")] = None product: ProductReference | None = None - item_taxable_flag: bool | None = Field(default=None, alias="itemTaxableFlag") - item_price: float | None = Field(default=None, alias="itemPrice") - item_cost: float | None = Field(default=None, alias="itemCost") - item_description: str | None = Field(default=None, alias="itemDescription") - sales_description: str | None = Field(default=None, alias="salesDescription") - unit_of_measure: UnitOfMeasureReference | None = Field( - default=None, alias="unitOfMeasure" - ) - sub_category: ProductSubCategoryReference | None = Field( - default=None, alias="subCategory" - ) - serialized_flag: bool | None = Field(default=None, alias="serializedFlag") - serial_numbers: str | None = Field(default=None, alias="serialNumbers") - warehouse_site: SiteReference | None = Field(default=None, alias="warehouseSite") - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - shipment_method: ShipmentMethodReference | None = Field( - default=None, alias="shipmentMethod" - ) - drop_shipped_flag: bool | None = Field(default=None, alias="dropShippedFlag") - item_type_xref: str | None = Field(default=None, alias="itemTypeXref") - inventory_xref: str | None = Field(default=None, alias="inventoryXref") - cogs_xref: str | None = Field(default=None, alias="cogsXref") - uom_schedule_xref: str | None = Field(default=None, alias="uomScheduleXref") - price_level_xref: str | None = Field(default=None, alias="priceLevelXref") - location_xref: str | None = Field(default=None, alias="locationXref") - tax_levels: list[GLExportTransactionDetailTaxLevel] | None = Field( - default=None, alias="taxLevels" - ) + product_account_number: Annotated[str | None, Field(alias="productAccountNumber")] = None + quantity: float | None = None + sales_code: Annotated[str | None, Field(alias="salesCode")] = None + sales_description: Annotated[str | None, Field(alias="salesDescription")] = None + serial_numbers: Annotated[str | None, Field(alias="serialNumbers")] = None + serialized_flag: Annotated[bool | None, Field(alias="serializedFlag")] = None + shipment_method: Annotated[ShipmentMethodReference | None, Field(alias="shipmentMethod")] = None + sub_category: Annotated[ProductSubCategoryReference | None, Field(alias="subCategory")] = None + tax_agency_xref: Annotated[str | None, Field(alias="taxAgencyXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_code_xref: Annotated[str | None, Field(alias="taxCodeXref")] = None + tax_levels: Annotated[list[GLExportTransactionDetailTaxLevel] | None, Field(alias="taxLevels")] = None + tax_note: Annotated[str | None, Field(alias="taxNote")] = None + tax_rate: Annotated[float | None, Field(alias="taxRate")] = None + tax_rate_percent: Annotated[float | None, Field(alias="taxRatePercent")] = None + taxable2_flag: Annotated[bool | None, Field(alias="taxable2Flag")] = None + taxable3_flag: Annotated[bool | None, Field(alias="taxable3Flag")] = None + taxable4_flag: Annotated[bool | None, Field(alias="taxable4Flag")] = None + taxable5_flag: Annotated[bool | None, Field(alias="taxable5Flag")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None + time_entry: Annotated[TimeEntryReference | None, Field(alias="timeEntry")] = None + total: float | None = None + unit_of_measure: Annotated[UnitOfMeasureReference | None, Field(alias="unitOfMeasure")] = None + uom_schedule_xref: Annotated[str | None, Field(alias="uomScheduleXref")] = None + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None + warehouse_site: Annotated[SiteReference | None, Field(alias="warehouseSite")] = None class GLExportVendor(ConnectWiseModel): - member: MemberReference | None = None - vendor: CompanyReference | None = None - vendor_number: str | None = Field(default=None, alias="vendorNumber") + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None company: CompanyReference | None = None contact: ContactReference | None = None - account_number: str | None = Field(default=None, alias="accountNumber") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - due_days: int | None = Field(default=None, alias="dueDays") + due_days: Annotated[int | None, Field(alias="dueDays")] = None + member: MemberReference | None = None site: SiteReference | None = None - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + vendor: CompanyReference | None = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None class GLPath(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + database_name: Annotated[str | None, Field(alias="databaseName")] = None + """ + Max length: 100; + """ id: int | None = None + last_payment_sync: Annotated[datetime | None, Field(alias="lastPaymentSync")] = None + last_payment_sync_by: Annotated[MemberReference | None, Field(alias="lastPaymentSyncBy")] = None location: SystemLocationReference | None = None path: str | None = None """ Max length: 255; """ - sql_server_name: str | None = Field(default=None, alias="sqlServerName") + sql_server_name: Annotated[str | None, Field(alias="sqlServerName")] = None """ Max length: 255; """ - database_name: str | None = Field(default=None, alias="databaseName") - """ - Max length: 100; - """ - last_payment_sync: datetime | None = Field(default=None, alias="lastPaymentSync") - last_payment_sync_by: MemberReference | None = Field( - default=None, alias="lastPaymentSyncBy" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class GraphUserCsv(ConnectWiseModel): - id: str | None = None - display_name: str | None = Field(default=None, alias="displayName") - principal_name: str | None = Field(default=None, alias="principalName") - country: str | None = None - state: str | None = None - city: str | None = None - department: str | None = None - first_name: str | None = Field(default=None, alias="firstName") - last_name: str | None = Field(default=None, alias="lastName") - address: str | None = None - postal_code: str | None = Field(default=None, alias="postalCode") - mail: str | None = None - is_matched_contact: bool | None = Field(default=None, alias="isMatchedContact") - account_enabled: bool | None = Field(default=None, alias="accountEnabled") - manage_contact_rec_id: int | None = Field(default=None, alias="manageContactRecId") - manage_contact_name: str | None = Field(default=None, alias="manageContactName") - job_title: str | None = Field(default=None, alias="jobTitle") - proxy_addresses: list[str] | None = Field(default=None, alias="proxyAddresses") - nick_name: str | None = Field(default=None, alias="nickName") - manager: Manager | None = None - employee_type: str | None = Field(default=None, alias="employeeType") class Holiday(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_day_flag: Annotated[bool | None, Field(alias="allDayFlag")] = None + """ + Can be set to false to set a holiday for specific hours (Defaults to True) + """ + date: date + holiday_list: Annotated[HolidayListReference | None, Field(alias="holidayList")] = None id: int | None = None name: str """ Max length: 50; """ - all_day_flag: bool | None = Field(default=None, alias="allDayFlag") - """ - Can be set to false to set a holiday for specific hours (Defaults to True). - """ - date: date - time_start: str | None = Field(default=None, alias="timeStart") - time_end: str | None = Field(default=None, alias="timeEnd") - holiday_list: HolidayListReference | None = Field(default=None, alias="holidayList") - info: dict[str, str] | None = Field(default=None, alias="_info") + time_end: Annotated[datetime | None, Field(alias="timeEnd")] = None + time_start: Annotated[datetime | None, Field(alias="timeStart")] = None class HolidayInfo(ConnectWiseModel): - id: int | None = None - name: str | None = None - all_day_flag: bool | None = Field(default=None, alias="allDayFlag") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_day_flag: Annotated[bool | None, Field(alias="allDayFlag")] = None """ - Can be set to false to set a holiday for specific hours (Defaults to True). + Can be set to false to set a holiday for specific hours (Defaults to True) """ date: str | None = None - time_start: str | None = Field(default=None, alias="timeStart") - time_end: str | None = Field(default=None, alias="timeEnd") - holiday_list: HolidayListReference | None = Field(default=None, alias="holidayList") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class Info(ConnectWiseModel): - version: str | None = None - is_cloud: bool | None = Field(default=None, alias="isCloud") - server_time_zone: str | None = Field(default=None, alias="serverTimeZone") - license_bits: list[LicenseBit] | None = Field(default=None, alias="licenseBits") - cloud_region: str | None = Field(default=None, alias="cloudRegion") + holiday_list: Annotated[HolidayListReference | None, Field(alias="holidayList")] = None + id: int | None = None + name: str | None = None + time_end: Annotated[datetime | None, Field(alias="timeEnd")] = None + time_start: Annotated[datetime | None, Field(alias="timeStart")] = None class InOutBoard(ConnectWiseModel): - id: int | None = None - member: MemberReference | None = None - in_out_type: InOutTypeReference | None = Field(default=None, alias="inOutType") - additional_info: str | None = Field(default=None, alias="additionalInfo") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + additional_info: Annotated[str | None, Field(alias="additionalInfo")] = None """ Max length: 100; """ - date_back: datetime = Field(..., alias="dateBack") - info: dict[str, str] | None = Field(default=None, alias="_info") + date_back: Annotated[datetime, Field(alias="dateBack")] + id: int | None = None + in_out_type: Annotated[InOutTypeReference | None, Field(alias="inOutType")] = None + member: MemberReference | None = None + + +class Info(ConnectWiseModel): + cloud_region: Annotated[str | None, Field(alias="cloudRegion")] = None + is_cloud: Annotated[bool | None, Field(alias="isCloud")] = None + license_bits: Annotated[list[LicenseBit] | None, Field(alias="licenseBits")] = None + server_time_zone: Annotated[str | None, Field(alias="serverTimeZone")] = None + version: str | None = None class IntegratorLogin(ConnectWiseModel): - id: int | None = None - username: str - """ - Max length: 50; + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + activity_api_flag: Annotated[bool | None, Field(alias="activityApiFlag")] = None + activity_callback_url: Annotated[str | None, Field(alias="activityCallbackUrl")] = None """ - password: str | None = None - """ - The password will never be returned in response. Max length: 50; + Max length: 1000; """ - can_access_all_records_flag: bool | None = Field( - default=None, alias="canAccessAllRecordsFlag" - ) + activity_legacy_callback_flag: Annotated[bool | None, Field(alias="activityLegacyCallbackFlag")] = None + agreement_api_flag: Annotated[bool | None, Field(alias="agreementApiFlag")] = None + agreement_callback_legacy_flag: Annotated[bool | None, Field(alias="agreementCallbackLegacyFlag")] = None + agreement_callback_url: Annotated[str | None, Field(alias="agreementCallbackUrl")] = None """ - This flag controls whether the integrator can access only the db records it created, or all system records. + Max length: 1000; """ - can_access_all_apis_flag: bool | None = Field( - default=None, alias="canAccessAllApisFlag" - ) + board: BoardReference | None = None + can_access_all_apis_flag: Annotated[bool | None, Field(alias="canAccessAllApisFlag")] = None """ Setting this flag to true will create an integrator that can access all of the available apis in the system. If this field is set to true, both the member and board fields are required. """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - date_inactivated: datetime | None = Field(default=None, alias="dateInactivated") - inactivated_by: MemberReference | None = Field(default=None, alias="inactivatedBy") - service_ticket_api_flag: bool | None = Field( - default=None, alias="serviceTicketApiFlag" - ) - board: BoardReference | None = None - service_board_callback_url: str | None = Field( - default=None, alias="serviceBoardCallbackUrl" - ) + can_access_all_records_flag: Annotated[bool | None, Field(alias="canAccessAllRecordsFlag")] = None + """ + This flag controls whether the integrator can access only the db records it created, or all system records + """ + company_api_flag: Annotated[bool | None, Field(alias="companyApiFlag")] = None + company_callback_url: Annotated[str | None, Field(alias="companyCallbackUrl")] = None """ Max length: 1000; """ - service_board_legacy_callback_flag: bool | None = Field( - default=None, alias="serviceBoardLegacyCallbackFlag" - ) - time_entry_api_flag: bool | None = Field(default=None, alias="timeEntryApiFlag") - member: MemberReference | None = None - time_entry_callback_url: str | None = Field( - default=None, alias="timeEntryCallbackUrl" - ) + company_legacy_callback_flag: Annotated[bool | None, Field(alias="companyLegacyCallbackFlag")] = None + configuration_api_flag: Annotated[bool | None, Field(alias="configurationApiFlag")] = None + configuration_auto_child_flag: Annotated[bool | None, Field(alias="configurationAutoChildFlag")] = None + configuration_callback_url: Annotated[str | None, Field(alias="configurationCallbackUrl")] = None """ Max length: 1000; """ - time_entry_legacy_callback_flag: bool | None = Field( - default=None, alias="timeEntryLegacyCallbackFlag" - ) - managed_services_api_flag: bool | None = Field( - default=None, alias="managedServicesApiFlag" - ) - managed_services_auto_child_flag: bool | None = Field( - default=None, alias="managedServicesAutoChildFlag" - ) - managed_services_childing_flag: bool | None = Field( - default=None, alias="managedServicesChildingFlag" - ) + configuration_childling_flag: Annotated[bool | None, Field(alias="configurationChildlingFlag")] = None """ - True if integrator is allowed to child configurations. + True if integrator is allowed to child configurations """ - contact_api_flag: bool | None = Field(default=None, alias="contactApiFlag") - contact_callback_url: str | None = Field(default=None, alias="contactCallbackUrl") + configuration_legacy_callback_flag: Annotated[bool | None, Field(alias="configurationLegacyCallbackFlag")] = None + contact_api_flag: Annotated[bool | None, Field(alias="contactApiFlag")] = None + contact_callback_url: Annotated[str | None, Field(alias="contactCallbackUrl")] = None """ Max length: 1000; """ - contact_legacy_callback_flag: bool | None = Field( - default=None, alias="contactLegacyCallbackFlag" - ) - company_api_flag: bool | None = Field(default=None, alias="companyApiFlag") - company_callback_url: str | None = Field(default=None, alias="companyCallbackUrl") + contact_legacy_callback_flag: Annotated[bool | None, Field(alias="contactLegacyCallbackFlag")] = None + date_inactivated: Annotated[datetime | None, Field(alias="dateInactivated")] = None + document_api_flag: Annotated[bool | None, Field(alias="documentApiFlag")] = None + id: int | None = None + inactivated_by: Annotated[MemberReference | None, Field(alias="inactivatedBy")] = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + invoice_api_flag: Annotated[bool | None, Field(alias="invoiceApiFlag")] = None + managed_services_api_flag: Annotated[bool | None, Field(alias="managedServicesApiFlag")] = None + managed_services_auto_child_flag: Annotated[bool | None, Field(alias="managedServicesAutoChildFlag")] = None + managed_services_childing_flag: Annotated[bool | None, Field(alias="managedServicesChildingFlag")] = None """ - Max length: 1000; + True if integrator is allowed to child configurations """ - company_legacy_callback_flag: bool | None = Field( - default=None, alias="companyLegacyCallbackFlag" - ) - activity_api_flag: bool | None = Field(default=None, alias="activityApiFlag") - activity_callback_url: str | None = Field(default=None, alias="activityCallbackUrl") + marketing_api_flag: Annotated[bool | None, Field(alias="marketingApiFlag")] = None + member: MemberReference | None = None + member_api_flag: Annotated[bool | None, Field(alias="memberApiFlag")] = None + opportunity_api_flag: Annotated[bool | None, Field(alias="opportunityApiFlag")] = None + opportunity_callback_url: Annotated[str | None, Field(alias="opportunityCallbackUrl")] = None """ Max length: 1000; """ - activity_legacy_callback_flag: bool | None = Field( - default=None, alias="activityLegacyCallbackFlag" - ) - invoice_api_flag: bool | None = Field(default=None, alias="invoiceApiFlag") - product_api_flag: bool | None = Field(default=None, alias="productApiFlag") - product_callback_url: str | None = Field(default=None, alias="productCallbackUrl") + opportunity_conversion_api_flag: Annotated[bool | None, Field(alias="opportunityConversionApiFlag")] = None """ - Max length: 1000; + True if the member has access to the Opportunity Conversion Api """ - product_legacy_callback_flag: bool | None = Field( - default=None, alias="productLegacyCallbackFlag" - ) - opportunity_api_flag: bool | None = Field(default=None, alias="opportunityApiFlag") - opportunity_callback_url: str | None = Field( - default=None, alias="opportunityCallbackUrl" - ) + opportunity_legacy_callback_flag: Annotated[bool | None, Field(alias="opportunityLegacyCallbackFlag")] = None + password: str | None = None """ - Max length: 1000; + The password will never be returned in response Max length: 50; """ - opportunity_legacy_callback_flag: bool | None = Field( - default=None, alias="opportunityLegacyCallbackFlag" - ) - opportunity_conversion_api_flag: bool | None = Field( - default=None, alias="opportunityConversionApiFlag" - ) + product_api_flag: Annotated[bool | None, Field(alias="productApiFlag")] = None + product_callback_url: Annotated[str | None, Field(alias="productCallbackUrl")] = None """ - True if the member has access to the Opportunity Conversion Api. + Max length: 1000; """ - member_api_flag: bool | None = Field(default=None, alias="memberApiFlag") - marketing_api_flag: bool | None = Field(default=None, alias="marketingApiFlag") - purchasing_api_flag: bool | None = Field(default=None, alias="purchasingApiFlag") - purchasing_callback_url: str | None = Field( - default=None, alias="purchasingCallbackUrl" - ) + product_legacy_callback_flag: Annotated[bool | None, Field(alias="productLegacyCallbackFlag")] = None + project_api_flag: Annotated[bool | None, Field(alias="projectApiFlag")] = None + project_callback_url: Annotated[str | None, Field(alias="projectCallbackUrl")] = None """ Max length: 1000; """ - purchasing_legacy_callback_flag: bool | None = Field( - default=None, alias="purchasingLegacyCallbackFlag" - ) - reporting_api_flag: bool | None = Field(default=None, alias="reportingApiFlag") - system_api_flag: bool | None = Field(default=None, alias="systemApiFlag") - project_api_flag: bool | None = Field(default=None, alias="projectApiFlag") - project_callback_url: str | None = Field(default=None, alias="projectCallbackUrl") + project_legacy_callback_flag: Annotated[bool | None, Field(alias="projectLegacyCallbackFlag")] = None + purchasing_api_flag: Annotated[bool | None, Field(alias="purchasingApiFlag")] = None + purchasing_callback_url: Annotated[str | None, Field(alias="purchasingCallbackUrl")] = None """ Max length: 1000; """ - project_legacy_callback_flag: bool | None = Field( - default=None, alias="projectLegacyCallbackFlag" - ) - configuration_api_flag: bool | None = Field( - default=None, alias="configurationApiFlag" - ) - configuration_auto_child_flag: bool | None = Field( - default=None, alias="configurationAutoChildFlag" - ) - configuration_childling_flag: bool | None = Field( - default=None, alias="configurationChildlingFlag" - ) - """ - True if integrator is allowed to child configurations. - """ - configuration_callback_url: str | None = Field( - default=None, alias="configurationCallbackUrl" - ) + purchasing_legacy_callback_flag: Annotated[bool | None, Field(alias="purchasingLegacyCallbackFlag")] = None + reporting_api_flag: Annotated[bool | None, Field(alias="reportingApiFlag")] = None + schedule_api_flag: Annotated[bool | None, Field(alias="scheduleApiFlag")] = None + schedule_callback_url: Annotated[str | None, Field(alias="scheduleCallbackUrl")] = None """ Max length: 1000; """ - configuration_legacy_callback_flag: bool | None = Field( - default=None, alias="configurationLegacyCallbackFlag" - ) - schedule_api_flag: bool | None = Field(default=None, alias="scheduleApiFlag") - schedule_callback_url: str | None = Field(default=None, alias="scheduleCallbackUrl") + schedule_legacy_callback_flag: Annotated[bool | None, Field(alias="scheduleLegacyCallbackFlag")] = None + service_board_callback_url: Annotated[str | None, Field(alias="serviceBoardCallbackUrl")] = None """ Max length: 1000; """ - schedule_legacy_callback_flag: bool | None = Field( - default=None, alias="scheduleLegacyCallbackFlag" - ) - agreement_api_flag: bool | None = Field(default=None, alias="agreementApiFlag") - agreement_callback_url: str | None = Field( - default=None, alias="agreementCallbackUrl" - ) + service_board_legacy_callback_flag: Annotated[bool | None, Field(alias="serviceBoardLegacyCallbackFlag")] = None + service_ticket_api_flag: Annotated[bool | None, Field(alias="serviceTicketApiFlag")] = None + system_api_flag: Annotated[bool | None, Field(alias="systemApiFlag")] = None + time_entry_api_flag: Annotated[bool | None, Field(alias="timeEntryApiFlag")] = None + time_entry_callback_url: Annotated[str | None, Field(alias="timeEntryCallbackUrl")] = None """ Max length: 1000; """ - agreement_callback_legacy_flag: bool | None = Field( - default=None, alias="agreementCallbackLegacyFlag" - ) - document_api_flag: bool | None = Field(default=None, alias="documentApiFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + time_entry_legacy_callback_flag: Annotated[bool | None, Field(alias="timeEntryLegacyCallbackFlag")] = None + username: str + """ + Max length: 50; + """ class InventoryOnHand(CatalogInventory): @@ -11551,314 +9442,239 @@ class InventoryOnHand(CatalogInventory): class Invoice(ConnectWiseModel): - id: int | None = None - invoice_number: str | None = Field(default=None, alias="invoiceNumber") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + add_to_batch_email_list: Annotated[bool | None, Field(alias="addToBatchEmailList")] = None + adjusted_by: Annotated[str | None, Field(alias="adjustedBy")] = None + adjustment_reason: Annotated[str | None, Field(alias="adjustmentReason")] = None + agreement: AgreementReference | None = None + agreement_amount: Annotated[float | None, Field(alias="agreementAmount")] = None + apply_to_id: Annotated[int | None, Field(alias="applyToId")] = None + apply_to_type: Annotated[ + Literal["All", "Agreement", "Project", "ProjectPhase", "SalesOrder", "Ticket"] | None, + Field(alias="applyToType"), + ] = None + attention: str | None = None """ - Max length: 15; Required On Updates; + Max length: 60; """ - type: Literal[ - "Agreement", - "CreditMemo", - "DownPayment", - "Miscellaneous", - "Progress", - "Standard", - ] - status: BillingStatusReference | None = None + balance: float | None = None + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + billing_setup_reference: Annotated[BillingSetupReference | None, Field(alias="billingSetupReference")] = None + billing_site: Annotated[SiteReference | None, Field(alias="billingSite")] = None + billing_site_address_line1: Annotated[str | None, Field(alias="billingSiteAddressLine1")] = None + billing_site_address_line2: Annotated[str | None, Field(alias="billingSiteAddressLine2")] = None + billing_site_city: Annotated[str | None, Field(alias="billingSiteCity")] = None + billing_site_country: Annotated[str | None, Field(alias="billingSiteCountry")] = None + billing_site_state: Annotated[str | None, Field(alias="billingSiteState")] = None + billing_site_zip: Annotated[str | None, Field(alias="billingSiteZip")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + bottom_comment: Annotated[str | None, Field(alias="bottomComment")] = None company: CompanyReference | None = None - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - account_number: str | None = Field(default=None, alias="accountNumber") - apply_to_type: Literal[ - "All", "Agreement", "Project", "ProjectPhase", "SalesOrder", "Ticket" - ] | None = Field(default=None, alias="applyToType") - apply_to_id: int | None = Field(default=None, alias="applyToId") - attention: str | None = None + credits: float | None = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_po: Annotated[str | None, Field(alias="customerPO")] = None """ - Max length: 60; + Max length: 50; """ - ship_to_attention: str | None = Field(default=None, alias="shipToAttention") + date: datetime | None = None + department_id: Annotated[int | None, Field(alias="departmentId")] = None """ - Max length: 60; + departmentId is only required for special invoices """ - billing_site: SiteReference | None = Field(default=None, alias="billingSite") - billing_site_address_line1: str | None = Field( - default=None, alias="billingSiteAddressLine1" - ) - billing_site_address_line2: str | None = Field( - default=None, alias="billingSiteAddressLine2" - ) - billing_site_city: str | None = Field(default=None, alias="billingSiteCity") - billing_site_state: str | None = Field(default=None, alias="billingSiteState") - billing_site_zip: str | None = Field(default=None, alias="billingSiteZip") - billing_site_country: str | None = Field(default=None, alias="billingSiteCountry") - shipping_site: SiteReference | None = Field(default=None, alias="shippingSite") - shipping_site_address_line1: str | None = Field( - default=None, alias="shippingSiteAddressLine1" - ) - shipping_site_address_line2: str | None = Field( - default=None, alias="shippingSiteAddressLine2" - ) - shipping_site_city: str | None = Field(default=None, alias="shippingSiteCity") - shipping_site_state: str | None = Field(default=None, alias="shippingSiteState") - shipping_site_zip: str | None = Field(default=None, alias="shippingSiteZip") - shipping_site_country: str | None = Field(default=None, alias="shippingSiteCountry") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - reference: str | None = None + downpayment_applied: Annotated[float | None, Field(alias="downpaymentApplied")] = None + downpayment_previously_taxed_flag: Annotated[bool | None, Field(alias="downpaymentPreviouslyTaxedFlag")] = None + due_date: Annotated[datetime | None, Field(alias="dueDate")] = None + email_template_id: Annotated[int | None, Field(alias="emailTemplateId")] = None """ - Max length: 50; + Can be obtained via InvoiceEmailTemplate report """ - customer_po: str | None = Field(default=None, alias="customerPO") + expense_total: Annotated[float | None, Field(alias="expenseTotal")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None + invoice_number: Annotated[str | None, Field(alias="invoiceNumber")] = None """ - Max length: 50; + Max length: 15; Required On Updates; """ - template_setup_id: int | None = Field(default=None, alias="templateSetupId") + invoice_template: Annotated[InvoiceTemplateDetailReference | None, Field(alias="invoiceTemplate")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None """ - Can be obtained via InvoiceTemplate report. + Required On Updates; """ - invoice_template: InvoiceTemplateDetailReference | None = Field( - default=None, alias="invoiceTemplate" - ) - email_template_id: int | None = Field(default=None, alias="emailTemplateId") + override_down_payment_amount_flag: Annotated[bool | None, Field(alias="overrideDownPaymentAmountFlag")] = None + payments: float | None = None + phase: ProjectPhaseReference | None = None + previous_progress_applied: Annotated[float | None, Field(alias="previousProgressApplied")] = None + product_total: Annotated[float | None, Field(alias="productTotal")] = None + project: ProjectReference | None = None + reference: str | None = None """ - Can be obtained via InvoiceEmailTemplate report. + Max length: 50; """ - add_to_batch_email_list: bool | None = Field( - default=None, alias="addToBatchEmailList" - ) - date: datetime | None = None - restrict_downpayment_flag: bool | None = Field( - default=None, alias="restrictDownpaymentFlag" - ) - location_id: int | None = Field(default=None, alias="locationId") + remaining_downpayment: Annotated[float | None, Field(alias="remainingDownpayment")] = None + restrict_downpayment_flag: Annotated[bool | None, Field(alias="restrictDownpaymentFlag")] = None + sales_order: Annotated[SalesOrderReference | None, Field(alias="salesOrder")] = None + sales_tax: Annotated[float | None, Field(alias="salesTax")] = None + service_adjustment_amount: Annotated[float | None, Field(alias="serviceAdjustmentAmount")] = None + service_total: Annotated[float | None, Field(alias="serviceTotal")] = None + ship_to_attention: Annotated[str | None, Field(alias="shipToAttention")] = None """ - Required On Updates; + Max length: 60; """ - department_id: int | None = Field(default=None, alias="departmentId") - """ - departmentId is only required for special invoices. - """ - territory_id: int | None = Field(default=None, alias="territoryId") - top_comment: str | None = Field(default=None, alias="topComment") - bottom_comment: str | None = Field(default=None, alias="bottomComment") - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - internal_notes: str | None = Field(default=None, alias="internalNotes") - downpayment_previously_taxed_flag: bool | None = Field( - default=None, alias="downpaymentPreviouslyTaxedFlag" - ) - service_total: float | None = Field(default=None, alias="serviceTotal") - override_down_payment_amount_flag: bool | None = Field( - default=None, alias="overrideDownPaymentAmountFlag" - ) - currency: CurrencyReference | None = None - due_date: datetime | None = Field(default=None, alias="dueDate") - expense_total: float | None = Field(default=None, alias="expenseTotal") - product_total: float | None = Field(default=None, alias="productTotal") - previous_progress_applied: float | None = Field( - default=None, alias="previousProgressApplied" - ) - service_adjustment_amount: float | None = Field( - default=None, alias="serviceAdjustmentAmount" - ) - agreement_amount: float | None = Field(default=None, alias="agreementAmount") - downpayment_applied: float | None = Field(default=None, alias="downpaymentApplied") + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + shipping_site: Annotated[SiteReference | None, Field(alias="shippingSite")] = None + shipping_site_address_line1: Annotated[str | None, Field(alias="shippingSiteAddressLine1")] = None + shipping_site_address_line2: Annotated[str | None, Field(alias="shippingSiteAddressLine2")] = None + shipping_site_city: Annotated[str | None, Field(alias="shippingSiteCity")] = None + shipping_site_country: Annotated[str | None, Field(alias="shippingSiteCountry")] = None + shipping_site_state: Annotated[str | None, Field(alias="shippingSiteState")] = None + shipping_site_zip: Annotated[str | None, Field(alias="shippingSiteZip")] = None + special_invoice_flag: Annotated[bool | None, Field(alias="specialInvoiceFlag")] = None + status: BillingStatusReference | None = None subtotal: float | None = None - total: float | None = None - remaining_downpayment: float | None = Field( - default=None, alias="remainingDownpayment" - ) - sales_tax: float | None = Field(default=None, alias="salesTax") - adjustment_reason: str | None = Field(default=None, alias="adjustmentReason") - adjusted_by: str | None = Field(default=None, alias="adjustedBy") - payments: float | None = None - credits: float | None = None - balance: float | None = None - special_invoice_flag: bool | None = Field(default=None, alias="specialInvoiceFlag") - billing_setup_reference: BillingSetupReference | None = Field( - default=None, alias="billingSetupReference" - ) + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None + template_setup_id: Annotated[int | None, Field(alias="templateSetupId")] = None + """ + Can be obtained via InvoiceTemplate report + """ + territory_id: Annotated[int | None, Field(alias="territoryId")] = None ticket: TicketReference | None = None - project: ProjectReference | None = None - phase: ProjectPhaseReference | None = None - sales_order: SalesOrderReference | None = Field(default=None, alias="salesOrder") - agreement: AgreementReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + top_comment: Annotated[str | None, Field(alias="topComment")] = None + total: float | None = None + type: Literal["Agreement", "CreditMemo", "DownPayment", "Miscellaneous", "Progress", "Standard"] class InvoiceEmailTemplate(ConnectWiseModel): - id: int | None = None - name: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + attach_invoice_flag: Annotated[bool | None, Field(alias="attachInvoiceFlag")] = None + body: str | None = None + copy_sender_flag: Annotated[bool | None, Field(alias="copySenderFlag")] = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None """ - Max length: 50; + From fields (first name, last name, email address) are required if useSenderFlag is false Max length: 100; """ - service_survey: ServiceSurveyReference | None = Field( - default=None, alias="serviceSurvey" - ) - use_sender_flag: bool | None = Field(default=None, alias="useSenderFlag") - first_name: str | None = Field(default=None, alias="firstName") + first_name: Annotated[str | None, Field(alias="firstName")] = None """ - From fields (first name, last name, email address) are required if useSenderFlag is false. Max length: 100; + From fields (first name, last name, email address) are required if useSenderFlag is false Max length: 100; """ - last_name: str | None = Field(default=None, alias="lastName") + id: int | None = None + invoice_status: Annotated[BillingStatusReference | None, Field(alias="invoiceStatus")] = None + last_name: Annotated[str | None, Field(alias="lastName")] = None """ - From fields (first name, last name, email address) are required if useSenderFlag is false. Max length: 100; + From fields (first name, last name, email address) are required if useSenderFlag is false Max length: 100; """ - email_address: str | None = Field(default=None, alias="emailAddress") + name: str """ - From fields (first name, last name, email address) are required if useSenderFlag is false. Max length: 100; + Max length: 50; """ + service_survey: Annotated[ServiceSurveyReference | None, Field(alias="serviceSurvey")] = None subject: str """ Max length: 200; """ - body: str | None = None - copy_sender_flag: bool | None = Field(default=None, alias="copySenderFlag") - invoice_status: BillingStatusReference | None = Field( - default=None, alias="invoiceStatus" - ) - attach_invoice_flag: bool | None = Field(default=None, alias="attachInvoiceFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + use_sender_flag: Annotated[bool | None, Field(alias="useSenderFlag")] = None -class InvoicePayment(ConnectWiseModel): +class KPI(ConnectWiseModel): + category: KPICategoryReference | None = None + date_filter: Annotated[str | None, Field(alias="dateFilter")] = None id: int | None = None - type: str | None = None - source: Literal["Default", "WisePay"] | None = None - invoice: InvoiceReference | None = None - credit: InvoiceReference | None = None - amount: float | None = None - payment_date: datetime | None = Field(default=None, alias="paymentDate") - applied_by: str | None = Field(default=None, alias="appliedBy") - info: dict[str, str] | None = Field(default=None, alias="_info") - wise_pay_payment: WisePayPayment | None = Field( - default=None, alias="wisePayPayment" - ) - payment_sync_status: str | None = Field(default=None, alias="paymentSyncStatus") - payment_sync_date: str | None = Field(default=None, alias="paymentSyncDate") - payment_account: str | None = Field(default=None, alias="paymentAccount") - a_r_payment_account: str | None = Field(default=None, alias="aRPaymentAccount") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + name: str | None = None + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class KnowledgeBaseCategory(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + approver: MemberReference | None = None + department: SystemDepartmentReference | None = None id: int | None = None + location: SystemLocationReference | None = None name: str """ Max length: 50; """ - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - approver: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class KnowledgeBaseSettings(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_approver: Annotated[MemberReference | None, Field(alias="defaultApprover")] = None id: int | None = None - require_approval: bool = Field(..., alias="requireApproval") - default_approver: MemberReference | None = Field( - default=None, alias="defaultApprover" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + require_approval: Annotated[bool, Field(alias="requireApproval")] class KnowledgeBaseSubCategory(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + category: KBCategoryReference + department: SystemDepartmentReference | None = None id: int | None = None + location: SystemLocationReference | None = None name: str """ Max length: 50; """ - category: KBCategoryReference - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class KPI(ConnectWiseModel): - id: int | None = None - name: str | None = None - category: KPICategoryReference | None = None - date_filter: str | None = Field(default=None, alias="dateFilter") - sort_order: int | None = Field(default=None, alias="sortOrder") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") class Location(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + calendar: CalendarReference | None = None + client_flag: Annotated[bool | None, Field(alias="clientFlag")] = None + department_ids: Annotated[list[int] | None, Field(alias="departmentIds")] = None id: int | None = None - owner_level_id: int | None = Field(default=None, alias="ownerLevelId") - structure_level: CorporateStructureLevelReference | None = Field( - default=None, alias="structureLevel" - ) - name: str - """ - Max length: 50; - """ + location_flag: Annotated[bool | None, Field(alias="locationFlag")] = None manager: MemberReference | None = None - reports_to: SystemLocationReference | None = Field(default=None, alias="reportsTo") - sales_rep: str | None = Field(default=None, alias="salesRep") + name: str """ Max length: 50; """ - time_zone_setup: TimeZoneSetupReference | None = Field( - default=None, alias="timeZoneSetup" - ) - calendar: CalendarReference | None = None - override_address_line1: str | None = Field( - default=None, alias="overrideAddressLine1" - ) + override_address_line1: Annotated[str | None, Field(alias="overrideAddressLine1")] = None """ Max length: 50; """ - override_address_line2: str | None = Field( - default=None, alias="overrideAddressLine2" - ) + override_address_line2: Annotated[str | None, Field(alias="overrideAddressLine2")] = None """ Max length: 50; """ - override_city: str | None = Field(default=None, alias="overrideCity") + override_city: Annotated[str | None, Field(alias="overrideCity")] = None """ Max length: 50; """ - override_state: str | None = Field(default=None, alias="overrideState") + override_country: Annotated[CountryReference | None, Field(alias="overrideCountry")] = None + override_fax_number: Annotated[str | None, Field(alias="overrideFaxNumber")] = None """ - Max length: 50; + Max length: 15; """ - override_zip: str | None = Field(default=None, alias="overrideZip") + override_phone_number: Annotated[str | None, Field(alias="overridePhoneNumber")] = None """ - Max length: 12; + Max length: 15; """ - override_country: CountryReference | None = Field( - default=None, alias="overrideCountry" - ) - override_phone_number: str | None = Field(default=None, alias="overridePhoneNumber") + override_state: Annotated[str | None, Field(alias="overrideState")] = None """ - Max length: 15; + Max length: 50; """ - override_fax_number: str | None = Field(default=None, alias="overrideFaxNumber") + override_zip: Annotated[str | None, Field(alias="overrideZip")] = None """ - Max length: 15; + Max length: 12; """ - owa_url: str | None = Field(default=None, alias="owaUrl") + owa_url: Annotated[str | None, Field(alias="owaUrl")] = None """ Max length: 100; """ - payroll_xref: str | None = Field(default=None, alias="payrollXref") + owner_level_id: Annotated[int | None, Field(alias="ownerLevelId")] = None + payroll_xref: Annotated[str | None, Field(alias="payrollXref")] = None """ Max length: 10; """ - location_flag: bool | None = Field(default=None, alias="locationFlag") - client_flag: bool | None = Field(default=None, alias="clientFlag") - work_role_ids: list[int] | None = Field(default=None, alias="workRoleIds") - department_ids: list[int] | None = Field(default=None, alias="departmentIds") - info: dict[str, str] | None = Field(default=None, alias="_info") + reports_to: Annotated[SystemLocationReference | None, Field(alias="reportsTo")] = None + sales_rep: Annotated[str | None, Field(alias="salesRep")] = None + """ + Max length: 50; + """ + structure_level: Annotated[CorporateStructureLevelReference | None, Field(alias="structureLevel")] = None + time_zone_setup: Annotated[TimeZoneSetupReference | None, Field(alias="timeZoneSetup")] = None + work_role_ids: Annotated[list[int] | None, Field(alias="workRoleIds")] = None class LocationDepartment(DepartmentLocationInfo): @@ -11866,527 +9682,384 @@ class LocationDepartment(DepartmentLocationInfo): class LocationWorkRole(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None location: SystemLocationReference | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_role_inactive_flag: bool | None = Field( - default=None, alias="workRoleInactiveFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class M365ContactSyncCompany(ConnectWiseModel): - id: int | None = None - company_rec_id: int | None = Field(default=None, alias="companyRecId") - tenant_id: str | None = Field(default=None, alias="tenantId") - parent_tenant_id: str | None = Field(default=None, alias="parentTenantId") - m365_tenant: M365Tenant | None = Field(default=None, alias="m365Tenant") - display_name: str | None = Field(default=None, alias="displayName") - sync_flag: bool | None = Field(default=None, alias="syncFlag") - company_id: str | None = Field(default=None, alias="companyId") - contacts: list[GraphUserCsv] | None = None - inactive_flag_tenant: bool | None = Field(default=None, alias="inactiveFlagTenant") - are_all_microsoft365_contact_sync_inactive: bool | None = Field( - default=None, alias="areAllMicrosoft365ContactSyncInactive" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_role_inactive_flag: Annotated[bool | None, Field(alias="workRoleInactiveFlag")] = None class ManagedDeviceAccount(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - username: str | None = None + managed_devices_integration: Annotated[ + ManagedDevicesIntegrationReference | None, Field(alias="managedDevicesIntegration") + ] = None password: str | None = None - managed_devices_integration: ManagedDevicesIntegrationReference | None = Field( - default=None, alias="managedDevicesIntegration" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + username: str | None = None class ManagedDevicesIntegration(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + config_bill_customer_flag: Annotated[bool | None, Field(alias="configBillCustomerFlag")] = None + default_billing_level: Annotated[Literal["Detail", "Summary"], Field(alias="defaultBillingLevel")] + default_department: Annotated[SystemDepartmentReference | None, Field(alias="defaultDepartment")] = None + default_location: Annotated[SystemLocationReference | None, Field(alias="defaultLocation")] = None + disable_new_cross_references_flag: Annotated[bool | None, Field(alias="disableNewCrossReferencesFlag")] = None + global_login_password: Annotated[str | None, Field(alias="globalLoginPassword")] = None + """ + This is only required when globalLoginFlag = true Max length: 50; + """ + global_login_username: Annotated[str | None, Field(alias="globalLoginUsername")] = None + """ + This is only required when globalLoginFlag = true Max length: 50; + """ id: int | None = None + integrator_login: Annotated[IntegratorLoginReference | None, Field(alias="integratorLogin")] = None + login_by: Annotated[Literal["Global", "Member"], Field(alias="loginBy")] + management_it_setup_type: Annotated[str | None, Field(alias="managementItSetupType")] = None + match_on_serial_number_flag: Annotated[bool | None, Field(alias="matchOnSerialNumberFlag")] = None name: str """ Max length: 30; """ - solution: str + portal_url: Annotated[str | None, Field(alias="portalUrl")] = None """ - Max length: 30; + Max length: 200; """ - portal_url: str | None = Field(default=None, alias="portalUrl") + solution: str """ - Max length: 200; + Max length: 30; """ - login_by: Literal["Global", "Member"] = Field(..., alias="loginBy") - global_login_username: str | None = Field(default=None, alias="globalLoginUsername") - """ - Gets or sets - this is only required when globalLoginFlag = true. Max length: 50; - """ - global_login_password: str | None = Field(default=None, alias="globalLoginPassword") - """ - Gets or sets - this is only required when globalLoginFlag = true. Max length: 50; - """ - default_billing_level: Literal["Detail", "Summary"] = Field( - ..., alias="defaultBillingLevel" - ) - management_it_setup_type: str | None = Field( - default=None, alias="managementItSetupType" - ) - default_location: SystemLocationReference | None = Field( - default=None, alias="defaultLocation" - ) - default_department: SystemDepartmentReference | None = Field( - default=None, alias="defaultDepartment" - ) - integrator_login: IntegratorLoginReference | None = Field( - default=None, alias="integratorLogin" - ) - match_on_serial_number_flag: bool | None = Field( - default=None, alias="matchOnSerialNumberFlag" - ) - disable_new_cross_references_flag: bool | None = Field( - default=None, alias="disableNewCrossReferencesFlag" - ) - config_bill_customer_flag: bool | None = Field( - default=None, alias="configBillCustomerFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class ManagedDevicesIntegrationCrossReference(ConnectWiseModel): - id: int | None = None - managed_devices_integration: ManagedDevicesIntegrationReference | None = Field( - default=None, alias="managedDevicesIntegration" - ) - vendor_type: str | None = Field(default=None, alias="vendorType") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_type: Annotated[AgreementTypeReference | None, Field(alias="agreementType")] = None + configuration_type: Annotated[ConfigurationTypeReference | None, Field(alias="configurationType")] = None + id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + managed_devices_integration: Annotated[ + ManagedDevicesIntegrationReference | None, Field(alias="managedDevicesIntegration") + ] = None + product: IvItemReference | None = None + vendor_level: Annotated[str | None, Field(alias="vendorLevel")] = None """ Max length: 255; """ - vendor_level: str | None = Field(default=None, alias="vendorLevel") + vendor_type: Annotated[str | None, Field(alias="vendorType")] = None """ Max length: 255; """ - agreement_type: AgreementTypeReference | None = Field( - default=None, alias="agreementType" - ) - product: IvItemReference | None = None - configuration_type: ConfigurationTypeReference | None = Field( - default=None, alias="configurationType" - ) - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ManagedDevicesIntegrationLogin(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - managed_devices_integration: ManagedDevicesIntegrationReference | None = Field( - default=None, alias="managedDevicesIntegration" - ) - username: str + managed_devices_integration: Annotated[ + ManagedDevicesIntegrationReference | None, Field(alias="managedDevicesIntegration") + ] = None + member: MemberReference | None = None + password: str | None = None """ Max length: 50; """ - password: str | None = None + username: str """ Max length: 50; """ - member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ManagedDevicesIntegrationNotification(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - managed_devices_integration: ManagedDevicesIntegrationReference | None = Field( - default=None, alias="managedDevicesIntegration" - ) - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) + log_type: Annotated[ + Literal["All", "Error", "NewManagedSolution", "NewDeviceType", "NewConfiguration", "NewAddition", "Info"], + Field(alias="logType"), + ] + managed_devices_integration: Annotated[ + ManagedDevicesIntegrationReference | None, Field(alias="managedDevicesIntegration") + ] = None member: MemberReference | None = None - log_type: Literal[ - "All", - "Error", - "NewManagedSolution", - "NewDeviceType", - "NewConfiguration", - "NewAddition", - "Info", - ] = Field(..., alias="logType") - info: dict[str, str] | None = Field(default=None, alias="_info") + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None class ManagementReportNotification(ConnectWiseModel): - id: int | None = None - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None email: str | None = None """ Max length: 50; """ - global_flag: bool | None = Field(default=None, alias="globalFlag") - company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + global_flag: Annotated[bool | None, Field(alias="globalFlag")] = None + id: int | None = None + member: MemberReference | None = None + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None -class Member(ConnectWiseModel): - id: int | None = None - identifier: str +class Member(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + admin_flag: Annotated[bool | None, Field(alias="adminFlag")] = None + agreement_invoicing_display_options: Annotated[ + Literal["RemainOnInvoicingScreen", "ShowRecentInvoices"], Field(alias="agreementInvoicingDisplayOptions") + ] + allow_expenses_entered_against_companies_flag: Annotated[ + bool | None, Field(alias="allowExpensesEnteredAgainstCompaniesFlag") + ] = None + allow_in_cell_entry_on_time_sheet: Annotated[bool | None, Field(alias="allowInCellEntryOnTimeSheet")] = None + authentication_service_type: Annotated[ + Literal["AuthAnvil", "GoogleAuthenticator", "Email"] | None, Field(alias="authenticationServiceType") + ] = None + auto_popup_quick_notes_with_stopwatch: Annotated[ + bool | None, Field(alias="autoPopupQuickNotesWithStopwatch") + ] = None + auto_start_stopwatch: Annotated[bool | None, Field(alias="autoStartStopwatch")] = None + billable_forecast: Annotated[float | None, Field(alias="billableForecast")] = None + calendar: CalendarReference | None = None + calendar_sync_integration_flag: Annotated[bool | None, Field(alias="calendarSyncIntegrationFlag")] = None + client_id: Annotated[str | None, Field(alias="clientId")] = None + company_activity_tab_format: Annotated[ + Literal["SummaryList", "DetailList"], Field(alias="companyActivityTabFormat") + ] + copy_column_layouts_and_filters: Annotated[bool | None, Field(alias="copyColumnLayoutsAndFilters")] = None + copy_pod_layouts: Annotated[bool | None, Field(alias="copyPodLayouts")] = None + copy_shared_default_views: Annotated[bool | None, Field(alias="copySharedDefaultViews")] = None + country: CountryReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + daily_capacity: Annotated[float | None, Field(alias="dailyCapacity")] = None + days_tolerance: Annotated[int | None, Field(alias="daysTolerance")] = None + default_department: Annotated[SystemDepartmentReference | None, Field(alias="defaultDepartment")] = None + default_email: Annotated[Literal["Office", "Mobile", "Home"], Field(alias="defaultEmail")] + default_location: Annotated[SystemLocationReference | None, Field(alias="defaultLocation")] = None + default_phone: Annotated[Literal["Office", "Mobile", "Home"], Field(alias="defaultPhone")] + disable_online_flag: Annotated[bool | None, Field(alias="disableOnlineFlag")] = None + employee_identifer: Annotated[str | None, Field(alias="employeeIdentifer")] = None """ - Max length: 15; + Max length: 10; """ - password: str | None = None + enable_ldap_authentication_flag: Annotated[bool | None, Field(alias="enableLdapAuthenticationFlag")] = None + enable_mobile_flag: Annotated[bool | None, Field(alias="enableMobileFlag")] = None + enable_mobile_gps_flag: Annotated[bool | None, Field(alias="enableMobileGpsFlag")] = None + enter_time_against_company_flag: Annotated[bool | None, Field(alias="enterTimeAgainstCompanyFlag")] = None + excluded_project_board_ids: Annotated[list[int] | None, Field(alias="excludedProjectBoardIds")] = None + excluded_service_board_ids: Annotated[list[int] | None, Field(alias="excludedServiceBoardIds")] = None + expense_approver: Annotated[MemberReference | None, Field(alias="expenseApprover")] = None + first_name: Annotated[str, Field(alias="firstName")] """ - ConditionallyRequired. API Member will get random password generated Max length: 60; + Max length: 30; """ - disable_online_flag: bool | None = Field(default=None, alias="disableOnlineFlag") - license_class: Literal["A", "C", "F", "X"] = Field(..., alias="licenseClass") + from_member_rec_id: Annotated[int | None, Field(alias="fromMemberRecId")] = None + global_search_default_sort: Annotated[ + Literal["None", "LastUpdatedDesc", "LastUpdatedAsc", "CreatedDesc", "CreatedAsc"] | None, + Field(alias="globalSearchDefaultSort"), + ] = None + global_search_default_ticket_filter: Annotated[ + Literal["OpenRecords", "ClosedRecords", "AllRecords"] | None, Field(alias="globalSearchDefaultTicketFilter") + ] = None + hide_member_in_dispatch_portal_flag: Annotated[bool | None, Field(alias="hideMemberInDispatchPortalFlag")] = None + hire_date: Annotated[datetime, Field(alias="hireDate")] + home_email: Annotated[str | None, Field(alias="homeEmail")] = None """ - F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member + Max length: 250; """ - notes: str | None = None - employee_identifer: str | None = Field(default=None, alias="employeeIdentifer") + home_extension: Annotated[str | None, Field(alias="homeExtension")] = None """ Max length: 10; """ - vendor_number: str | None = Field(default=None, alias="vendorNumber") - enable_mobile_gps_flag: bool | None = Field( - default=None, alias="enableMobileGpsFlag" - ) - inactive_date: datetime | None = Field(default=None, alias="inactiveDate") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - last_login: str | None = Field(default=None, alias="lastLogin") - client_id: str | None = Field(default=None, alias="clientId") - token: str | None = None - first_name: str = Field(..., alias="firstName") + home_phone: Annotated[str | None, Field(alias="homePhone")] = None """ - Max length: 30; + Max length: 15; """ - middle_initial: str | None = Field(default=None, alias="middleInitial") + hourly_cost: Annotated[float | None, Field(alias="hourlyCost")] = None + hourly_rate: Annotated[float | None, Field(alias="hourlyRate")] = None + id: int | None = None + identifier: str """ - Max length: 1; + Max length: 15; """ - last_name: str = Field(..., alias="lastName") + inactive_date: Annotated[datetime | None, Field(alias="inactiveDate")] = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + include_in_utilization_reporting_flag: Annotated[ + bool | None, Field(alias="includeInUtilizationReportingFlag") + ] = None + invoice_screen_default_tab_format: Annotated[ + Literal["ShowInvoicingTab", "ShowAgreementInvoicingTab"], Field(alias="invoiceScreenDefaultTabFormat") + ] + invoice_time_tab_format: Annotated[Literal["SummaryList", "DetailList"], Field(alias="invoiceTimeTabFormat")] + invoicing_display_options: Annotated[ + Literal["RemainOnInvoicingScreen", "ShowRecentInvoices"], Field(alias="invoicingDisplayOptions") + ] + last_login: Annotated[str | None, Field(alias="lastLogin")] = None + last_name: Annotated[str, Field(alias="lastName")] """ Max length: 30; """ - hire_date: datetime = Field(..., alias="hireDate") - country: CountryReference | None = None - photo: DocumentReference | None = None - office_email: str | None = Field(default=None, alias="officeEmail") + ldap_configuration: Annotated[LdapConfigurationReference | None, Field(alias="ldapConfiguration")] = None + ldap_user_name: Annotated[str | None, Field(alias="ldapUserName")] = None """ - Max length: 250; + Max length: 50; """ - mobile_email: str | None = Field(default=None, alias="mobileEmail") + license_class: Annotated[Literal["A", "C", "F", "X"], Field(alias="licenseClass")] """ - Max length: 250; + F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member """ - home_email: str | None = Field(default=None, alias="homeEmail") + mapi_name: Annotated[str | None, Field(alias="mapiName")] = None + member_personas: Annotated[list[int] | None, Field(alias="memberPersonas")] = None + middle_initial: Annotated[str | None, Field(alias="middleInitial")] = None """ - Max length: 250; + Max length: 1; """ - default_email: Literal["Office", "Mobile", "Home"] = Field( - ..., alias="defaultEmail" - ) - primary_email: str | None = Field(default=None, alias="primaryEmail") + minimum_hours: Annotated[float | None, Field(alias="minimumHours")] = None + mobile_email: Annotated[str | None, Field(alias="mobileEmail")] = None """ Max length: 250; """ - office_phone: str | None = Field(default=None, alias="officePhone") - """ - Max length: 15; - """ - office_extension: str | None = Field(default=None, alias="officeExtension") + mobile_extension: Annotated[str | None, Field(alias="mobileExtension")] = None """ Max length: 10; """ - mobile_phone: str | None = Field(default=None, alias="mobilePhone") + mobile_phone: Annotated[str | None, Field(alias="mobilePhone")] = None """ Max length: 15; """ - mobile_extension: str | None = Field(default=None, alias="mobileExtension") + notes: str | None = None + office365: MemberOffice365 | None = None + office_email: Annotated[str | None, Field(alias="officeEmail")] = None + """ + Max length: 250; + """ + office_extension: Annotated[str | None, Field(alias="officeExtension")] = None """ Max length: 10; """ - home_phone: str | None = Field(default=None, alias="homePhone") + office_phone: Annotated[str | None, Field(alias="officePhone")] = None """ Max length: 15; """ - home_extension: str | None = Field(default=None, alias="homeExtension") + partner_portal_flag: Annotated[bool | None, Field(alias="partnerPortalFlag")] = None + password: str | None = None """ - Max length: 10; + ConditionallyRequired. API Member will get random password generated Max length: 60; """ - default_phone: Literal["Office", "Mobile", "Home"] = Field( - ..., alias="defaultPhone" - ) - security_role: SecurityRoleReference | None = Field( - default=None, alias="securityRole" - ) - office365: MemberOffice365 | None = None - mapi_name: str | None = Field(default=None, alias="mapiName") - calendar_sync_integration_flag: bool | None = Field( - default=None, alias="calendarSyncIntegrationFlag" - ) - authentication_service_type: Literal[ - "AuthAnvil", "GoogleAuthenticator", "Email" - ] | None = Field(default=None, alias="authenticationServiceType") - timebased_one_time_password_activated: bool | None = Field( - default=None, alias="timebasedOneTimePasswordActivated" - ) - enable_ldap_authentication_flag: bool | None = Field( - default=None, alias="enableLdapAuthenticationFlag" - ) - ldap_configuration: LdapConfigurationReference | None = Field( - default=None, alias="ldapConfiguration" - ) - ldap_user_name: str | None = Field(default=None, alias="ldapUserName") - """ - Max length: 50; - """ - directional_sync: DirectionalSyncReference | None = Field( - default=None, alias="directionalSync" - ) - sso_settings: MemberSsoSettingsReference | None = Field( - default=None, alias="ssoSettings" - ) + phone_integration_type: Annotated[ + Literal["TAPI", "SKYPE", "NONE"] | None, Field(alias="phoneIntegrationType") + ] = None + phone_source: Annotated[str | None, Field(alias="phoneSource")] = None + photo: DocumentReference | None = None + primary_email: Annotated[str | None, Field(alias="primaryEmail")] = None + """ + Max length: 250; + """ + project_default_board: Annotated[ProjectBoardReference | None, Field(alias="projectDefaultBoard")] = None + project_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="projectDefaultDepartment") + ] = None + project_default_location: Annotated[SystemLocationReference | None, Field(alias="projectDefaultLocation")] = None + report_card: Annotated[ReportCardReference | None, Field(alias="reportCard")] = None + reports_to: Annotated[MemberReference | None, Field(alias="reportsTo")] = None + require_expense_entry_flag: Annotated[bool | None, Field(alias="requireExpenseEntryFlag")] = None + require_start_and_end_time_on_time_entry_flag: Annotated[ + bool | None, Field(alias="requireStartAndEndTimeOnTimeEntryFlag") + ] = None + require_time_sheet_entry_flag: Annotated[bool | None, Field(alias="requireTimeSheetEntryFlag")] = None + restrict_default_sales_territory_flag: Annotated[ + bool | None, Field(alias="restrictDefaultSalesTerritoryFlag") + ] = None + restrict_default_warehouse_bin_flag: Annotated[bool | None, Field(alias="restrictDefaultWarehouseBinFlag")] = None + restrict_default_warehouse_flag: Annotated[bool | None, Field(alias="restrictDefaultWarehouseFlag")] = None + restrict_department_flag: Annotated[bool | None, Field(alias="restrictDepartmentFlag")] = None + restrict_location_flag: Annotated[bool | None, Field(alias="restrictLocationFlag")] = None + restrict_project_default_department_flag: Annotated[ + bool | None, Field(alias="restrictProjectDefaultDepartmentFlag") + ] = None + restrict_project_default_location_flag: Annotated[ + bool | None, Field(alias="restrictProjectDefaultLocationFlag") + ] = None + restrict_schedule_flag: Annotated[bool | None, Field(alias="restrictScheduleFlag")] = None + restrict_service_default_department_flag: Annotated[ + bool | None, Field(alias="restrictServiceDefaultDepartmentFlag") + ] = None + restrict_service_default_location_flag: Annotated[ + bool | None, Field(alias="restrictServiceDefaultLocationFlag") + ] = None + sales_default_location: Annotated[SystemLocationReference | None, Field(alias="salesDefaultLocation")] = None + schedule_capacity: Annotated[float | None, Field(alias="scheduleCapacity")] = None + schedule_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="scheduleDefaultDepartment") + ] = None + schedule_default_location: Annotated[SystemLocationReference | None, Field(alias="scheduleDefaultLocation")] = None + security_location: Annotated[SystemLocationReference | None, Field(alias="securityLocation")] = None + security_role: Annotated[SecurityRoleReference | None, Field(alias="securityRole")] = None + service_board_team_ids: Annotated[list[int] | None, Field(alias="serviceBoardTeamIds")] = None + service_default_board: Annotated[BoardReference | None, Field(alias="serviceDefaultBoard")] = None + service_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="serviceDefaultDepartment") + ] = None + service_default_location: Annotated[SystemLocationReference | None, Field(alias="serviceDefaultLocation")] = None + service_location: Annotated[ServiceLocationReference | None, Field(alias="serviceLocation")] = None signature: str | None = None - phone_integration_type: Literal[ - "TAPI", "SKYPE", "TEL", "CALLTO", "NONE" - ] | None = Field(default=None, alias="phoneIntegrationType") - use_browser_language_flag: bool | None = Field( - default=None, alias="useBrowserLanguageFlag" - ) + sso_settings: Annotated[MemberSsoSettingsReference | None, Field(alias="ssoSettings")] = None + structure_level: Annotated[StructureReference | None, Field(alias="structureLevel")] = None + sts_user_admin_url: Annotated[str | None, Field(alias="stsUserAdminUrl")] = None + time_approver: Annotated[MemberReference | None, Field(alias="timeApprover")] = None + time_reminder_email_flag: Annotated[bool | None, Field(alias="timeReminderEmailFlag")] = None + time_sheet_start_date: Annotated[datetime | None, Field(alias="timeSheetStartDate")] = None + time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="timeZone")] = None + timebased_one_time_password_activated: Annotated[ + bool | None, Field(alias="timebasedOneTimePasswordActivated") + ] = None title: str | None = None - report_card: ReportCardReference | None = Field(default=None, alias="reportCard") - enable_mobile_flag: bool | None = Field(default=None, alias="enableMobileFlag") + """ + Max length: 50; + """ + toast_notification_flag: Annotated[bool | None, Field(alias="toastNotificationFlag")] = None + token: str | None = None type: MemberTypeReference | None = None - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - partner_portal_flag: bool | None = Field(default=None, alias="partnerPortalFlag") - sts_user_admin_url: str | None = Field(default=None, alias="stsUserAdminUrl") - toast_notification_flag: bool | None = Field( - default=None, alias="toastNotificationFlag" - ) - member_personas: list[int] | None = Field(default=None, alias="memberPersonas") - admin_flag: bool | None = Field(default=None, alias="adminFlag") - structure_level: StructureReference | None = Field( - default=None, alias="structureLevel" - ) - security_location: SystemLocationReference | None = Field( - default=None, alias="securityLocation" - ) - default_location: SystemLocationReference | None = Field( - default=None, alias="defaultLocation" - ) - default_department: SystemDepartmentReference | None = Field( - default=None, alias="defaultDepartment" - ) - reports_to: MemberReference | None = Field(default=None, alias="reportsTo") - restrict_location_flag: bool | None = Field( - default=None, alias="restrictLocationFlag" - ) - restrict_department_flag: bool | None = Field( - default=None, alias="restrictDepartmentFlag" - ) - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - time_approver: MemberReference | None = Field(default=None, alias="timeApprover") - expense_approver: MemberReference | None = Field( - default=None, alias="expenseApprover" - ) - billable_forecast: float | None = Field(default=None, alias="billableForecast") - daily_capacity: float | None = Field(default=None, alias="dailyCapacity") - hourly_cost: float | None = Field(default=None, alias="hourlyCost") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - include_in_utilization_reporting_flag: bool | None = Field( - default=None, alias="includeInUtilizationReportingFlag" - ) - require_expense_entry_flag: bool | None = Field( - default=None, alias="requireExpenseEntryFlag" - ) - require_time_sheet_entry_flag: bool | None = Field( - default=None, alias="requireTimeSheetEntryFlag" - ) - require_start_and_end_time_on_time_entry_flag: bool | None = Field( - default=None, alias="requireStartAndEndTimeOnTimeEntryFlag" - ) - allow_in_cell_entry_on_time_sheet: bool | None = Field( - default=None, alias="allowInCellEntryOnTimeSheet" - ) - enter_time_against_company_flag: bool | None = Field( - default=None, alias="enterTimeAgainstCompanyFlag" - ) - allow_expenses_entered_against_companies_flag: bool | None = Field( - default=None, alias="allowExpensesEnteredAgainstCompaniesFlag" - ) - time_reminder_email_flag: bool | None = Field( - default=None, alias="timeReminderEmailFlag" - ) - days_tolerance: int | None = Field(default=None, alias="daysTolerance") - minimum_hours: float | None = Field(default=None, alias="minimumHours") - time_sheet_start_date: str | None = Field(default=None, alias="timeSheetStartDate") - service_default_location: SystemLocationReference | None = Field( - default=None, alias="serviceDefaultLocation" - ) - service_default_department: SystemDepartmentReference | None = Field( - default=None, alias="serviceDefaultDepartment" - ) - service_default_board: BoardReference | None = Field( - default=None, alias="serviceDefaultBoard" - ) - restrict_service_default_location_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultLocationFlag" - ) - restrict_service_default_department_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultDepartmentFlag" - ) - excluded_service_board_ids: list[int] | None = Field( - default=None, alias="excludedServiceBoardIds" - ) - teams: list[int] | None = None - service_board_team_ids: list[int] | None = Field( - default=None, alias="serviceBoardTeamIds" - ) - project_default_location: SystemLocationReference | None = Field( - default=None, alias="projectDefaultLocation" - ) - project_default_department: SystemDepartmentReference | None = Field( - default=None, alias="projectDefaultDepartment" - ) - project_default_board: ProjectBoardReference | None = Field( - default=None, alias="projectDefaultBoard" - ) - restrict_project_default_location_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultLocationFlag" - ) - restrict_project_default_department_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultDepartmentFlag" - ) - excluded_project_board_ids: list[int] | None = Field( - default=None, alias="excludedProjectBoardIds" - ) - schedule_default_location: SystemLocationReference | None = Field( - default=None, alias="scheduleDefaultLocation" - ) - schedule_default_department: SystemDepartmentReference | None = Field( - default=None, alias="scheduleDefaultDepartment" - ) - schedule_capacity: float | None = Field(default=None, alias="scheduleCapacity") - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - restrict_schedule_flag: bool | None = Field( - default=None, alias="restrictScheduleFlag" - ) - hide_member_in_dispatch_portal_flag: bool | None = Field( - default=None, alias="hideMemberInDispatchPortalFlag" - ) - calendar: CalendarReference | None = None - sales_default_location: SystemLocationReference | None = Field( - default=None, alias="salesDefaultLocation" - ) - restrict_default_sales_territory_flag: bool | None = Field( - default=None, alias="restrictDefaultSalesTerritoryFlag" - ) + use_browser_language_flag: Annotated[bool | None, Field(alias="useBrowserLanguageFlag")] = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - restrict_default_warehouse_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseFlag" - ) - restrict_default_warehouse_bin_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseBinFlag" - ) - company_activity_tab_format: Literal["SummaryList", "DetailList"] | None = Field( - default=None, alias="companyActivityTabFormat" - ) - invoice_time_tab_format: Literal["SummaryList", "DetailList"] | None = Field( - default=None, alias="invoiceTimeTabFormat" - ) - invoice_screen_default_tab_format: Literal[ - "ShowInvoicingTab", "ShowAgreementInvoicingTab" - ] | None = Field(default=None, alias="invoiceScreenDefaultTabFormat") - invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] | None = Field(default=None, alias="invoicingDisplayOptions") - agreement_invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] | None = Field(default=None, alias="agreementInvoicingDisplayOptions") - auto_start_stopwatch: bool | None = Field(default=None, alias="autoStartStopwatch") - auto_popup_quick_notes_with_stopwatch: bool | None = Field( - default=None, alias="autoPopupQuickNotesWithStopwatch" - ) - global_search_default_ticket_filter: Literal[ - "OpenRecords", "ClosedRecords", "AllRecords" - ] | None = Field(default=None, alias="globalSearchDefaultTicketFilter") - global_search_default_sort: Literal[ - "None", "LastUpdatedDesc", "LastUpdatedAsc", "CreatedDesc", "CreatedAsc" - ] | None = Field(default=None, alias="globalSearchDefaultSort") - phone_source: str | None = Field(default=None, alias="phoneSource") - info: dict[str, str] | None = Field(default=None, alias="_info") - copy_pod_layouts: bool | None = Field(default=None, alias="copyPodLayouts") - copy_shared_default_views: bool | None = Field( - default=None, alias="copySharedDefaultViews" - ) - copy_column_layouts_and_filters: bool | None = Field( - default=None, alias="copyColumnLayoutsAndFilters" - ) - from_member_rec_id: int | None = Field(default=None, alias="fromMemberRecId") - from_member_template_rec_id: int | None = Field( - default=None, alias="fromMemberTemplateRecId" - ) - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class MemberAccrual(ConnectWiseModel): - id: int | None = None - accrual_type: Literal["Holiday", "PTO", "Sick", "Vacation"] = Field( - ..., alias="accrualType" - ) - year: int + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + accrual_type: Annotated[Literal["Holiday", "PTO", "Sick", "Vacation"], Field(alias="accrualType")] hours: float - reason: str + id: int | None = None member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + reason: str + year: int class MemberCertification(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None certification: CertificationReference - percent_complete: int | None = Field(default=None, alias="percentComplete") - date_received: datetime | None = Field(default=None, alias="dateReceived") - date_expires: datetime | None = Field(default=None, alias="dateExpires") - certification_number: str | None = Field(default=None, alias="certificationNumber") + certification_number: Annotated[str | None, Field(alias="certificationNumber")] = None """ Max length: 50; """ - notes: str | None = None - member: MemberReference | None = None company: CompanyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + date_expires: Annotated[datetime | None, Field(alias="dateExpires")] = None + date_received: Annotated[datetime | None, Field(alias="dateReceived")] = None + id: int | None = None + member: MemberReference | None = None + notes: str | None = None + percent_complete: Annotated[int | None, Field(alias="percentComplete")] = None class MemberDeactivationCompanyTeam(ConnectWiseModel): count: int | None = None id: int | None = None name: str | None = None - re_assign_to_member: MemberReference | None = Field( - default=None, alias="reAssignToMember" - ) - re_assign_to_contact: ContactReference | None = Field( - default=None, alias="reAssignToContact" - ) + re_assign_to_contact: Annotated[ContactReference | None, Field(alias="reAssignToContact")] = None + re_assign_to_member: Annotated[MemberReference | None, Field(alias="reAssignToMember")] = None class MemberDeactivationDepartmentMananager(ConnectWiseModel): count: int | None = None - re_assign_to_member: MemberReference | None = Field( - default=None, alias="reAssignToMember" - ) + re_assign_to_member: Annotated[MemberReference | None, Field(alias="reAssignToMember")] = None class MemberDeactivationDispatchMember(MemberDeactivationDepartmentMananager): @@ -12401,11 +10074,11 @@ class MemberDeactivationKnowledgebaseArticle(MemberDeactivationDepartmentMananag pass -class MemberDeactivationMyCompanyControllerRole(MemberDeactivationDepartmentMananager): +class MemberDeactivationMyCompanyCOORole(MemberDeactivationDepartmentMananager): pass -class MemberDeactivationMyCompanyCOORole(MemberDeactivationDepartmentMananager): +class MemberDeactivationMyCompanyControllerRole(MemberDeactivationDepartmentMananager): pass @@ -12421,9 +10094,7 @@ class MemberDeactivationMyCompanyPresidentRole(MemberDeactivationDepartmentManan pass -class MemberDeactivationMyCompanyServiceManagerRole( - MemberDeactivationDepartmentMananager -): +class MemberDeactivationMyCompanyServiceManagerRole(MemberDeactivationDepartmentMananager): pass @@ -12463,9 +10134,7 @@ class MemberDeactivationStatusWorkflow(ConnectWiseModel): count: int | None = None id: int | None = None name: str | None = None - re_assign_to_member: MemberReference | None = Field( - default=None, alias="reAssignToMember" - ) + re_assign_to_member: Annotated[MemberReference | None, Field(alias="reAssignToMember")] = None class MemberDeactivationWorkflow(MemberDeactivationDepartmentMananager): @@ -12473,3746 +10142,2581 @@ class MemberDeactivationWorkflow(MemberDeactivationDepartmentMananager): class MemberDelegation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + date_end: Annotated[datetime, Field(alias="dateEnd")] + date_start: Annotated[datetime, Field(alias="dateStart")] + delegated_to: Annotated[MemberReference | None, Field(alias="delegatedTo")] = None + delegation_type: Annotated[Literal["Approval", "Project"], Field(alias="delegationType")] id: int | None = None - delegation_type: Literal["Approval", "Project"] = Field(..., alias="delegationType") - delegated_to: MemberReference | None = Field(default=None, alias="delegatedTo") - date_start: datetime = Field(..., alias="dateStart") - date_end: datetime = Field(..., alias="dateEnd") member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class MemberPersona(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - job_role_percentage: int | None = Field(default=None, alias="jobRolePercentage") - name: str | None = None - persona_id: int = Field(..., alias="personaId") member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None class MemberSkill(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + certified_flag: Annotated[bool | None, Field(alias="certifiedFlag")] = None id: int | None = None - skill: SkillReference - skill_level: Literal["Beginner", "Intermediate", "Advanced", "Expert"] = Field( - ..., alias="skillLevel" - ) - certified_flag: bool | None = Field(default=None, alias="certifiedFlag") - years_experience: int | None = Field(default=None, alias="yearsExperience") - notes: str | None = None member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + notes: str | None = None + skill: SkillReference + skill_level: Annotated[Literal["Beginner", "Intermediate", "Advanced", "Expert"], Field(alias="skillLevel")] + years_experience: Annotated[int | None, Field(alias="yearsExperience")] = None -class MemberTemplate(ConnectWiseModel): - id: int | None = None - identifier: str +class MenuEntry(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_locations: Annotated[bool | None, Field(alias="addAllLocations")] = None + caption: str """ Max length: 50; """ - template_description: str | None = Field(default=None, alias="templateDescription") + client_id: Annotated[str | None, Field(alias="clientId")] = None """ - Max length: 1024; + Only required if not already set Max length: 36; """ - title: str | None = None - report_card: ReportCardReference | None = Field(default=None, alias="reportCard") - enable_mobile_flag: bool | None = Field(default=None, alias="enableMobileFlag") - type: MemberTypeReference | None = None - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - partner_portal_flag: bool | None = Field(default=None, alias="partnerPortalFlag") - sts_user_admin_url: str | None = Field(default=None, alias="stsUserAdminUrl") - toast_notification_flag: bool | None = Field( - default=None, alias="toastNotificationFlag" - ) - member_personas: list[int] | None = Field(default=None, alias="memberPersonas") - admin_flag: bool | None = Field(default=None, alias="adminFlag") - structure_level: StructureReference | None = Field( - default=None, alias="structureLevel" - ) - security_location: SystemLocationReference | None = Field( - default=None, alias="securityLocation" - ) - default_location: SystemLocationReference | None = Field( - default=None, alias="defaultLocation" - ) - default_department: SystemDepartmentReference | None = Field( - default=None, alias="defaultDepartment" - ) - reports_to: MemberReference | None = Field(default=None, alias="reportsTo") - restrict_location_flag: bool | None = Field( - default=None, alias="restrictLocationFlag" - ) - restrict_department_flag: bool | None = Field( - default=None, alias="restrictDepartmentFlag" - ) - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - time_approver: MemberReference | None = Field(default=None, alias="timeApprover") - expense_approver: MemberReference | None = Field( - default=None, alias="expenseApprover" - ) - billable_forecast: float | None = Field(default=None, alias="billableForecast") - daily_capacity: float | None = Field(default=None, alias="dailyCapacity") - hourly_cost: float | None = Field(default=None, alias="hourlyCost") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - include_in_utilization_reporting_flag: bool | None = Field( - default=None, alias="includeInUtilizationReportingFlag" - ) - require_expense_entry_flag: bool | None = Field( - default=None, alias="requireExpenseEntryFlag" - ) - require_time_sheet_entry_flag: bool | None = Field( - default=None, alias="requireTimeSheetEntryFlag" - ) - require_start_and_end_time_on_time_entry_flag: bool | None = Field( - default=None, alias="requireStartAndEndTimeOnTimeEntryFlag" - ) - allow_in_cell_entry_on_time_sheet: bool | None = Field( - default=None, alias="allowInCellEntryOnTimeSheet" - ) - enter_time_against_company_flag: bool | None = Field( - default=None, alias="enterTimeAgainstCompanyFlag" - ) - allow_expenses_entered_against_companies_flag: bool | None = Field( - default=None, alias="allowExpensesEnteredAgainstCompaniesFlag" - ) - time_reminder_email_flag: bool | None = Field( - default=None, alias="timeReminderEmailFlag" - ) - days_tolerance: int | None = Field(default=None, alias="daysTolerance") - minimum_hours: float | None = Field(default=None, alias="minimumHours") - time_sheet_start_date: str | None = Field(default=None, alias="timeSheetStartDate") - service_default_location: SystemLocationReference | None = Field( - default=None, alias="serviceDefaultLocation" - ) - service_default_department: SystemDepartmentReference | None = Field( - default=None, alias="serviceDefaultDepartment" - ) - service_default_board: BoardReference | None = Field( - default=None, alias="serviceDefaultBoard" - ) - restrict_service_default_location_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultLocationFlag" - ) - restrict_service_default_department_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultDepartmentFlag" - ) - excluded_service_board_ids: list[int] | None = Field( - default=None, alias="excludedServiceBoardIds" - ) - teams: list[int] | None = None - service_board_team_ids: list[int] | None = Field( - default=None, alias="serviceBoardTeamIds" - ) - project_default_location: SystemLocationReference | None = Field( - default=None, alias="projectDefaultLocation" - ) - project_default_department: SystemDepartmentReference | None = Field( - default=None, alias="projectDefaultDepartment" - ) - project_default_board: ProjectBoardReference | None = Field( - default=None, alias="projectDefaultBoard" - ) - restrict_project_default_location_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultLocationFlag" - ) - restrict_project_default_department_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultDepartmentFlag" - ) - excluded_project_board_ids: list[int] | None = Field( - default=None, alias="excludedProjectBoardIds" - ) - schedule_default_location: SystemLocationReference | None = Field( - default=None, alias="scheduleDefaultLocation" - ) - schedule_default_department: SystemDepartmentReference | None = Field( - default=None, alias="scheduleDefaultDepartment" - ) - schedule_capacity: float | None = Field(default=None, alias="scheduleCapacity") - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - restrict_schedule_flag: bool | None = Field( - default=None, alias="restrictScheduleFlag" - ) - hide_member_in_dispatch_portal_flag: bool | None = Field( - default=None, alias="hideMemberInDispatchPortalFlag" - ) - calendar: CalendarReference | None = None - sales_default_location: SystemLocationReference | None = Field( - default=None, alias="salesDefaultLocation" - ) - restrict_default_sales_territory_flag: bool | None = Field( - default=None, alias="restrictDefaultSalesTerritoryFlag" - ) - warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - restrict_default_warehouse_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseFlag" - ) - restrict_default_warehouse_bin_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseBinFlag" - ) - company_activity_tab_format: Literal["SummaryList", "DetailList"] | None = Field( - default=None, alias="companyActivityTabFormat" - ) - invoice_time_tab_format: Literal["SummaryList", "DetailList"] | None = Field( - default=None, alias="invoiceTimeTabFormat" - ) - invoice_screen_default_tab_format: Literal[ - "ShowInvoicingTab", "ShowAgreementInvoicingTab" - ] | None = Field(default=None, alias="invoiceScreenDefaultTabFormat") - invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] | None = Field(default=None, alias="invoicingDisplayOptions") - agreement_invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] | None = Field(default=None, alias="agreementInvoicingDisplayOptions") - auto_start_stopwatch: bool | None = Field(default=None, alias="autoStartStopwatch") - auto_popup_quick_notes_with_stopwatch: bool | None = Field( - default=None, alias="autoPopupQuickNotesWithStopwatch" - ) - global_search_default_ticket_filter: Literal[ - "OpenRecords", "ClosedRecords", "AllRecords" - ] | None = Field(default=None, alias="globalSearchDefaultTicketFilter") - global_search_default_sort: Literal[ - "None", "LastUpdatedDesc", "LastUpdatedAsc", "CreatedDesc", "CreatedAsc" - ] | None = Field(default=None, alias="globalSearchDefaultSort") - phone_source: str | None = Field(default=None, alias="phoneSource") - info: dict[str, str] | None = Field(default=None, alias="_info") - copy_pod_layouts: bool | None = Field(default=None, alias="copyPodLayouts") - copy_shared_default_views: bool | None = Field( - default=None, alias="copySharedDefaultViews" - ) - copy_column_layouts_and_filters: bool | None = Field( - default=None, alias="copyColumnLayoutsAndFilters" - ) - from_member_rec_id: int | None = Field(default=None, alias="fromMemberRecId") - from_member_template_rec_id: int | None = Field( - default=None, alias="fromMemberTemplateRecId" - ) - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) - - -class MenuEntry(ConnectWiseModel): id: int | None = None - menu_location: MenuLocationReference | None = Field( - default=None, alias="menuLocation" - ) - caption: str - """ - Max length: 50; - """ + large_menu_icon_id: Annotated[int | None, Field(alias="largeMenuIconId")] = None link: str """ Max length: 2000; """ - new_window_flag: bool = Field(..., alias="newWindowFlag") - location_ids: list[int] | None = Field(default=None, alias="locationIds") + location_ids: Annotated[list[int] | None, Field(alias="locationIds")] = None + menu_location: Annotated[MenuLocationReference | None, Field(alias="menuLocation")] = None + new_window_flag: Annotated[bool, Field(alias="newWindowFlag")] origin: str | None = None """ Max length: 2000; """ - client_id: str | None = Field(default=None, alias="clientId") - """ - Only required if not already set Max length: 36; - """ - add_all_locations: bool | None = Field(default=None, alias="addAllLocations") - remove_all_locations: bool | None = Field(default=None, alias="removeAllLocations") - small_menu_icon_id: int | None = Field(default=None, alias="smallMenuIconId") - large_menu_icon_id: int | None = Field(default=None, alias="largeMenuIconId") - info: dict[str, str] | None = Field(default=None, alias="_info") + remove_all_locations: Annotated[bool | None, Field(alias="removeAllLocations")] = None + small_menu_icon_id: Annotated[int | None, Field(alias="smallMenuIconId")] = None class MenuEntryLocation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None location: SystemLocationReference | None = None - menu_entry: SystemMenuEntryReference | None = Field(default=None, alias="menuEntry") - info: dict[str, str] | None = Field(default=None, alias="_info") + menu_entry: Annotated[SystemMenuEntryReference | None, Field(alias="menuEntry")] = None class MinimumStockByWarehouse(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None + minimum_stock: Annotated[int, Field(alias="minimumStock")] warehouse: WarehouseReference - minimum_stock: int = Field(..., alias="minimumStock") - info: dict[str, str] | None = Field(default=None, alias="_info") class MyAccount(ConnectWiseModel): - id: int | None = None - identifier: str - """ - Max length: 15; - """ - password: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_invoicing_display_options: Annotated[ + Literal["RemainOnInvoicingScreen", "ShowRecentInvoices"], Field(alias="agreementInvoicingDisplayOptions") + ] + allow_expenses_entered_against_companies_flag: Annotated[ + bool | None, Field(alias="allowExpensesEnteredAgainstCompaniesFlag") + ] = None + allow_in_cell_entry_on_time_sheet: Annotated[bool | None, Field(alias="allowInCellEntryOnTimeSheet")] = None + authentication_service_type: Annotated[ + Literal["AuthAnvil", "GoogleAuthenticator", "Email"] | None, Field(alias="authenticationServiceType") + ] = None + auto_popup_quick_notes_with_stopwatch: Annotated[ + bool | None, Field(alias="autoPopupQuickNotesWithStopwatch") + ] = None + auto_start_stopwatch: Annotated[bool | None, Field(alias="autoStartStopwatch")] = None + billable_forecast: Annotated[float | None, Field(alias="billableForecast")] = None + calendar: CalendarReference | None = None + calendar_sync_integration_flag: Annotated[bool | None, Field(alias="calendarSyncIntegrationFlag")] = None + client_id: Annotated[str | None, Field(alias="clientId")] = None + company_activity_tab_format: Annotated[ + Literal["SummaryList", "DetailList"], Field(alias="companyActivityTabFormat") + ] + copy_column_layouts_and_filters: Annotated[bool | None, Field(alias="copyColumnLayoutsAndFilters")] = None + copy_pod_layouts: Annotated[bool | None, Field(alias="copyPodLayouts")] = None + copy_shared_default_views: Annotated[bool | None, Field(alias="copySharedDefaultViews")] = None + country: CountryReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + daily_capacity: Annotated[float | None, Field(alias="dailyCapacity")] = None + days_tolerance: Annotated[int | None, Field(alias="daysTolerance")] = None + default_department: Annotated[SystemDepartmentReference | None, Field(alias="defaultDepartment")] = None + default_email: Annotated[Literal["Office", "Mobile", "Home"], Field(alias="defaultEmail")] + default_location: Annotated[SystemLocationReference | None, Field(alias="defaultLocation")] = None + default_phone: Annotated[Literal["Office", "Mobile", "Home"], Field(alias="defaultPhone")] + disable_online_flag: Annotated[bool | None, Field(alias="disableOnlineFlag")] = None + employee_identifer: Annotated[str | None, Field(alias="employeeIdentifer")] = None """ - ConditionallyRequired. API Member will get random password generated Max length: 60; + Max length: 10; """ - first_name: str = Field(..., alias="firstName") + enable_mobile_flag: Annotated[bool | None, Field(alias="enableMobileFlag")] = None + enable_mobile_gps_flag: Annotated[bool | None, Field(alias="enableMobileGpsFlag")] = None + enter_time_against_company_flag: Annotated[bool | None, Field(alias="enterTimeAgainstCompanyFlag")] = None + expense_approver: Annotated[MemberReference | None, Field(alias="expenseApprover")] = None + first_name: Annotated[str, Field(alias="firstName")] """ Max length: 30; """ - middle_initial: str | None = Field(default=None, alias="middleInitial") + from_member_rec_id: Annotated[int | None, Field(alias="fromMemberRecId")] = None + global_search_default_sort: Annotated[ + Literal["None", "LastUpdatedDesc", "LastUpdatedAsc", "CreatedDesc", "CreatedAsc"] | None, + Field(alias="globalSearchDefaultSort"), + ] = None + global_search_default_ticket_filter: Annotated[ + Literal["OpenRecords", "ClosedRecords", "AllRecords"] | None, Field(alias="globalSearchDefaultTicketFilter") + ] = None + hide_member_in_dispatch_portal_flag: Annotated[bool | None, Field(alias="hideMemberInDispatchPortalFlag")] = None + hire_date: Annotated[datetime, Field(alias="hireDate")] + home_email: Annotated[str | None, Field(alias="homeEmail")] = None """ - Max length: 1; + Max length: 250; """ - last_name: str = Field(..., alias="lastName") + home_extension: Annotated[str | None, Field(alias="homeExtension")] = None """ - Max length: 30; + Max length: 10; """ - title: str | None = None + home_phone: Annotated[str | None, Field(alias="homePhone")] = None """ - Max length: 50; + Max length: 15; """ - report_card: ReportCardReference | None = Field(default=None, alias="reportCard") - license_class: Literal["A", "C", "F", "X"] = Field(..., alias="licenseClass") + id: int | None = None + identifier: str """ - F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member + Max length: 15; """ - disable_online_flag: bool | None = Field(default=None, alias="disableOnlineFlag") - enable_mobile_flag: bool | None = Field(default=None, alias="enableMobileFlag") - type: MemberTypeReference | None = None - employee_identifer: str | None = Field(default=None, alias="employeeIdentifer") + inactive_date: Annotated[datetime | None, Field(alias="inactiveDate")] = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + include_in_utilization_reporting_flag: Annotated[ + bool | None, Field(alias="includeInUtilizationReportingFlag") + ] = None + invoice_screen_default_tab_format: Annotated[ + Literal["ShowInvoicingTab", "ShowAgreementInvoicingTab"], Field(alias="invoiceScreenDefaultTabFormat") + ] + invoice_time_tab_format: Annotated[Literal["SummaryList", "DetailList"], Field(alias="invoiceTimeTabFormat")] + invoicing_display_options: Annotated[ + Literal["RemainOnInvoicingScreen", "ShowRecentInvoices"], Field(alias="invoicingDisplayOptions") + ] + last_login: Annotated[str | None, Field(alias="lastLogin")] = None + last_name: Annotated[str, Field(alias="lastName")] """ - Max length: 10; + Max length: 30; """ - vendor_number: str | None = Field(default=None, alias="vendorNumber") - notes: str | None = None - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - country: CountryReference | None = None - service_board_team_ids: list[int] | None = Field( - default=None, alias="serviceBoardTeamIds" - ) - enable_mobile_gps_flag: bool | None = Field( - default=None, alias="enableMobileGpsFlag" - ) - inactive_date: datetime | None = Field(default=None, alias="inactiveDate") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - last_login: str | None = Field(default=None, alias="lastLogin") - photo: DocumentReference | None = None - partner_portal_flag: bool | None = Field(default=None, alias="partnerPortalFlag") - client_id: str | None = Field(default=None, alias="clientId") - sts_user_admin_url: str | None = Field(default=None, alias="stsUserAdminUrl") - token: str | None = None - toast_notification_flag: bool | None = Field( - default=None, alias="toastNotificationFlag" - ) - member_personas: list[int] | None = Field(default=None, alias="memberPersonas") - office365: MemberOffice365 | None = None - office_email: str | None = Field(default=None, alias="officeEmail") + license_class: Annotated[Literal["A", "C", "F", "X"], Field(alias="licenseClass")] """ - Max length: 250; + F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member """ - office_phone: str | None = Field(default=None, alias="officePhone") + mapi_name: Annotated[str | None, Field(alias="mapiName")] = None + member_personas: Annotated[list[int] | None, Field(alias="memberPersonas")] = None + middle_initial: Annotated[str | None, Field(alias="middleInitial")] = None """ - Max length: 15; + Max length: 1; """ - office_extension: str | None = Field(default=None, alias="officeExtension") + minimum_hours: Annotated[float | None, Field(alias="minimumHours")] = None + mobile_email: Annotated[str | None, Field(alias="mobileEmail")] = None """ - Max length: 10; + Max length: 250; """ - mobile_email: str | None = Field(default=None, alias="mobileEmail") + mobile_extension: Annotated[str | None, Field(alias="mobileExtension")] = None """ - Max length: 250; + Max length: 10; """ - mobile_phone: str | None = Field(default=None, alias="mobilePhone") + mobile_phone: Annotated[str | None, Field(alias="mobilePhone")] = None """ Max length: 15; """ - mobile_extension: str | None = Field(default=None, alias="mobileExtension") + notes: str | None = None + office365: MemberOffice365 | None = None + office_email: Annotated[str | None, Field(alias="officeEmail")] = None """ - Max length: 10; + Max length: 250; """ - home_email: str | None = Field(default=None, alias="homeEmail") + office_extension: Annotated[str | None, Field(alias="officeExtension")] = None """ - Max length: 250; + Max length: 10; """ - home_phone: str | None = Field(default=None, alias="homePhone") + office_phone: Annotated[str | None, Field(alias="officePhone")] = None """ Max length: 15; """ - home_extension: str | None = Field(default=None, alias="homeExtension") + partner_portal_flag: Annotated[bool | None, Field(alias="partnerPortalFlag")] = None + password: str | None = None """ - Max length: 10; + ConditionallyRequired. API Member will get random password generated Max length: 60; """ - default_email: Literal["Office", "Mobile", "Home"] = Field( - ..., alias="defaultEmail" - ) - primary_email: str | None = Field(default=None, alias="primaryEmail") + phone_integration_type: Annotated[ + Literal["TAPI", "SKYPE", "NONE"] | None, Field(alias="phoneIntegrationType") + ] = None + phone_source: Annotated[str | None, Field(alias="phoneSource")] = None + photo: DocumentReference | None = None + primary_email: Annotated[str | None, Field(alias="primaryEmail")] = None """ Max length: 250; """ - default_phone: Literal["Office", "Mobile", "Home"] = Field( - ..., alias="defaultPhone" - ) - default_location: SystemLocationReference | None = Field( - default=None, alias="defaultLocation" - ) - default_department: SystemDepartmentReference | None = Field( - default=None, alias="defaultDepartment" - ) - reports_to: MemberReference | None = Field(default=None, alias="reportsTo") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - time_approver: MemberReference | None = Field(default=None, alias="timeApprover") - expense_approver: MemberReference | None = Field( - default=None, alias="expenseApprover" - ) - billable_forecast: float | None = Field(default=None, alias="billableForecast") - daily_capacity: float | None = Field(default=None, alias="dailyCapacity") - include_in_utilization_reporting_flag: bool | None = Field( - default=None, alias="includeInUtilizationReportingFlag" - ) - require_expense_entry_flag: bool | None = Field( - default=None, alias="requireExpenseEntryFlag" - ) - require_time_sheet_entry_flag: bool | None = Field( - default=None, alias="requireTimeSheetEntryFlag" - ) - require_start_and_end_time_on_time_entry_flag: bool | None = Field( - default=None, alias="requireStartAndEndTimeOnTimeEntryFlag" - ) - allow_in_cell_entry_on_time_sheet: bool | None = Field( - default=None, alias="allowInCellEntryOnTimeSheet" - ) - enter_time_against_company_flag: bool | None = Field( - default=None, alias="enterTimeAgainstCompanyFlag" - ) - allow_expenses_entered_against_companies_flag: bool | None = Field( - default=None, alias="allowExpensesEnteredAgainstCompaniesFlag" - ) - time_reminder_email_flag: bool | None = Field( - default=None, alias="timeReminderEmailFlag" - ) - days_tolerance: int | None = Field(default=None, alias="daysTolerance") - minimum_hours: float | None = Field(default=None, alias="minimumHours") - time_sheet_start_date: datetime | None = Field( - default=None, alias="timeSheetStartDate" - ) - hire_date: datetime = Field(..., alias="hireDate") - service_default_location: SystemLocationReference | None = Field( - default=None, alias="serviceDefaultLocation" - ) - service_default_department: SystemDepartmentReference | None = Field( - default=None, alias="serviceDefaultDepartment" - ) - service_default_board: BoardReference | None = Field( - default=None, alias="serviceDefaultBoard" - ) - project_default_location: SystemLocationReference | None = Field( - default=None, alias="projectDefaultLocation" - ) - project_default_department: SystemDepartmentReference | None = Field( - default=None, alias="projectDefaultDepartment" - ) - project_default_board: ProjectBoardReference | None = Field( - default=None, alias="projectDefaultBoard" - ) - schedule_default_location: SystemLocationReference | None = Field( - default=None, alias="scheduleDefaultLocation" - ) - schedule_default_department: SystemDepartmentReference | None = Field( - default=None, alias="scheduleDefaultDepartment" - ) - schedule_capacity: float | None = Field(default=None, alias="scheduleCapacity") - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - hide_member_in_dispatch_portal_flag: bool | None = Field( - default=None, alias="hideMemberInDispatchPortalFlag" - ) - calendar: CalendarReference | None = None - sales_default_location: SystemLocationReference | None = Field( - default=None, alias="salesDefaultLocation" - ) - warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - mapi_name: str | None = Field(default=None, alias="mapiName") - calendar_sync_integration_flag: bool | None = Field( - default=None, alias="calendarSyncIntegrationFlag" - ) - company_activity_tab_format: Literal["SummaryList", "DetailList"] = Field( - ..., alias="companyActivityTabFormat" - ) - invoice_time_tab_format: Literal["SummaryList", "DetailList"] = Field( - ..., alias="invoiceTimeTabFormat" - ) - invoice_screen_default_tab_format: Literal[ - "ShowInvoicingTab", "ShowAgreementInvoicingTab" - ] = Field(..., alias="invoiceScreenDefaultTabFormat") - invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] = Field(..., alias="invoicingDisplayOptions") - agreement_invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] = Field(..., alias="agreementInvoicingDisplayOptions") - authentication_service_type: Literal[ - "AuthAnvil", "GoogleAuthenticator", "Email" - ] | None = Field(default=None, alias="authenticationServiceType") - timebased_one_time_password_activated: bool | None = Field( - default=None, alias="timebasedOneTimePasswordActivated" - ) - directional_sync: DirectionalSyncReference | None = Field( - default=None, alias="directionalSync" - ) - auto_start_stopwatch: bool | None = Field(default=None, alias="autoStartStopwatch") - auto_popup_quick_notes_with_stopwatch: bool | None = Field( - default=None, alias="autoPopupQuickNotesWithStopwatch" - ) + project_default_board: Annotated[ProjectBoardReference | None, Field(alias="projectDefaultBoard")] = None + project_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="projectDefaultDepartment") + ] = None + project_default_location: Annotated[SystemLocationReference | None, Field(alias="projectDefaultLocation")] = None + report_card: Annotated[ReportCardReference | None, Field(alias="reportCard")] = None + reports_to: Annotated[MemberReference | None, Field(alias="reportsTo")] = None + require_expense_entry_flag: Annotated[bool | None, Field(alias="requireExpenseEntryFlag")] = None + require_start_and_end_time_on_time_entry_flag: Annotated[ + bool | None, Field(alias="requireStartAndEndTimeOnTimeEntryFlag") + ] = None + require_time_sheet_entry_flag: Annotated[bool | None, Field(alias="requireTimeSheetEntryFlag")] = None + sales_default_location: Annotated[SystemLocationReference | None, Field(alias="salesDefaultLocation")] = None + schedule_capacity: Annotated[float | None, Field(alias="scheduleCapacity")] = None + schedule_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="scheduleDefaultDepartment") + ] = None + schedule_default_location: Annotated[SystemLocationReference | None, Field(alias="scheduleDefaultLocation")] = None + service_board_team_ids: Annotated[list[int] | None, Field(alias="serviceBoardTeamIds")] = None + service_default_board: Annotated[BoardReference | None, Field(alias="serviceDefaultBoard")] = None + service_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="serviceDefaultDepartment") + ] = None + service_default_location: Annotated[SystemLocationReference | None, Field(alias="serviceDefaultLocation")] = None + service_location: Annotated[ServiceLocationReference | None, Field(alias="serviceLocation")] = None signature: str | None = None - global_search_default_ticket_filter: Literal[ - "OpenRecords", "ClosedRecords", "AllRecords" - ] | None = Field(default=None, alias="globalSearchDefaultTicketFilter") - global_search_default_sort: Literal[ - "None", "LastUpdatedDesc", "LastUpdatedAsc", "CreatedDesc", "CreatedAsc" - ] | None = Field(default=None, alias="globalSearchDefaultSort") - phone_source: str | None = Field(default=None, alias="phoneSource") - phone_integration_type: Literal[ - "TAPI", "SKYPE", "TEL", "CALLTO", "NONE" - ] | None = Field(default=None, alias="phoneIntegrationType") - use_browser_language_flag: bool | None = Field( - default=None, alias="useBrowserLanguageFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - copy_pod_layouts: bool | None = Field(default=None, alias="copyPodLayouts") - copy_shared_default_views: bool | None = Field( - default=None, alias="copySharedDefaultViews" - ) - copy_column_layouts_and_filters: bool | None = Field( - default=None, alias="copyColumnLayoutsAndFilters" - ) - from_member_rec_id: int | None = Field(default=None, alias="fromMemberRecId") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + sts_user_admin_url: Annotated[str | None, Field(alias="stsUserAdminUrl")] = None + time_approver: Annotated[MemberReference | None, Field(alias="timeApprover")] = None + time_reminder_email_flag: Annotated[bool | None, Field(alias="timeReminderEmailFlag")] = None + time_sheet_start_date: Annotated[datetime | None, Field(alias="timeSheetStartDate")] = None + time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="timeZone")] = None + timebased_one_time_password_activated: Annotated[ + bool | None, Field(alias="timebasedOneTimePasswordActivated") + ] = None + title: str | None = None + """ + Max length: 50; + """ + toast_notification_flag: Annotated[bool | None, Field(alias="toastNotificationFlag")] = None + token: str | None = None + type: MemberTypeReference | None = None + use_browser_language_flag: Annotated[bool | None, Field(alias="useBrowserLanguageFlag")] = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None + warehouse: WarehouseReference | None = None + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class MyMember(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + admin_flag: Annotated[bool | None, Field(alias="adminFlag")] = None + agreement_invoicing_display_options: Annotated[ + Literal["RemainOnInvoicingScreen", "ShowRecentInvoices"] | None, Field(alias="agreementInvoicingDisplayOptions") + ] = None + allow_expenses_entered_against_companies_flag: Annotated[ + bool | None, Field(alias="allowExpensesEnteredAgainstCompaniesFlag") + ] = None + allow_in_cell_entry_on_time_sheet: Annotated[bool | None, Field(alias="allowInCellEntryOnTimeSheet")] = None + authentication_service_type: Annotated[ + Literal["AuthAnvil", "GoogleAuthenticator", "Email"] | None, Field(alias="authenticationServiceType") + ] = None + billable_forecast: Annotated[float | None, Field(alias="billableForecast")] = None + calendar: CalendarReference | None = None + calendar_sync_integration_flag: Annotated[bool | None, Field(alias="calendarSyncIntegrationFlag")] = None + company_activity_tab_format: Annotated[ + Literal["SummaryList", "DetailList"] | None, Field(alias="companyActivityTabFormat") + ] = None + corelytics_password: Annotated[str | None, Field(alias="corelyticsPassword")] = None + corelytics_username: Annotated[str | None, Field(alias="corelyticsUsername")] = None + country: CountryReference | None = None + daily_capacity: Annotated[float | None, Field(alias="dailyCapacity")] = None + days_tolerance: Annotated[int | None, Field(alias="daysTolerance")] = None + default_department: Annotated[SystemDepartmentReference | None, Field(alias="defaultDepartment")] = None + default_email: Annotated[Literal["Office", "Mobile", "Home"] | None, Field(alias="defaultEmail")] = None + default_location: Annotated[SystemLocationReference | None, Field(alias="defaultLocation")] = None + default_phone: Annotated[Literal["Office", "Mobile", "Home"] | None, Field(alias="defaultPhone")] = None + disable_online_flag: Annotated[bool | None, Field(alias="disableOnlineFlag")] = None + employee_identifer: Annotated[str | None, Field(alias="employeeIdentifer")] = None + enable_ldap_authentication_flag: Annotated[bool | None, Field(alias="enableLdapAuthenticationFlag")] = None + enable_mobile_flag: Annotated[bool | None, Field(alias="enableMobileFlag")] = None + enable_mobile_gps_flag: Annotated[bool | None, Field(alias="enableMobileGpsFlag")] = None + enter_time_against_company_flag: Annotated[bool | None, Field(alias="enterTimeAgainstCompanyFlag")] = None + excluded_project_board_ids: Annotated[list[int] | None, Field(alias="excludedProjectBoardIds")] = None + excluded_service_board_ids: Annotated[list[int] | None, Field(alias="excludedServiceBoardIds")] = None + expense_approver: Annotated[MemberReference | None, Field(alias="expenseApprover")] = None + first_name: Annotated[str | None, Field(alias="firstName")] = None + hide_member_in_dispatch_portal_flag: Annotated[bool | None, Field(alias="hideMemberInDispatchPortalFlag")] = None + hire_date: Annotated[datetime | None, Field(alias="hireDate")] = None + home_email: Annotated[str | None, Field(alias="homeEmail")] = None + home_extension: Annotated[str | None, Field(alias="homeExtension")] = None + home_phone: Annotated[str | None, Field(alias="homePhone")] = None + hourly_cost: Annotated[float | None, Field(alias="hourlyCost")] = None + hourly_rate: Annotated[float | None, Field(alias="hourlyRate")] = None id: int | None = None identifier: str | None = None + inactive_date: Annotated[datetime | None, Field(alias="inactiveDate")] = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + include_in_utilization_reporting_flag: Annotated[ + bool | None, Field(alias="includeInUtilizationReportingFlag") + ] = None + invoice_screen_default_tab_format: Annotated[ + Literal["ShowInvoicingTab", "ShowAgreementInvoicingTab"] | None, Field(alias="invoiceScreenDefaultTabFormat") + ] = None + invoice_time_tab_format: Annotated[ + Literal["SummaryList", "DetailList"] | None, Field(alias="invoiceTimeTabFormat") + ] = None + invoicing_display_options: Annotated[ + Literal["RemainOnInvoicingScreen", "ShowRecentInvoices"] | None, Field(alias="invoicingDisplayOptions") + ] = None + last_login: Annotated[str | None, Field(alias="lastLogin")] = None + last_name: Annotated[str | None, Field(alias="lastName")] = None + ldap_configuration: Annotated[LdapConfigurationReference | None, Field(alias="ldapConfiguration")] = None + ldap_user_name: Annotated[str | None, Field(alias="ldapUserName")] = None + license_class: Annotated[Literal["A", "C", "F", "X"] | None, Field(alias="licenseClass")] = None + """ + F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member + """ + mapi_name: Annotated[str | None, Field(alias="mapiName")] = None + middle_initial: Annotated[str | None, Field(alias="middleInitial")] = None + minimum_hours: Annotated[float | None, Field(alias="minimumHours")] = None + mobile_email: Annotated[str | None, Field(alias="mobileEmail")] = None + mobile_extension: Annotated[str | None, Field(alias="mobileExtension")] = None + mobile_phone: Annotated[str | None, Field(alias="mobilePhone")] = None + notes: str | None = None + office_email: Annotated[str | None, Field(alias="officeEmail")] = None + office_extension: Annotated[str | None, Field(alias="officeExtension")] = None + office_phone: Annotated[str | None, Field(alias="officePhone")] = None password: str | None = None """ ConditionallyRequired. API Member will get random password generated """ - first_name: str | None = Field(default=None, alias="firstName") - middle_initial: str | None = Field(default=None, alias="middleInitial") - last_name: str | None = Field(default=None, alias="lastName") + photo: DocumentReference | None = None + project_default_board: Annotated[ProjectBoardReference | None, Field(alias="projectDefaultBoard")] = None + project_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="projectDefaultDepartment") + ] = None + project_default_location: Annotated[SystemLocationReference | None, Field(alias="projectDefaultLocation")] = None + report_card: Annotated[ReportCardReference | None, Field(alias="reportCard")] = None + reports_to: Annotated[MemberReference | None, Field(alias="reportsTo")] = None + require_expense_entry_flag: Annotated[bool | None, Field(alias="requireExpenseEntryFlag")] = None + require_start_and_end_time_on_time_entry_flag: Annotated[ + bool | None, Field(alias="requireStartAndEndTimeOnTimeEntryFlag") + ] = None + require_time_sheet_entry_flag: Annotated[bool | None, Field(alias="requireTimeSheetEntryFlag")] = None + restrict_default_sales_territory_flag: Annotated[ + bool | None, Field(alias="restrictDefaultSalesTerritoryFlag") + ] = None + restrict_default_warehouse_bin_flag: Annotated[bool | None, Field(alias="restrictDefaultWarehouseBinFlag")] = None + restrict_default_warehouse_flag: Annotated[bool | None, Field(alias="restrictDefaultWarehouseFlag")] = None + restrict_department_flag: Annotated[bool | None, Field(alias="restrictDepartmentFlag")] = None + restrict_location_flag: Annotated[bool | None, Field(alias="restrictLocationFlag")] = None + restrict_project_default_department_flag: Annotated[ + bool | None, Field(alias="restrictProjectDefaultDepartmentFlag") + ] = None + restrict_project_default_location_flag: Annotated[ + bool | None, Field(alias="restrictProjectDefaultLocationFlag") + ] = None + restrict_schedule_flag: Annotated[bool | None, Field(alias="restrictScheduleFlag")] = None + restrict_service_default_department_flag: Annotated[ + bool | None, Field(alias="restrictServiceDefaultDepartmentFlag") + ] = None + restrict_service_default_location_flag: Annotated[ + bool | None, Field(alias="restrictServiceDefaultLocationFlag") + ] = None + sales_default_location: Annotated[SystemLocationReference | None, Field(alias="salesDefaultLocation")] = None + schedule_capacity: Annotated[float | None, Field(alias="scheduleCapacity")] = None + schedule_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="scheduleDefaultDepartment") + ] = None + schedule_default_location: Annotated[SystemLocationReference | None, Field(alias="scheduleDefaultLocation")] = None + security_location: Annotated[SystemLocationReference | None, Field(alias="securityLocation")] = None + security_role: Annotated[SecurityRoleReference | None, Field(alias="securityRole")] = None + service_board_team_ids: Annotated[list[int] | None, Field(alias="serviceBoardTeamIds")] = None + service_default_board: Annotated[BoardReference | None, Field(alias="serviceDefaultBoard")] = None + service_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="serviceDefaultDepartment") + ] = None + service_default_location: Annotated[SystemLocationReference | None, Field(alias="serviceDefaultLocation")] = None + service_location: Annotated[ServiceLocationReference | None, Field(alias="serviceLocation")] = None + sso_client_id: Annotated[str | None, Field(alias="ssoClientId")] = None + sso_session_flag: Annotated[bool | None, Field(alias="ssoSessionFlag")] = None + structure_level: Annotated[StructureReference | None, Field(alias="structureLevel")] = None + time_approver: Annotated[MemberReference | None, Field(alias="timeApprover")] = None + time_reminder_email_flag: Annotated[bool | None, Field(alias="timeReminderEmailFlag")] = None + time_sheet_start_date: Annotated[datetime | None, Field(alias="timeSheetStartDate")] = None + time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="timeZone")] = None + timebased_one_time_password_activated: Annotated[ + bool | None, Field(alias="timebasedOneTimePasswordActivated") + ] = None title: str | None = None - report_card: ReportCardReference | None = Field(default=None, alias="reportCard") - license_class: Literal["A", "C", "F", "X"] | None = Field( - default=None, alias="licenseClass" - ) - """ - F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member - """ - disable_online_flag: bool | None = Field(default=None, alias="disableOnlineFlag") - enable_mobile_flag: bool | None = Field(default=None, alias="enableMobileFlag") + toast_notification_flag: Annotated[bool | None, Field(alias="toastNotificationFlag")] = None type: MemberTypeReference | None = None - employee_identifer: str | None = Field(default=None, alias="employeeIdentifer") - vendor_number: str | None = Field(default=None, alias="vendorNumber") - notes: str | None = None - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - country: CountryReference | None = None - service_board_team_ids: list[int] | None = Field( - default=None, alias="serviceBoardTeamIds" - ) - enable_mobile_gps_flag: bool | None = Field( - default=None, alias="enableMobileGpsFlag" - ) - inactive_date: str | None = Field(default=None, alias="inactiveDate") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - last_login: str | None = Field(default=None, alias="lastLogin") - photo: DocumentReference | None = None - toast_notification_flag: bool | None = Field( - default=None, alias="toastNotificationFlag" - ) - office_email: str | None = Field(default=None, alias="officeEmail") - office_phone: str | None = Field(default=None, alias="officePhone") - office_extension: str | None = Field(default=None, alias="officeExtension") - mobile_email: str | None = Field(default=None, alias="mobileEmail") - mobile_phone: str | None = Field(default=None, alias="mobilePhone") - mobile_extension: str | None = Field(default=None, alias="mobileExtension") - home_email: str | None = Field(default=None, alias="homeEmail") - home_phone: str | None = Field(default=None, alias="homePhone") - home_extension: str | None = Field(default=None, alias="homeExtension") - default_email: Literal["Office", "Mobile", "Home"] | None = Field( - default=None, alias="defaultEmail" - ) - default_phone: Literal["Office", "Mobile", "Home"] | None = Field( - default=None, alias="defaultPhone" - ) - security_role: SecurityRoleReference | None = Field( - default=None, alias="securityRole" - ) - admin_flag: bool | None = Field(default=None, alias="adminFlag") - structure_level: StructureReference | None = Field( - default=None, alias="structureLevel" - ) - security_location: SystemLocationReference | None = Field( - default=None, alias="securityLocation" - ) - default_location: SystemLocationReference | None = Field( - default=None, alias="defaultLocation" - ) - default_department: SystemDepartmentReference | None = Field( - default=None, alias="defaultDepartment" - ) - reports_to: MemberReference | None = Field(default=None, alias="reportsTo") - restrict_location_flag: bool | None = Field( - default=None, alias="restrictLocationFlag" - ) - restrict_department_flag: bool | None = Field( - default=None, alias="restrictDepartmentFlag" - ) - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - time_approver: MemberReference | None = Field(default=None, alias="timeApprover") - expense_approver: MemberReference | None = Field( - default=None, alias="expenseApprover" - ) - billable_forecast: float | None = Field(default=None, alias="billableForecast") - daily_capacity: float | None = Field(default=None, alias="dailyCapacity") - hourly_cost: float | None = Field(default=None, alias="hourlyCost") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - include_in_utilization_reporting_flag: bool | None = Field( - default=None, alias="includeInUtilizationReportingFlag" - ) - require_expense_entry_flag: bool | None = Field( - default=None, alias="requireExpenseEntryFlag" - ) - require_time_sheet_entry_flag: bool | None = Field( - default=None, alias="requireTimeSheetEntryFlag" - ) - require_start_and_end_time_on_time_entry_flag: bool | None = Field( - default=None, alias="requireStartAndEndTimeOnTimeEntryFlag" - ) - allow_in_cell_entry_on_time_sheet: bool | None = Field( - default=None, alias="allowInCellEntryOnTimeSheet" - ) - enter_time_against_company_flag: bool | None = Field( - default=None, alias="enterTimeAgainstCompanyFlag" - ) - allow_expenses_entered_against_companies_flag: bool | None = Field( - default=None, alias="allowExpensesEnteredAgainstCompaniesFlag" - ) - time_reminder_email_flag: bool | None = Field( - default=None, alias="timeReminderEmailFlag" - ) - days_tolerance: int | None = Field(default=None, alias="daysTolerance") - minimum_hours: float | None = Field(default=None, alias="minimumHours") - time_sheet_start_date: str | None = Field(default=None, alias="timeSheetStartDate") - hire_date: str | None = Field(default=None, alias="hireDate") - service_default_location: SystemLocationReference | None = Field( - default=None, alias="serviceDefaultLocation" - ) - service_default_department: SystemDepartmentReference | None = Field( - default=None, alias="serviceDefaultDepartment" - ) - service_default_board: BoardReference | None = Field( - default=None, alias="serviceDefaultBoard" - ) - restrict_service_default_location_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultLocationFlag" - ) - restrict_service_default_department_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultDepartmentFlag" - ) - excluded_service_board_ids: list[int] | None = Field( - default=None, alias="excludedServiceBoardIds" - ) - project_default_location: SystemLocationReference | None = Field( - default=None, alias="projectDefaultLocation" - ) - project_default_department: SystemDepartmentReference | None = Field( - default=None, alias="projectDefaultDepartment" - ) - project_default_board: ProjectBoardReference | None = Field( - default=None, alias="projectDefaultBoard" - ) - restrict_project_default_location_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultLocationFlag" - ) - restrict_project_default_department_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultDepartmentFlag" - ) - excluded_project_board_ids: list[int] | None = Field( - default=None, alias="excludedProjectBoardIds" - ) - schedule_default_location: SystemLocationReference | None = Field( - default=None, alias="scheduleDefaultLocation" - ) - schedule_default_department: SystemDepartmentReference | None = Field( - default=None, alias="scheduleDefaultDepartment" - ) - schedule_capacity: float | None = Field(default=None, alias="scheduleCapacity") - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - restrict_schedule_flag: bool | None = Field( - default=None, alias="restrictScheduleFlag" - ) - hide_member_in_dispatch_portal_flag: bool | None = Field( - default=None, alias="hideMemberInDispatchPortalFlag" - ) - calendar: CalendarReference | None = None - sales_default_location: SystemLocationReference | None = Field( - default=None, alias="salesDefaultLocation" - ) - restrict_default_sales_territory_flag: bool | None = Field( - default=None, alias="restrictDefaultSalesTerritoryFlag" - ) + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - restrict_default_warehouse_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseFlag" - ) - restrict_default_warehouse_bin_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseBinFlag" - ) - mapi_name: str | None = Field(default=None, alias="mapiName") - calendar_sync_integration_flag: bool | None = Field( - default=None, alias="calendarSyncIntegrationFlag" - ) - enable_ldap_authentication_flag: bool | None = Field( - default=None, alias="enableLdapAuthenticationFlag" - ) - ldap_configuration: LdapConfigurationReference | None = Field( - default=None, alias="ldapConfiguration" - ) - ldap_user_name: str | None = Field(default=None, alias="ldapUserName") - company_activity_tab_format: Literal["SummaryList", "DetailList"] | None = Field( - default=None, alias="companyActivityTabFormat" - ) - invoice_time_tab_format: Literal["SummaryList", "DetailList"] | None = Field( - default=None, alias="invoiceTimeTabFormat" - ) - invoice_screen_default_tab_format: Literal[ - "ShowInvoicingTab", "ShowAgreementInvoicingTab" - ] | None = Field(default=None, alias="invoiceScreenDefaultTabFormat") - invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] | None = Field(default=None, alias="invoicingDisplayOptions") - agreement_invoicing_display_options: Literal[ - "RemainOnInvoicingScreen", "ShowRecentInvoices" - ] | None = Field(default=None, alias="agreementInvoicingDisplayOptions") - corelytics_username: str | None = Field(default=None, alias="corelyticsUsername") - corelytics_password: str | None = Field(default=None, alias="corelyticsPassword") - authentication_service_type: Literal[ - "AuthAnvil", "GoogleAuthenticator", "Email" - ] | None = Field(default=None, alias="authenticationServiceType") - timebased_one_time_password_activated: bool | None = Field( - default=None, alias="timebasedOneTimePasswordActivated" - ) - directional_sync: DirectionalSyncReference | None = Field( - default=None, alias="directionalSync" - ) - sso_session_flag: bool | None = Field(default=None, alias="ssoSessionFlag") - sso_client_id: str | None = Field(default=None, alias="ssoClientId") - info: dict[str, str] | None = Field(default=None, alias="_info") + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class MyMemberInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + allow_expenses_entered_against_companies_flag: Annotated[ + bool | None, Field(alias="allowExpensesEnteredAgainstCompaniesFlag") + ] = None + daily_capacity: Annotated[float | None, Field(alias="dailyCapacity")] = None + default_department: Annotated[SystemDepartmentReference | None, Field(alias="defaultDepartment")] = None + default_email: Annotated[str | None, Field(alias="defaultEmail")] = None + default_location: Annotated[SystemLocationReference | None, Field(alias="defaultLocation")] = None + enter_time_against_company_flag: Annotated[bool | None, Field(alias="enterTimeAgainstCompanyFlag")] = None + excluded_project_board_ids: Annotated[list[int] | None, Field(alias="excludedProjectBoardIds")] = None + excluded_service_board_ids: Annotated[list[int] | None, Field(alias="excludedServiceBoardIds")] = None + first_name: Annotated[str | None, Field(alias="firstName")] = None + full_name: Annotated[str | None, Field(alias="fullName")] = None id: int | None = None identifier: str | None = None - first_name: str | None = Field(default=None, alias="firstName") - middle_initial: str | None = Field(default=None, alias="middleInitial") - last_name: str | None = Field(default=None, alias="lastName") - full_name: str | None = Field(default=None, alias="fullName") - default_email: str | None = Field(default=None, alias="defaultEmail") - photo: DocumentReference | None = None - license_class: Literal["A", "C", "F", "X"] | None = Field( - default=None, alias="licenseClass" - ) + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + last_name: Annotated[str | None, Field(alias="lastName")] = None + license_class: Annotated[Literal["A", "C", "F", "X"] | None, Field(alias="licenseClass")] = None """ F = Full Member, A = API Member, C = StreamlineIT Member, X = Subcontractor Member """ - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - time_zone: TimeZoneSetupReference | None = Field(default=None, alias="timeZone") - use_browser_language_flag: bool | None = Field( - default=None, alias="useBrowserLanguageFlag" - ) - default_location: SystemLocationReference | None = Field( - default=None, alias="defaultLocation" - ) - default_department: SystemDepartmentReference | None = Field( - default=None, alias="defaultDepartment" - ) - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - daily_capacity: float | None = Field(default=None, alias="dailyCapacity") - require_expense_entry_flag: bool | None = Field( - default=None, alias="requireExpenseEntryFlag" - ) - require_time_sheet_entry_flag: bool | None = Field( - default=None, alias="requireTimeSheetEntryFlag" - ) - require_start_and_end_time_on_time_entry_flag: bool | None = Field( - default=None, alias="requireStartAndEndTimeOnTimeEntryFlag" - ) - enter_time_against_company_flag: bool | None = Field( - default=None, alias="enterTimeAgainstCompanyFlag" - ) - allow_expenses_entered_against_companies_flag: bool | None = Field( - default=None, alias="allowExpensesEnteredAgainstCompaniesFlag" - ) - service_default_board: BoardReference | None = Field( - default=None, alias="serviceDefaultBoard" - ) - service_default_location: SystemLocationReference | None = Field( - default=None, alias="serviceDefaultLocation" - ) - service_default_department: SystemDepartmentReference | None = Field( - default=None, alias="serviceDefaultDepartment" - ) - restrict_service_default_location_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultLocationFlag" - ) - restrict_service_default_department_flag: bool | None = Field( - default=None, alias="restrictServiceDefaultDepartmentFlag" - ) - excluded_service_board_ids: list[int] | None = Field( - default=None, alias="excludedServiceBoardIds" - ) - project_default_location: SystemLocationReference | None = Field( - default=None, alias="projectDefaultLocation" - ) - project_default_department: SystemDepartmentReference | None = Field( - default=None, alias="projectDefaultDepartment" - ) - project_default_board: ProjectBoardReference | None = Field( - default=None, alias="projectDefaultBoard" - ) - restrict_project_default_location_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultLocationFlag" - ) - restrict_project_default_department_flag: bool | None = Field( - default=None, alias="restrictProjectDefaultDepartmentFlag" - ) - excluded_project_board_ids: list[int] | None = Field( - default=None, alias="excludedProjectBoardIds" - ) - schedule_default_location: SystemLocationReference | None = Field( - default=None, alias="scheduleDefaultLocation" - ) - schedule_default_department: SystemDepartmentReference | None = Field( - default=None, alias="scheduleDefaultDepartment" - ) - schedule_capacity: float | None = Field(default=None, alias="scheduleCapacity") - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - sales_default_location: SystemLocationReference | None = Field( - default=None, alias="salesDefaultLocation" - ) + middle_initial: Annotated[str | None, Field(alias="middleInitial")] = None + photo: DocumentReference | None = None + project_default_board: Annotated[ProjectBoardReference | None, Field(alias="projectDefaultBoard")] = None + project_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="projectDefaultDepartment") + ] = None + project_default_location: Annotated[SystemLocationReference | None, Field(alias="projectDefaultLocation")] = None + require_expense_entry_flag: Annotated[bool | None, Field(alias="requireExpenseEntryFlag")] = None + require_start_and_end_time_on_time_entry_flag: Annotated[ + bool | None, Field(alias="requireStartAndEndTimeOnTimeEntryFlag") + ] = None + require_time_sheet_entry_flag: Annotated[bool | None, Field(alias="requireTimeSheetEntryFlag")] = None + restrict_default_warehouse_bin_flag: Annotated[bool | None, Field(alias="restrictDefaultWarehouseBinFlag")] = None + restrict_default_warehouse_flag: Annotated[bool | None, Field(alias="restrictDefaultWarehouseFlag")] = None + restrict_project_default_department_flag: Annotated[ + bool | None, Field(alias="restrictProjectDefaultDepartmentFlag") + ] = None + restrict_project_default_location_flag: Annotated[ + bool | None, Field(alias="restrictProjectDefaultLocationFlag") + ] = None + restrict_service_default_department_flag: Annotated[ + bool | None, Field(alias="restrictServiceDefaultDepartmentFlag") + ] = None + restrict_service_default_location_flag: Annotated[ + bool | None, Field(alias="restrictServiceDefaultLocationFlag") + ] = None + sales_default_location: Annotated[SystemLocationReference | None, Field(alias="salesDefaultLocation")] = None + schedule_capacity: Annotated[float | None, Field(alias="scheduleCapacity")] = None + schedule_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="scheduleDefaultDepartment") + ] = None + schedule_default_location: Annotated[SystemLocationReference | None, Field(alias="scheduleDefaultLocation")] = None + service_default_board: Annotated[BoardReference | None, Field(alias="serviceDefaultBoard")] = None + service_default_department: Annotated[ + SystemDepartmentReference | None, Field(alias="serviceDefaultDepartment") + ] = None + service_default_location: Annotated[SystemLocationReference | None, Field(alias="serviceDefaultLocation")] = None + service_location: Annotated[ServiceLocationReference | None, Field(alias="serviceLocation")] = None + sso_client_id: Annotated[str | None, Field(alias="ssoClientId")] = None + sso_session_flag: Annotated[bool | None, Field(alias="ssoSessionFlag")] = None + time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="timeZone")] = None + use_browser_language_flag: Annotated[bool | None, Field(alias="useBrowserLanguageFlag")] = None warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - restrict_default_warehouse_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseFlag" - ) - restrict_default_warehouse_bin_flag: bool | None = Field( - default=None, alias="restrictDefaultWarehouseBinFlag" - ) - sso_session_flag: bool | None = Field(default=None, alias="ssoSessionFlag") - sso_client_id: str | None = Field(default=None, alias="ssoClientId") - info: dict[str, str] | None = Field(default=None, alias="_info") + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class OnHandSerialNumber(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + catalog_item: Annotated[CatalogItemReference | None, Field(alias="catalogItem")] = None id: int | None = None serial: str | None = None - catalog_item: CatalogItemReference | None = Field(default=None, alias="catalogItem") warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None class Opportunity(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 100; - """ - expected_close_date: datetime | None = Field( - default=None, alias="expectedCloseDate" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + bill_to_contact: Annotated[ContactReference | None, Field(alias="billToContact")] = None + bill_to_site: Annotated[SiteReference | None, Field(alias="billToSite")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None """ Required On Updates; """ - type: OpportunityTypeReference | None = None - stage: OpportunityStageReference | None = None - status: OpportunityStatusReference | None = None - priority: OpportunityPriorityReference | None = None - notes: str | None = None - probability: OpportunityProbabilityReference | None = None - source: str | None = None + campaign: CampaignReference | None = None + closed_by: Annotated[MemberReference | None, Field(alias="closedBy")] = None + closed_date: Annotated[datetime | None, Field(alias="closedDate")] = None + company: CompanyReference | None = None + company_location_id: Annotated[int | None, Field(alias="companyLocationId")] = None + contact: ContactReference | None = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_po: Annotated[str | None, Field(alias="customerPO")] = None """ - Max length: 50; + Max length: 25; """ - rating: OpportunityRatingReference | None = None - campaign: CampaignReference | None = None - primary_sales_rep: MemberReference | None = Field( - default=None, alias="primarySalesRep" - ) - secondary_sales_rep: MemberReference | None = Field( - default=None, alias="secondarySalesRep" - ) - location_id: int | None = Field(default=None, alias="locationId") + date_became_lead: Annotated[datetime | None, Field(alias="dateBecameLead")] = None + expected_close_date: Annotated[datetime | None, Field(alias="expectedCloseDate")] = None """ Required On Updates; """ - business_unit_id: int | None = Field(default=None, alias="businessUnitId") + id: int | None = None + location_id: Annotated[int | None, Field(alias="locationId")] = None """ Required On Updates; """ - company: CompanyReference | None = None - contact: ContactReference | None = None + name: str + """ + Max length: 100; + """ + notes: str | None = None + pipeline_change_date: Annotated[datetime | None, Field(alias="pipelineChangeDate")] = None + primary_sales_rep: Annotated[MemberReference | None, Field(alias="primarySalesRep")] = None + priority: OpportunityPriorityReference | None = None + probability: OpportunityProbabilityReference | None = None + rating: OpportunityRatingReference | None = None + secondary_sales_rep: Annotated[MemberReference | None, Field(alias="secondarySalesRep")] = None + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + ship_to_contact: Annotated[ContactReference | None, Field(alias="shipToContact")] = None + ship_to_site: Annotated[SiteReference | None, Field(alias="shipToSite")] = None site: SiteReference | None = None - customer_po: str | None = Field(default=None, alias="customerPO") + source: str | None = None """ - Max length: 25; + Max length: 50; """ - pipeline_change_date: datetime | None = Field( - default=None, alias="pipelineChangeDate" - ) - date_became_lead: datetime | None = Field(default=None, alias="dateBecameLead") - closed_date: datetime | None = Field(default=None, alias="closedDate") - closed_by: MemberReference | None = Field(default=None, alias="closedBy") - total_sales_tax: float | None = Field(default=None, alias="totalSalesTax") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_contact: ContactReference | None = Field( - default=None, alias="shipToContact" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - bill_to_contact: ContactReference | None = Field( - default=None, alias="billToContact" - ) - bill_to_site: SiteReference | None = Field(default=None, alias="billToSite") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - currency: CurrencyReference | None = None - company_location_id: int | None = Field(default=None, alias="companyLocationId") - technical_contact: ContactReference | None = Field( - default=None, alias="technicalContact" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + stage: OpportunityStageReference | None = None + status: OpportunityStatusReference | None = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + technical_contact: Annotated[ContactReference | None, Field(alias="technicalContact")] = None + total_sales_tax: Annotated[float | None, Field(alias="totalSalesTax")] = None + type: OpportunityTypeReference | None = None class OpportunityContact(ConnectWiseModel): - id: int | None = None - contact: ContactReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None company: CompanyReference | None = None - role: OpportunitySalesRoleReference | None = None + contact: ContactReference | None = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None + id: int | None = None notes: str | None = None - referral_flag: bool | None = Field(default=None, alias="referralFlag") - opportunity_id: int | None = Field(default=None, alias="opportunityId") - phone_number: str | None = Field(default=None, alias="phoneNumber") - email_address: str | None = Field(default=None, alias="emailAddress") - info: dict[str, str] | None = Field(default=None, alias="_info") + opportunity_id: Annotated[int | None, Field(alias="opportunityId")] = None + phone_number: Annotated[str | None, Field(alias="phoneNumber")] = None + referral_flag: Annotated[bool | None, Field(alias="referralFlag")] = None + role: OpportunitySalesRoleReference | None = None class OpportunityToProjectConversion(ConnectWiseModel): - project_id: int | None = Field(default=None, alias="projectId") - name: str | None = None - status: ProjectStatusReference | None = None - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") board: ProjectBoardReference | None = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + estimated_end: Annotated[datetime | None, Field(alias="estimatedEnd")] = None + estimated_start: Annotated[datetime | None, Field(alias="estimatedStart")] = None + include_all_documents_flag: Annotated[bool | None, Field(alias="includeAllDocumentsFlag")] = None + include_all_notes_flag: Annotated[bool | None, Field(alias="includeAllNotesFlag")] = None + include_all_products_flag: Annotated[bool | None, Field(alias="includeAllProductsFlag")] = None + include_document_ids: Annotated[list[int] | None, Field(alias="includeDocumentIds")] = None + include_note_ids: Annotated[list[int] | None, Field(alias="includeNoteIds")] = None + include_product_ids: Annotated[list[int] | None, Field(alias="includeProductIds")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None manager: MemberReference | None = None - estimated_start: str | None = Field(default=None, alias="estimatedStart") - estimated_end: str | None = Field(default=None, alias="estimatedEnd") - include_all_notes_flag: bool | None = Field( - default=None, alias="includeAllNotesFlag" - ) - include_all_documents_flag: bool | None = Field( - default=None, alias="includeAllDocumentsFlag" - ) - include_all_products_flag: bool | None = Field( - default=None, alias="includeAllProductsFlag" - ) - include_note_ids: list[int] | None = Field(default=None, alias="includeNoteIds") - include_document_ids: list[int] | None = Field( - default=None, alias="includeDocumentIds" - ) - include_product_ids: list[int] | None = Field( - default=None, alias="includeProductIds" - ) + name: str | None = None + project_id: Annotated[int | None, Field(alias="projectId")] = None + status: ProjectStatusReference | None = None class Order(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + bill_closed_flag: Annotated[bool | None, Field(alias="billClosedFlag")] = None + bill_shipped_flag: Annotated[bool | None, Field(alias="billShippedFlag")] = None + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + bill_to_contact: Annotated[ContactReference | None, Field(alias="billToContact")] = None + bill_to_site: Annotated[SiteReference | None, Field(alias="billToSite")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + bottom_comment_flag: Annotated[bool | None, Field(alias="bottomCommentFlag")] = None company: CompanyReference | None = None + company_location: Annotated[SystemLocationReference | None, Field(alias="companyLocation")] = None + config_ids: Annotated[list[int] | None, Field(alias="configIds")] = None contact: ContactReference | None = None - phone: str | None = None - phone_ext: str | None = Field(default=None, alias="phoneExt") + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + department: SystemDepartmentReference | None = None + description: str | None = None + document_ids: Annotated[list[int] | None, Field(alias="documentIds")] = None + due_date: Annotated[datetime | None, Field(alias="dueDate")] = None email: str | None = None - site: SiteReference | None = None - status: OrderStatusReference | None = None + id: int | None = None + invoice_ids: Annotated[list[int] | None, Field(alias="invoiceIds")] = None + location: SystemLocationReference | None = None + notes: str | None = None opportunity: OpportunityReference | None = None - order_date: datetime | None = Field(default=None, alias="orderDate") - due_date: datetime | None = Field(default=None, alias="dueDate") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - po_number: str | None = Field(default=None, alias="poNumber") + order_date: Annotated[datetime | None, Field(alias="orderDate")] = None + phone: str | None = None + phone_ext: Annotated[str | None, Field(alias="phoneExt")] = None + po_number: Annotated[str | None, Field(alias="poNumber")] = None """ Max length: 50; """ - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - sales_rep: MemberReference | None = Field(default=None, alias="salesRep") - notes: str | None = None - bill_closed_flag: bool | None = Field(default=None, alias="billClosedFlag") - bill_shipped_flag: bool | None = Field(default=None, alias="billShippedFlag") - restrict_downpayment_flag: bool | None = Field( - default=None, alias="restrictDownpaymentFlag" - ) - description: str | None = None - top_comment_flag: bool | None = Field(default=None, alias="topCommentFlag") - bottom_comment_flag: bool | None = Field(default=None, alias="bottomCommentFlag") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_contact: ContactReference | None = Field( - default=None, alias="shipToContact" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - bill_to_contact: ContactReference | None = Field( - default=None, alias="billToContact" - ) - bill_to_site: SiteReference | None = Field(default=None, alias="billToSite") - product_ids: list[int] | None = Field(default=None, alias="productIds") - document_ids: list[int] | None = Field(default=None, alias="documentIds") - invoice_ids: list[int] | None = Field(default=None, alias="invoiceIds") - config_ids: list[int] | None = Field(default=None, alias="configIds") + product_ids: Annotated[list[int] | None, Field(alias="productIds")] = None + restrict_downpayment_flag: Annotated[bool | None, Field(alias="restrictDownpaymentFlag")] = None + sales_rep: Annotated[MemberReference | None, Field(alias="salesRep")] = None + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + ship_to_contact: Annotated[ContactReference | None, Field(alias="shipToContact")] = None + ship_to_site: Annotated[SiteReference | None, Field(alias="shipToSite")] = None + site: SiteReference | None = None + status: OrderStatusReference | None = None + sub_total: Annotated[float | None, Field(alias="subTotal")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_total: Annotated[float | None, Field(alias="taxTotal")] = None + top_comment_flag: Annotated[bool | None, Field(alias="topCommentFlag")] = None total: float | None = None - tax_total: float | None = Field(default=None, alias="taxTotal") - currency: CurrencyReference | None = None - company_location: SystemLocationReference | None = Field( - default=None, alias="companyLocation" - ) - sub_total: float | None = Field(default=None, alias="subTotal") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class OrderStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + email_template: Annotated[OrderStatusEmailTemplateReference | None, Field(alias="emailTemplate")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - sort_order: int | None = Field(default=None, alias="sortOrder") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - email_template: OrderStatusEmailTemplateReference | None = Field( - default=None, alias="emailTemplate" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class OrderStatusEmailTemplate(ConnectWiseModel): - id: int | None = None - status: OrderStatusReference | None = None - use_sender_flag: bool | None = Field(default=None, alias="useSenderFlag") - first_name: str | None = Field(default=None, alias="firstName") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + body: str + copy_sender_flag: Annotated[bool | None, Field(alias="copySenderFlag")] = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None """ Max length: 100; """ - last_name: str | None = Field(default=None, alias="lastName") + first_name: Annotated[str | None, Field(alias="firstName")] = None """ Max length: 100; """ - email_address: str | None = Field(default=None, alias="emailAddress") + id: int | None = None + last_name: Annotated[str | None, Field(alias="lastName")] = None """ Max length: 100; """ + status: OrderStatusReference | None = None subject: str """ Max length: 200; """ - body: str - copy_sender_flag: bool | None = Field(default=None, alias="copySenderFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + use_sender_flag: Annotated[bool | None, Field(alias="useSenderFlag")] = None class OrderStatusNotification(ConnectWiseModel): - id: int | None = None - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - status: OrderStatusReference | None = None - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None email: str | None = None """ - Order Status Notification sendEmail must be entered if the notify type is "Email Address". Max length: 50; + Order Status Notification sendEmail must be entered if the notify type is "Email Address" Max length: 50; """ - workflow_step: int | None = Field(default=None, alias="workflowStep") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + member: MemberReference | None = None + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None + status: OrderStatusReference | None = None + workflow_step: Annotated[int | None, Field(alias="workflowStep")] = None class Other(ConnectWiseModel): - id: int | None = None - default_ldap: LdapConfigurationReference | None = Field( - default=None, alias="defaultLdap" - ) - default_from_address: str = Field(..., alias="defaultFromAddress") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + contact_sync: Annotated[Literal["FL", "LF", "CFL", "CLF"] | None, Field(alias="contactSync")] = None + default_address_format: Annotated[AddressFormatReference | None, Field(alias="defaultAddressFormat")] = None + default_calendar: Annotated[CalendarReference | None, Field(alias="defaultCalendar")] = None + default_from_address: Annotated[str, Field(alias="defaultFromAddress")] """ Max length: 50; """ - portal_url_override: str = Field(..., alias="portalUrlOverride") + default_ldap: Annotated[LdapConfigurationReference | None, Field(alias="defaultLdap")] = None + disable_z_admin_login_flag: Annotated[bool | None, Field(alias="disableZAdminLoginFlag")] = None + id: int | None = None + include_portal_link_flag: Annotated[bool | None, Field(alias="includePortalLinkFlag")] = None + locale: LocaleReference | None = None + logo_path: Annotated[str | None, Field(alias="logoPath")] = None """ - Max length: 100; + Max length: 200; """ - site_url: str = Field(..., alias="siteUrl") + portal_url_override: Annotated[str, Field(alias="portalUrlOverride")] """ Max length: 100; """ - logo_path: str | None = Field(default=None, alias="logoPath") + server_time_zone: Annotated[TimeZoneSetupReference | None, Field(alias="serverTimeZone")] = None + site_url: Annotated[str, Field(alias="siteUrl")] """ - Max length: 200; + Max length: 100; """ - contact_sync: Literal["FL", "LF", "CFL", "CLF"] | None = Field( - default=None, alias="contactSync" - ) - server_time_zone: TimeZoneSetupReference | None = Field( - default=None, alias="serverTimeZone" - ) - default_calendar: CalendarReference | None = Field( - default=None, alias="defaultCalendar" - ) - default_address_format: AddressFormatReference | None = Field( - default=None, alias="defaultAddressFormat" - ) - use_ssl_flag: bool | None = Field(default=None, alias="useSslFlag") - sync_leads_flag: bool | None = Field(default=None, alias="syncLeadsFlag") - include_portal_link_flag: bool | None = Field( - default=None, alias="includePortalLinkFlag" - ) - use_expanded_format_time_flag: bool | None = Field( - default=None, alias="useExpandedFormatTimeFlag" - ) - use_expanded_format_activity_flag: bool | None = Field( - default=None, alias="useExpandedFormatActivityFlag" - ) - disable_z_admin_login_flag: bool | None = Field( - default=None, alias="disableZAdminLoginFlag" - ) - locale: LocaleReference | None = None - update_member_time_zones_flag: bool | None = Field( - default=None, alias="updateMemberTimeZonesFlag" - ) + sync_leads_flag: Annotated[bool | None, Field(alias="syncLeadsFlag")] = None + update_member_time_zones_flag: Annotated[bool | None, Field(alias="updateMemberTimeZonesFlag")] = None """ If true, all Members time zone will also be set to serverTimeZone. Otherwise, only My Company time zone will be updated. """ - info: dict[str, str] | None = Field(default=None, alias="_info") + use_expanded_format_activity_flag: Annotated[bool | None, Field(alias="useExpandedFormatActivityFlag")] = None + use_expanded_format_time_flag: Annotated[bool | None, Field(alias="useExpandedFormatTimeFlag")] = None + use_ssl_flag: Annotated[bool | None, Field(alias="useSslFlag")] = None class PhaseStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board_association_ids: Annotated[list[int] | None, Field(alias="boardAssociationIds")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + collapsed_flag: Annotated[bool | None, Field(alias="collapsedFlag")] = None + custom_status_indicator_name: Annotated[str | None, Field(alias="customStatusIndicatorName")] = None + """ + Required when statusIndicator is Custom Max length: 30; + """ + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 30; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - collapsed_flag: bool | None = Field(default=None, alias="collapsedFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - board_association_ids: list[int] | None = Field( - default=None, alias="boardAssociationIds" - ) - status_indicator: StatusIndicatorReference | None = Field( - default=None, alias="statusIndicator" - ) - custom_status_indicator_name: str | None = Field( - default=None, alias="customStatusIndicatorName" - ) - """ - Required when statusIndicator is Custom. Max length: 30; - """ - info: dict[str, str] | None = Field(default=None, alias="_info") + status_indicator: Annotated[StatusIndicatorReference | None, Field(alias="statusIndicator")] = None class PortalConfigurationInvoiceSetup(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_statuses: Annotated[bool | None, Field(alias="addAllStatuses")] = None + allow_inv_pmt_flag: Annotated[bool | None, Field(alias="allowInvPmtFlag")] = None + billing_status_ids: Annotated[list[int] | None, Field(alias="billingStatusIds")] = None + display_inv_pmt_flag: Annotated[bool | None, Field(alias="displayInvPmtFlag")] = None id: int | None = None - portal_configuration: PortalConfigurationReference | None = Field( - default=None, alias="portalConfiguration" - ) - display_inv_pmt_flag: bool | None = Field(default=None, alias="displayInvPmtFlag") - allow_inv_pmt_flag: bool | None = Field(default=None, alias="allowInvPmtFlag") location: SystemLocationReference | None = None - payment_processor: PortalConfigurationPaymentProcessorReference | None = Field( - default=None, alias="paymentProcessor" - ) login: str | None = None password: str | None = None - url_override: str | None = Field(default=None, alias="urlOverride") - billing_status_ids: list[int] | None = Field(default=None, alias="billingStatusIds") - add_all_statuses: bool | None = Field(default=None, alias="addAllStatuses") - remove_all_statuses: bool | None = Field(default=None, alias="removeAllStatuses") - info: dict[str, str] | None = Field(default=None, alias="_info") + payment_processor: Annotated[ + PortalConfigurationPaymentProcessorReference | None, Field(alias="paymentProcessor") + ] = None + portal_configuration: Annotated[PortalConfigurationReference | None, Field(alias="portalConfiguration")] = None + remove_all_statuses: Annotated[bool | None, Field(alias="removeAllStatuses")] = None + url_override: Annotated[str | None, Field(alias="urlOverride")] = None class PortalConfigurationProjectSetup(ConnectWiseModel): - id: int | None = None - portal_config: PortalConfigurationReference | None = Field( - default=None, alias="portalConfig" - ) - project_name_flag: bool | None = Field(default=None, alias="projectNameFlag") - project_type_flag: bool | None = Field(default=None, alias="projectTypeFlag") - status_flag: bool | None = Field(default=None, alias="statusFlag") - project_manager_flag: bool | None = Field(default=None, alias="projectManagerFlag") - billing_method_flag: bool | None = Field(default=None, alias="billingMethodFlag") - contact_flag: bool | None = Field(default=None, alias="contactFlag") - estimated_start_flag: bool | None = Field(default=None, alias="estimatedStartFlag") - estimated_end_flag: bool | None = Field(default=None, alias="estimatedEndFlag") - description_flag: bool | None = Field(default=None, alias="descriptionFlag") - last_updated_flag: bool | None = Field(default=None, alias="lastUpdatedFlag") - only_display: Literal[ - "DoNotDisplay", - "Closed30Days", - "Closed60Days", - "Closed90Days", - "Closed120Days", - "AllClosed", - ] = Field(..., alias="onlyDisplay") - time_material_budget_hrs_flag: bool | None = Field( - default=None, alias="timeMaterialBudgetHrsFlag" - ) - time_material_scheduled_start_flag: bool | None = Field( - default=None, alias="timeMaterialScheduledStartFlag" - ) - time_material_scheduled_finish_flag: bool | None = Field( - default=None, alias="timeMaterialScheduledFinishFlag" - ) - time_material_scheduled_hrs_flag: bool | None = Field( - default=None, alias="timeMaterialScheduledHrsFlag" - ) - time_material_actual_start_flag: bool | None = Field( - default=None, alias="timeMaterialActualStartFlag" - ) - time_material_actual_finish_flag: bool | None = Field( - default=None, alias="timeMaterialActualFinishFlag" - ) - time_material_actual_hrs_flag: bool | None = Field( - default=None, alias="timeMaterialActualHrsFlag" - ) - time_material_bill_flag: bool | None = Field( - default=None, alias="timeMaterialBillFlag" - ) - time_material_status_flag: bool | None = Field( - default=None, alias="timeMaterialStatusFlag" - ) - time_material_assigned_flag: bool | None = Field( - default=None, alias="timeMaterialAssignedFlag" - ) - fixed_fee_budget_hrs_flag: bool | None = Field( - default=None, alias="fixedFeeBudgetHrsFlag" - ) - fixed_fee_scheduled_start_flag: bool | None = Field( - default=None, alias="fixedFeeScheduledStartFlag" - ) - fixed_fee_scheduled_finish_flag: bool | None = Field( - default=None, alias="fixedFeeScheduledFinishFlag" - ) - fixed_fee_scheduled_hrs_flag: bool | None = Field( - default=None, alias="fixedFeeScheduledHrsFlag" - ) - fixed_fee_actual_start_flag: bool | None = Field( - default=None, alias="fixedFeeActualStartFlag" - ) - fixed_fee_actual_finish_flag: bool | None = Field( - default=None, alias="fixedFeeActualFinishFlag" - ) - fixed_fee_actual_hrs_flag: bool | None = Field( - default=None, alias="fixedFeeActualHrsFlag" - ) - fixed_fee_bill_flag: bool | None = Field(default=None, alias="fixedFeeBillFlag") - fixed_fee_status_flag: bool | None = Field(default=None, alias="fixedFeeStatusFlag") - fixed_fee_assigned_flag: bool | None = Field( - default=None, alias="fixedFeeAssignedFlag" - ) - project_issue_budget_hrs_flag: bool | None = Field( - default=None, alias="projectIssueBudgetHrsFlag" - ) - project_issue_scheduled_start_flag: bool | None = Field( - default=None, alias="projectIssueScheduledStartFlag" - ) - project_issue_scheduled_finish_flag: bool | None = Field( - default=None, alias="projectIssueScheduledFinishFlag" - ) - project_issue_scheduled_hrs_flag: bool | None = Field( - default=None, alias="projectIssueScheduledHrsFlag" - ) - project_issue_actual_start_flag: bool | None = Field( - default=None, alias="projectIssueActualStartFlag" - ) - project_issue_actual_finish_flag: bool | None = Field( - default=None, alias="projectIssueActualFinishFlag" - ) - project_issue_actual_hrs_flag: bool | None = Field( - default=None, alias="projectIssueActualHrsFlag" - ) - project_issue_bill_flag: bool | None = Field( - default=None, alias="projectIssueBillFlag" - ) - project_issue_status_flag: bool | None = Field( - default=None, alias="projectIssueStatusFlag" - ) - project_issue_assigned_flag: bool | None = Field( - default=None, alias="projectIssueAssignedFlag" - ) - project_detail_total_hours_flag: bool | None = Field( - default=None, alias="projectDetailTotalHoursFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + billing_method_flag: Annotated[bool | None, Field(alias="billingMethodFlag")] = None + contact_flag: Annotated[bool | None, Field(alias="contactFlag")] = None + description_flag: Annotated[bool | None, Field(alias="descriptionFlag")] = None + estimated_end_flag: Annotated[bool | None, Field(alias="estimatedEndFlag")] = None + estimated_start_flag: Annotated[bool | None, Field(alias="estimatedStartFlag")] = None + fixed_fee_actual_finish_flag: Annotated[bool | None, Field(alias="fixedFeeActualFinishFlag")] = None + fixed_fee_actual_hrs_flag: Annotated[bool | None, Field(alias="fixedFeeActualHrsFlag")] = None + fixed_fee_actual_start_flag: Annotated[bool | None, Field(alias="fixedFeeActualStartFlag")] = None + fixed_fee_assigned_flag: Annotated[bool | None, Field(alias="fixedFeeAssignedFlag")] = None + fixed_fee_bill_flag: Annotated[bool | None, Field(alias="fixedFeeBillFlag")] = None + fixed_fee_budget_hrs_flag: Annotated[bool | None, Field(alias="fixedFeeBudgetHrsFlag")] = None + fixed_fee_scheduled_finish_flag: Annotated[bool | None, Field(alias="fixedFeeScheduledFinishFlag")] = None + fixed_fee_scheduled_hrs_flag: Annotated[bool | None, Field(alias="fixedFeeScheduledHrsFlag")] = None + fixed_fee_scheduled_start_flag: Annotated[bool | None, Field(alias="fixedFeeScheduledStartFlag")] = None + fixed_fee_status_flag: Annotated[bool | None, Field(alias="fixedFeeStatusFlag")] = None + id: int | None = None + last_updated_flag: Annotated[bool | None, Field(alias="lastUpdatedFlag")] = None + only_display: Annotated[ + Literal["DoNotDisplay", "Closed30Days", "Closed60Days", "Closed90Days", "Closed120Days", "AllClosed"], + Field(alias="onlyDisplay"), + ] + portal_config: Annotated[PortalConfigurationReference | None, Field(alias="portalConfig")] = None + project_detail_total_hours_flag: Annotated[bool | None, Field(alias="projectDetailTotalHoursFlag")] = None + project_issue_actual_finish_flag: Annotated[bool | None, Field(alias="projectIssueActualFinishFlag")] = None + project_issue_actual_hrs_flag: Annotated[bool | None, Field(alias="projectIssueActualHrsFlag")] = None + project_issue_actual_start_flag: Annotated[bool | None, Field(alias="projectIssueActualStartFlag")] = None + project_issue_assigned_flag: Annotated[bool | None, Field(alias="projectIssueAssignedFlag")] = None + project_issue_bill_flag: Annotated[bool | None, Field(alias="projectIssueBillFlag")] = None + project_issue_budget_hrs_flag: Annotated[bool | None, Field(alias="projectIssueBudgetHrsFlag")] = None + project_issue_scheduled_finish_flag: Annotated[bool | None, Field(alias="projectIssueScheduledFinishFlag")] = None + project_issue_scheduled_hrs_flag: Annotated[bool | None, Field(alias="projectIssueScheduledHrsFlag")] = None + project_issue_scheduled_start_flag: Annotated[bool | None, Field(alias="projectIssueScheduledStartFlag")] = None + project_issue_status_flag: Annotated[bool | None, Field(alias="projectIssueStatusFlag")] = None + project_manager_flag: Annotated[bool | None, Field(alias="projectManagerFlag")] = None + project_name_flag: Annotated[bool | None, Field(alias="projectNameFlag")] = None + project_type_flag: Annotated[bool | None, Field(alias="projectTypeFlag")] = None + status_flag: Annotated[bool | None, Field(alias="statusFlag")] = None + time_material_actual_finish_flag: Annotated[bool | None, Field(alias="timeMaterialActualFinishFlag")] = None + time_material_actual_hrs_flag: Annotated[bool | None, Field(alias="timeMaterialActualHrsFlag")] = None + time_material_actual_start_flag: Annotated[bool | None, Field(alias="timeMaterialActualStartFlag")] = None + time_material_assigned_flag: Annotated[bool | None, Field(alias="timeMaterialAssignedFlag")] = None + time_material_bill_flag: Annotated[bool | None, Field(alias="timeMaterialBillFlag")] = None + time_material_budget_hrs_flag: Annotated[bool | None, Field(alias="timeMaterialBudgetHrsFlag")] = None + time_material_scheduled_finish_flag: Annotated[bool | None, Field(alias="timeMaterialScheduledFinishFlag")] = None + time_material_scheduled_hrs_flag: Annotated[bool | None, Field(alias="timeMaterialScheduledHrsFlag")] = None + time_material_scheduled_start_flag: Annotated[bool | None, Field(alias="timeMaterialScheduledStartFlag")] = None + time_material_status_flag: Annotated[bool | None, Field(alias="timeMaterialStatusFlag")] = None class PortalConfigurationServiceSetup(ConnectWiseModel): - id: int | None = None - service_type_flag: bool | None = Field(default=None, alias="serviceTypeFlag") - service_sub_type_flag: bool | None = Field(default=None, alias="serviceSubTypeFlag") - service_sub_type_item_flag: bool | None = Field( - default=None, alias="serviceSubTypeItemFlag" - ) - status_flag: bool | None = Field(default=None, alias="statusFlag") - site_name_flag: bool | None = Field(default=None, alias="siteNameFlag") - entered_date_flag: bool | None = Field(default=None, alias="enteredDateFlag") - last_update_flag: bool | None = Field(default=None, alias="lastUpdateFlag") - required_date_flag: bool | None = Field(default=None, alias="requiredDateFlag") - contact_flag: bool | None = Field(default=None, alias="contactFlag") - assigned_resources_flag: bool | None = Field( - default=None, alias="assignedResourcesFlag" - ) - sla_info_flag: bool | None = Field(default=None, alias="slaInfoFlag") - service_board_flag: bool | None = Field(default=None, alias="serviceBoardFlag") - budget_hours_flag: bool | None = Field(default=None, alias="budgetHoursFlag") - actual_hours_flag: bool | None = Field(default=None, alias="actualHoursFlag") - approval_status_flag: bool | None = Field(default=None, alias="approvalStatusFlag") - open_tasks_flag: bool | None = Field(default=None, alias="openTasksFlag") - closed_tasks_flag: bool | None = Field(default=None, alias="closedTasksFlag") - enable_chat_assist_flag: bool | None = Field( - default=None, alias="enableChatAssistFlag" - ) - display_closed_tickets_option: Literal[ - "DoNotDisplay", - "Closed30Days", - "Closed60Days", - "Closed90Days", - "Closed120Days", - "AllClosed", - ] = Field(..., alias="displayClosedTicketsOption") - time_materials_ticket_template: ServiceSignoffReference | None = Field( - default=None, alias="timeMaterialsTicketTemplate" - ) - fixed_fee_ticket_template: ServiceSignoffReference | None = Field( - default=None, alias="fixedFeeTicketTemplate" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + actual_hours_flag: Annotated[bool | None, Field(alias="actualHoursFlag")] = None + approval_status_flag: Annotated[bool | None, Field(alias="approvalStatusFlag")] = None + assigned_resources_flag: Annotated[bool | None, Field(alias="assignedResourcesFlag")] = None + budget_hours_flag: Annotated[bool | None, Field(alias="budgetHoursFlag")] = None + closed_tasks_flag: Annotated[bool | None, Field(alias="closedTasksFlag")] = None + contact_flag: Annotated[bool | None, Field(alias="contactFlag")] = None + display_closed_tickets_option: Annotated[ + Literal["DoNotDisplay", "Closed30Days", "Closed60Days", "Closed90Days", "Closed120Days", "AllClosed"], + Field(alias="displayClosedTicketsOption"), + ] + enable_chat_assist_flag: Annotated[bool | None, Field(alias="enableChatAssistFlag")] = None + entered_date_flag: Annotated[bool | None, Field(alias="enteredDateFlag")] = None + fixed_fee_ticket_template: Annotated[ServiceSignoffReference | None, Field(alias="fixedFeeTicketTemplate")] = None + id: int | None = None + last_update_flag: Annotated[bool | None, Field(alias="lastUpdateFlag")] = None + open_tasks_flag: Annotated[bool | None, Field(alias="openTasksFlag")] = None + required_date_flag: Annotated[bool | None, Field(alias="requiredDateFlag")] = None + service_board_flag: Annotated[bool | None, Field(alias="serviceBoardFlag")] = None + service_sub_type_flag: Annotated[bool | None, Field(alias="serviceSubTypeFlag")] = None + service_sub_type_item_flag: Annotated[bool | None, Field(alias="serviceSubTypeItemFlag")] = None + service_type_flag: Annotated[bool | None, Field(alias="serviceTypeFlag")] = None + site_name_flag: Annotated[bool | None, Field(alias="siteNameFlag")] = None + sla_info_flag: Annotated[bool | None, Field(alias="slaInfoFlag")] = None + status_flag: Annotated[bool | None, Field(alias="statusFlag")] = None + time_materials_ticket_template: Annotated[ + ServiceSignoffReference | None, Field(alias="timeMaterialsTicketTemplate") + ] = None class PricingDetail(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + category: ProductCategoryReference | None = None + end_date: Annotated[datetime | None, Field(alias="endDate")] = None id: int | None = None + no_end_date: Annotated[bool | None, Field(alias="noEndDate")] = None product: CatalogItemReference | None = None - category: ProductCategoryReference | None = None - sub_category: ProductSubCategoryReference | None = Field( - default=None, alias="subCategory" - ) - start_date: datetime = Field(..., alias="startDate") - end_date: datetime | None = Field(default=None, alias="endDate") - no_end_date: bool | None = Field(default=None, alias="noEndDate") - info: dict[str, str] | None = Field(default=None, alias="_info") + start_date: Annotated[datetime, Field(alias="startDate")] + sub_category: Annotated[ProductSubCategoryReference | None, Field(alias="subCategory")] = None class ProcurementAdjustment(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + adjustment_details: Annotated[list[AdjustmentDetail] | None, Field(alias="adjustmentDetails")] = None + closed_by: Annotated[str | None, Field(alias="closedBy")] = None + closed_date: Annotated[datetime | None, Field(alias="closedDate")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None id: int | None = None identifier: str """ Max length: 50; """ - type: AdjustmentTypeReference | None = None + notes: str | None = None reason: str | None = None """ Max length: 100; """ - notes: str | None = None - closed_flag: bool | None = Field(default=None, alias="closedFlag") - closed_by: str | None = Field(default=None, alias="closedBy") - closed_date: datetime | None = Field(default=None, alias="closedDate") - adjustment_details: list[AdjustmentDetail] | None = Field( - default=None, alias="adjustmentDetails" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + type: AdjustmentTypeReference | None = None class ProductComponent(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + catalog_item: Annotated[CatalogItemReference | None, Field(alias="catalogItem")] = None + cost: float | None = None + hide_description_flag: Annotated[bool | None, Field(alias="hideDescriptionFlag")] = None + hide_extended_price_flag: Annotated[bool | None, Field(alias="hideExtendedPriceFlag")] = None + hide_item_identifier_flag: Annotated[bool | None, Field(alias="hideItemIdentifierFlag")] = None + hide_price_flag: Annotated[bool | None, Field(alias="hidePriceFlag")] = None + hide_quantity_flag: Annotated[bool | None, Field(alias="hideQuantityFlag")] = None id: int | None = None - sequence_number: int | None = Field(default=None, alias="sequenceNumber") + parent_product_item: Annotated[ProductItemReference | None, Field(alias="parentProductItem")] = None + price: float | None = None + product_item: Annotated[ProductItemReference | None, Field(alias="productItem")] = None + quantity: float + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None """ Required On Updates; """ - quantity: float - catalog_item: CatalogItemReference | None = Field(default=None, alias="catalogItem") - hide_price_flag: bool | None = Field(default=None, alias="hidePriceFlag") - hide_item_identifier_flag: bool | None = Field( - default=None, alias="hideItemIdentifierFlag" - ) - hide_description_flag: bool | None = Field( - default=None, alias="hideDescriptionFlag" - ) - hide_quantity_flag: bool | None = Field(default=None, alias="hideQuantityFlag") - hide_extended_price_flag: bool | None = Field( - default=None, alias="hideExtendedPriceFlag" - ) vendor: CompanyReference | None = None - parent_product_item: ProductItemReference | None = Field( - default=None, alias="parentProductItem" - ) - product_item: ProductItemReference | None = Field(default=None, alias="productItem") - price: float | None = None - cost: float | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ProductItem(ConnectWiseModel): - id: int | None = None - catalog_item: CatalogItemReference | None = Field(default=None, alias="catalogItem") - description: str | None = None - """ - Max length: 2000; - """ - sequence_number: float | None = Field(default=None, alias="sequenceNumber") - quantity: float | None = None - price: float | None = None - cost: float | None = None - discount: float | None = None - agreement_amount: float | None = Field(default=None, alias="agreementAmount") - price_method: Literal[ - "FlatRateForRange", - "PercentMarkupFromCost", - "PercentMarkdownFromPrice", - "PricePerUnit", - ] | None = Field(default=None, alias="priceMethod") - billable_option: Literal["Billable", "DoNotBill", "NoCharge"] = Field( - ..., alias="billableOption" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_components_flag: Annotated[bool | None, Field(alias="addComponentsFlag")] = None agreement: AgreementReference | None = None - location_id: int | None = Field(default=None, alias="locationId") + agreement_amount: Annotated[float | None, Field(alias="agreementAmount")] = None + billable_option: Annotated[Literal["Billable", "DoNotBill", "NoCharge"], Field(alias="billableOption")] + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None """ Required On Updates; """ - business_unit_id: int | None = Field(default=None, alias="businessUnitId") + bypass_forecast_update: Annotated[bool | None, Field(alias="bypassForecastUpdate")] = None + calculated_cost: Annotated[float | None, Field(alias="calculatedCost")] = None + calculated_cost_flag: Annotated[bool | None, Field(alias="calculatedCostFlag")] = None + calculated_price: Annotated[float | None, Field(alias="calculatedPrice")] = None + calculated_price_flag: Annotated[bool | None, Field(alias="calculatedPriceFlag")] = None + cancelled_by: Annotated[int | None, Field(alias="cancelledBy")] = None + cancelled_date: Annotated[datetime | None, Field(alias="cancelledDate")] = None + cancelled_flag: Annotated[bool | None, Field(alias="cancelledFlag")] = None + cancelled_reason: Annotated[str | None, Field(alias="cancelledReason")] = None """ - Required On Updates; + Max length: 100; """ - vendor: CompanyReference | None = None - vendor_sku: str | None = Field(default=None, alias="vendorSku") + catalog_item: Annotated[CatalogItemReference | None, Field(alias="catalogItem")] = None + company: CompanyReference | None = None + cost: float | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_description: Annotated[str | None, Field(alias="customerDescription")] = None """ - Max length: 50; + Max length: 6000; Required On Updates; """ - taxable_flag: bool | None = Field(default=None, alias="taxableFlag") - dropship_flag: bool | None = Field(default=None, alias="dropshipFlag") - special_order_flag: bool | None = Field(default=None, alias="specialOrderFlag") - phase_product_flag: bool | None = Field(default=None, alias="phaseProductFlag") - cancelled_flag: bool | None = Field(default=None, alias="cancelledFlag") - quantity_cancelled: float | None = Field(default=None, alias="quantityCancelled") - cancelled_reason: str | None = Field(default=None, alias="cancelledReason") + description: str | None = None """ - Max length: 100; + Max length: 2000; """ - customer_description: str | None = Field(default=None, alias="customerDescription") + discount: float | None = None + dropship_flag: Annotated[bool | None, Field(alias="dropshipFlag")] = None + entity_type: Annotated[EntityTypeReference | None, Field(alias="entityType")] = None + forecast_detail_id: Annotated[int | None, Field(alias="forecastDetailId")] = None + forecast_status: Annotated[OpportunityStatusReference | None, Field(alias="forecastStatus")] = None + id: int | None = None + ignore_pricing_schedules_flag: Annotated[bool | None, Field(alias="ignorePricingSchedulesFlag")] = None + integration_x_ref: Annotated[str | None, Field(alias="integrationXRef")] = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None """ - Max length: 6000; Required On Updates; + Max length: 1000; """ - internal_notes: str | None = Field(default=None, alias="internalNotes") + invoice: InvoiceReference | None = None + invoice_grouping: Annotated[InvoiceGroupingReference | None, Field(alias="invoiceGrouping")] = None + list_price: Annotated[float | None, Field(alias="listPrice")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None """ - Max length: 1000; + Required On Updates; """ - product_supplied_flag: bool | None = Field( - default=None, alias="productSuppliedFlag" - ) - sub_contractor_ship_to_id: int | None = Field( - default=None, alias="subContractorShipToId" - ) - sub_contractor_amount_limit: float | None = Field( - default=None, alias="subContractorAmountLimit" - ) + minimum_stock_flag: Annotated[bool | None, Field(alias="minimumStockFlag")] = None + need_to_order_quantity: Annotated[int | None, Field(alias="needToOrderQuantity")] = None + need_to_purchase_flag: Annotated[bool | None, Field(alias="needToPurchaseFlag")] = None + opportunity: OpportunityReference | None = None + phase: ProjectPhaseReference | None = None + phase_product_flag: Annotated[bool | None, Field(alias="phaseProductFlag")] = None + po_approved_flag: Annotated[bool | None, Field(alias="poApprovedFlag")] = None + price: float | None = None + price_method: Annotated[ + Literal["FlatRateForRange", "PercentMarkupFromCost", "PercentMarkdownFromPrice", "PricePerUnit"] | None, + Field(alias="priceMethod"), + ] = None + product_class: Annotated[ + Literal["Agreement", "Bundle", "Inventory", "NonInventory", "Service"] | None, Field(alias="productClass") + ] = None + product_supplied_flag: Annotated[bool | None, Field(alias="productSuppliedFlag")] = None + project: ProjectReference | None = None + purchase_date: Annotated[datetime | None, Field(alias="purchaseDate")] = None + quantity: float | None = None + quantity_cancelled: Annotated[float | None, Field(alias="quantityCancelled")] = None recurring: ProductRecurring | None = None + sales_order: Annotated[SalesOrderReference | None, Field(alias="salesOrder")] = None + sequence_number: Annotated[float | None, Field(alias="sequenceNumber")] = None + serial_number_ids: Annotated[list[int] | None, Field(alias="serialNumberIds")] = None + serial_numbers: Annotated[list[str] | None, Field(alias="serialNumbers")] = None + ship_set: Annotated[str | None, Field(alias="shipSet")] = None + """ + Max length: 10; + """ sla: SLAReference | None = None - entity_type: EntityTypeReference | None = Field(default=None, alias="entityType") + special_order_flag: Annotated[bool | None, Field(alias="specialOrderFlag")] = None + sub_contractor_amount_limit: Annotated[float | None, Field(alias="subContractorAmountLimit")] = None + sub_contractor_ship_to_id: Annotated[int | None, Field(alias="subContractorShipToId")] = None + taxable_flag: Annotated[bool | None, Field(alias="taxableFlag")] = None ticket: TicketReference | None = None - project: ProjectReference | None = None - phase: ProjectPhaseReference | None = None - sales_order: SalesOrderReference | None = Field(default=None, alias="salesOrder") - opportunity: OpportunityReference | None = None - invoice: InvoiceReference | None = None - warehouse_id: int | None = Field(default=None, alias="warehouseId") - warehouse_bin_id: int | None = Field(default=None, alias="warehouseBinId") - calculated_price_flag: bool | None = Field( - default=None, alias="calculatedPriceFlag" - ) - calculated_cost_flag: bool | None = Field(default=None, alias="calculatedCostFlag") - forecast_detail_id: int | None = Field(default=None, alias="forecastDetailId") - cancelled_by: int | None = Field(default=None, alias="cancelledBy") - cancelled_date: datetime | None = Field(default=None, alias="cancelledDate") - warehouse: str | None = None - warehouse_bin: str | None = Field(default=None, alias="warehouseBin") - purchase_date: datetime | None = Field(default=None, alias="purchaseDate") - integration_x_ref: str | None = Field(default=None, alias="integrationXRef") - list_price: float | None = Field(default=None, alias="listPrice") - serial_number_ids: list[int] | None = Field(default=None, alias="serialNumberIds") - serial_numbers: list[str] | None = Field(default=None, alias="serialNumbers") - company: CompanyReference | None = None - forecast_status: OpportunityStatusReference | None = Field( - default=None, alias="forecastStatus" - ) - product_class: Literal[ - "Agreement", "Bundle", "Inventory", "NonInventory", "Service" - ] | None = Field(default=None, alias="productClass") - need_to_purchase_flag: bool | None = Field(default=None, alias="needToPurchaseFlag") - need_to_order_quantity: int | None = Field( - default=None, alias="needToOrderQuantity" - ) - minimum_stock_flag: bool | None = Field(default=None, alias="minimumStockFlag") - ship_set: str | None = Field(default=None, alias="shipSet") + vendor: CompanyReference | None = None + vendor_sku: Annotated[str | None, Field(alias="vendorSku")] = None """ - Max length: 10; + Max length: 50; """ - calculated_price: float | None = Field(default=None, alias="calculatedPrice") - calculated_cost: float | None = Field(default=None, alias="calculatedCost") - invoice_grouping: InvoiceGroupingReference | None = Field( - default=None, alias="invoiceGrouping" - ) - po_approved_flag: bool | None = Field(default=None, alias="poApprovedFlag") - add_components_flag: bool | None = Field(default=None, alias="addComponentsFlag") - ignore_pricing_schedules_flag: bool | None = Field( - default=None, alias="ignorePricingSchedulesFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - bypass_forecast_update: bool | None = Field( - default=None, alias="bypassForecastUpdate" - ) - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + warehouse: str | None = None + warehouse_bin: Annotated[str | None, Field(alias="warehouseBin")] = None + warehouse_bin_id: Annotated[int | None, Field(alias="warehouseBinId")] = None + warehouse_id: Annotated[int | None, Field(alias="warehouseId")] = None class ProductPickingShippingDetail(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - picked_quantity: int | None = Field(default=None, alias="pickedQuantity") - shipped_quantity: int | None = Field(default=None, alias="shippedQuantity") - warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - shipment_method: ShipmentMethodReference | None = Field( - default=None, alias="shipmentMethod" - ) - serial_number: str | None = Field(default=None, alias="serialNumber") - serial_number_ids: list[int] | None = Field(default=None, alias="serialNumberIds") - tracking_number: str | None = Field(default=None, alias="trackingNumber") - product_item: ProductItemReference | None = Field(default=None, alias="productItem") - line_number: int | None = Field(default=None, alias="lineNumber") + line_number: Annotated[int | None, Field(alias="lineNumber")] = None + picked_quantity: Annotated[int | None, Field(alias="pickedQuantity")] = None + product_item: Annotated[ProductItemReference | None, Field(alias="productItem")] = None quantity: int | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + serial_number: Annotated[str | None, Field(alias="serialNumber")] = None + serial_number_ids: Annotated[list[int] | None, Field(alias="serialNumberIds")] = None + shipment_method: Annotated[ShipmentMethodReference | None, Field(alias="shipmentMethod")] = None + shipped_quantity: Annotated[int | None, Field(alias="shippedQuantity")] = None + tracking_number: Annotated[str | None, Field(alias="trackingNumber")] = None + warehouse: WarehouseReference | None = None + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None class ProductTypeExemption(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - product_type: ProductTypeReference = Field(..., alias="productType") - taxable_levels: list[int] | None = Field(default=None, alias="taxableLevels") - info: dict[str, str] | None = Field(default=None, alias="_info") + product_type: Annotated[ProductTypeReference, Field(alias="productType")] + taxable_levels: Annotated[list[int] | None, Field(alias="taxableLevels")] = None class Project(ConnectWiseModel): - id: int | None = None - actual_end: datetime | None = Field(default=None, alias="actualEnd") - actual_hours: float | None = Field(default=None, alias="actualHours") - actual_start: datetime | None = Field(default=None, alias="actualStart") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + actual_end: Annotated[datetime | None, Field(alias="actualEnd")] = None + actual_hours: Annotated[float | None, Field(alias="actualHours")] = None + actual_start: Annotated[datetime | None, Field(alias="actualStart")] = None agreement: AgreementReference | None = None - bill_expenses: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billExpenses") + bill_expenses: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billExpenses") + ] = None """ Required On Updates; """ - billing_amount: float | None = Field(default=None, alias="billingAmount") - billing_attention: str | None = Field(default=None, alias="billingAttention") + bill_products: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billProducts") + ] = None """ - Max length: 50; + Required On Updates; """ - billing_method: Literal[ - "ActualRates", "FixedFee", "NotToExceed", "OverrideRate" - ] = Field(..., alias="billingMethod") - billing_rate_type: Literal["StaffMember", "WorkRole"] | None = Field( - default=None, alias="billingRateType" - ) + bill_project_after_closed_flag: Annotated[bool | None, Field(alias="billProjectAfterClosedFlag")] = None + bill_time: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billTime") + ] = None """ Required On Updates; """ - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - bill_products: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billProducts") + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + bill_to_contact: Annotated[ContactReference | None, Field(alias="billToContact")] = None + bill_to_site: Annotated[SiteReference | None, Field(alias="billToSite")] = None + bill_unapproved_time_and_expense: Annotated[bool | None, Field(alias="billUnapprovedTimeAndExpense")] = None + billing_amount: Annotated[float | None, Field(alias="billingAmount")] = None + billing_attention: Annotated[str | None, Field(alias="billingAttention")] = None """ - Required On Updates; + Max length: 50; """ - bill_project_after_closed_flag: bool | None = Field( - default=None, alias="billProjectAfterClosedFlag" - ) - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) + billing_method: Annotated[ + Literal["ActualRates", "FixedFee", "NotToExceed", "OverrideRate"], Field(alias="billingMethod") + ] + billing_rate_type: Annotated[Literal["StaffMember", "WorkRole"] | None, Field(alias="billingRateType")] = None """ Required On Updates; """ - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - bill_to_contact: ContactReference | None = Field( - default=None, alias="billToContact" - ) - bill_to_site: SiteReference | None = Field(default=None, alias="billToSite") - bill_unapproved_time_and_expense: bool | None = Field( - default=None, alias="billUnapprovedTimeAndExpense" - ) + billing_start_date: Annotated[datetime | None, Field(alias="billingStartDate")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None board: ProjectBoardReference | None = None - budget_analysis: Literal["ActualHours", "BillableHours"] | None = Field( - default=None, alias="budgetAnalysis" - ) + budget_analysis: Annotated[Literal["ActualHours", "BillableHours"] | None, Field(alias="budgetAnalysis")] = None """ Required On Updates; """ - budget_flag: bool | None = Field(default=None, alias="budgetFlag") - budget_hours: float | None = Field(default=None, alias="budgetHours") + budget_flag: Annotated[bool | None, Field(alias="budgetFlag")] = None + budget_hours: Annotated[float | None, Field(alias="budgetHours")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None company: CompanyReference | None = None + company_location: Annotated[SystemLocationReference | None, Field(alias="companyLocation")] = None contact: ContactReference | None = None - customer_po: str | None = Field(default=None, alias="customerPO") + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_po: Annotated[str | None, Field(alias="customerPO")] = None """ Max length: 50; """ + department: SystemDepartmentReference | None = None description: str | None = None - currency: CurrencyReference | None = None + do_not_display_in_portal_flag: Annotated[bool | None, Field(alias="doNotDisplayInPortalFlag")] = None downpayment: float | None = None - estimated_end: datetime = Field(..., alias="estimatedEnd") - percent_complete: float | None = Field(default=None, alias="percentComplete") - estimated_expense_revenue: float | None = Field( - default=None, alias="estimatedExpenseRevenue" - ) - estimated_hours: float | None = Field(default=None, alias="estimatedHours") - estimated_product_revenue: float | None = Field( - default=None, alias="estimatedProductRevenue" - ) - estimated_start: datetime = Field(..., alias="estimatedStart") - estimated_time_revenue: float | None = Field( - default=None, alias="estimatedTimeRevenue" - ) - expense_approver: MemberReference | None = Field( - default=None, alias="expenseApprover" - ) - include_dependencies_flag: bool | None = Field( - default=None, alias="includeDependenciesFlag" - ) - include_estimates_flag: bool | None = Field( - default=None, alias="includeEstimatesFlag" - ) + estimated_end: Annotated[datetime, Field(alias="estimatedEnd")] + estimated_expense_cost: Annotated[float | None, Field(alias="estimatedExpenseCost")] = None + estimated_expense_revenue: Annotated[float | None, Field(alias="estimatedExpenseRevenue")] = None + estimated_hours: Annotated[float | None, Field(alias="estimatedHours")] = None + estimated_product_cost: Annotated[float | None, Field(alias="estimatedProductCost")] = None + estimated_product_revenue: Annotated[float | None, Field(alias="estimatedProductRevenue")] = None + estimated_start: Annotated[datetime, Field(alias="estimatedStart")] + estimated_time_cost: Annotated[float | None, Field(alias="estimatedTimeCost")] = None + estimated_time_revenue: Annotated[float | None, Field(alias="estimatedTimeRevenue")] = None + expense_approver: Annotated[MemberReference | None, Field(alias="expenseApprover")] = None + id: int | None = None + include_dependencies_flag: Annotated[bool | None, Field(alias="includeDependenciesFlag")] = None + include_estimates_flag: Annotated[bool | None, Field(alias="includeEstimatesFlag")] = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None manager: MemberReference | None = None name: str """ Max length: 100; """ opportunity: OpportunityReference | None = None - project_template_id: int | None = Field(default=None, alias="projectTemplateId") - restrict_down_payment_flag: bool | None = Field( - default=None, alias="restrictDownPaymentFlag" - ) - scheduled_end: datetime | None = Field(default=None, alias="scheduledEnd") - scheduled_hours: float | None = Field(default=None, alias="scheduledHours") - scheduled_start: datetime | None = Field(default=None, alias="scheduledStart") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_contact: ContactReference | None = Field( - default=None, alias="shipToContact" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") + percent_complete: Annotated[float | None, Field(alias="percentComplete")] = None + project_template_id: Annotated[int | None, Field(alias="projectTemplateId")] = None + restrict_down_payment_flag: Annotated[bool | None, Field(alias="restrictDownPaymentFlag")] = None + scheduled_end: Annotated[datetime | None, Field(alias="scheduledEnd")] = None + scheduled_hours: Annotated[float | None, Field(alias="scheduledHours")] = None + scheduled_start: Annotated[datetime | None, Field(alias="scheduledStart")] = None + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + ship_to_contact: Annotated[ContactReference | None, Field(alias="shipToContact")] = None + ship_to_site: Annotated[SiteReference | None, Field(alias="shipToSite")] = None site: SiteReference | None = None status: ProjectStatusReference | None = None - closed_flag: bool | None = Field(default=None, alias="closedFlag") - time_approver: MemberReference | None = Field(default=None, alias="timeApprover") + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + time_approver: Annotated[MemberReference | None, Field(alias="timeApprover")] = None type: ProjectTypeReference | None = None - do_not_display_in_portal_flag: bool | None = Field( - default=None, alias="doNotDisplayInPortalFlag" - ) - billing_start_date: datetime | None = Field(default=None, alias="billingStartDate") - estimated_time_cost: float | None = Field(default=None, alias="estimatedTimeCost") - estimated_expense_cost: float | None = Field( - default=None, alias="estimatedExpenseCost" - ) - estimated_product_cost: float | None = Field( - default=None, alias="estimatedProductCost" - ) - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - company_location: SystemLocationReference | None = Field( - default=None, alias="companyLocation" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) - - -class ProjectBillingRate(ConnectWiseModel): - id: int | None = None - project_rec_id: int | None = Field(default=None, alias="projectRecId") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - activity_class_rec_id: int | None = Field(default=None, alias="activityClassRecId") - member: MemberReference | None = None - member_rec_id: int | None = Field(default=None, alias="memberRecId") - info: dict[str, str] | None = Field(default=None, alias="_info") class ProjectBoardTeam(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + department: SystemDepartmentReference | None = None id: int | None = None + location: SystemLocationReference | None = None name: str """ Max length: 50; """ - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ProjectBoardTeamMember(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None member: MemberReference | None = None - project_role: ProjectRoleReference | None = Field(default=None, alias="projectRole") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - info: dict[str, str] | None = Field(default=None, alias="_info") + project_role: Annotated[ProjectRoleReference | None, Field(alias="projectRole")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None class ProjectPhase(ConnectWiseModel): - id: int | None = None - project_id: int | None = Field(default=None, alias="projectId") - description: str + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + actual_end: Annotated[datetime | None, Field(alias="actualEnd")] = None + actual_hours: Annotated[float | None, Field(alias="actualHours")] = None + actual_start: Annotated[datetime | None, Field(alias="actualStart")] = None + agreement: AgreementReference | None = None + bill_expenses: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billExpenses") + ] = None """ - Max length: 100; + Required On Updates; """ - board: ProjectBoardReference | None = None - status: PhaseStatusReference | None = None - agreement: AgreementReference | None = None - opportunity: OpportunityReference | None = None - parent_phase: ProjectPhaseReference | None = Field( - default=None, alias="parentPhase" - ) - wbs_code: str | None = Field(default=None, alias="wbsCode") + bill_phase_closed_flag: Annotated[bool | None, Field(alias="billPhaseClosedFlag")] = None """ - Max length: 50; + This phase can only be billed after it has been closed """ - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) + bill_products: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billProducts") + ] = None """ Required On Updates; """ - bill_expenses: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billExpenses") + bill_project_closed_flag: Annotated[bool | None, Field(alias="billProjectClosedFlag")] = None """ - Required On Updates; + This phase can only be billed after the project has been closed """ - bill_products: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billProducts") + bill_separately_flag: Annotated[bool | None, Field(alias="billSeparatelyFlag")] = None + bill_time: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billTime") + ] = None """ Required On Updates; """ - mark_as_milestone_flag: bool | None = Field( - default=None, alias="markAsMilestoneFlag" - ) - notes: str | None = None - deadline_date: datetime | None = Field(default=None, alias="deadlineDate") - bill_separately_flag: bool | None = Field(default=None, alias="billSeparatelyFlag") - billing_method: Literal[ - "ActualRates", "FixedFee", "NotToExceed", "OverrideRate" - ] | None = Field(default=None, alias="billingMethod") - """ - billingMethod is required if the phase billSeparatelyFlag is true. - """ - scheduled_hours: float | None = Field(default=None, alias="scheduledHours") - scheduled_start: str | None = Field(default=None, alias="scheduledStart") - scheduled_end: str | None = Field(default=None, alias="scheduledEnd") - actual_hours: float | None = Field(default=None, alias="actualHours") - actual_start: str | None = Field(default=None, alias="actualStart") - actual_end: str | None = Field(default=None, alias="actualEnd") - budget_hours: float | None = Field(default=None, alias="budgetHours") - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - billing_start_date: datetime | None = Field(default=None, alias="billingStartDate") - bill_phase_closed_flag: bool | None = Field( - default=None, alias="billPhaseClosedFlag" - ) - """ - This phase can only be billed after it has been closed. - """ - bill_project_closed_flag: bool | None = Field( - default=None, alias="billProjectClosedFlag" - ) - """ - This phase can only be billed after the project has been closed. + bill_to_company: Annotated[CompanyReference | None, Field(alias="billToCompany")] = None + bill_to_contact: Annotated[ContactReference | None, Field(alias="billToContact")] = None + bill_to_site: Annotated[SiteReference | None, Field(alias="billToSite")] = None + billing_method: Annotated[ + Literal["ActualRates", "FixedFee", "NotToExceed", "OverrideRate"] | None, Field(alias="billingMethod") + ] = None + """ + billingMethod is required if the phase billSeparatelyFlag is true + """ + billing_start_date: Annotated[datetime | None, Field(alias="billingStartDate")] = None + board: ProjectBoardReference | None = None + budget_hours: Annotated[float | None, Field(alias="budgetHours")] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + deadline_date: Annotated[datetime | None, Field(alias="deadlineDate")] = None + description: str + """ + Max length: 100; """ downpayment: float | None = None - po_number: str | None = Field(default=None, alias="poNumber") + estimated_expense_cost: Annotated[float | None, Field(alias="estimatedExpenseCost")] = None + estimated_expense_revenue: Annotated[float | None, Field(alias="estimatedExpenseRevenue")] = None + estimated_product_cost: Annotated[float | None, Field(alias="estimatedProductCost")] = None + estimated_product_revenue: Annotated[float | None, Field(alias="estimatedProductRevenue")] = None + estimated_time_cost: Annotated[float | None, Field(alias="estimatedTimeCost")] = None + estimated_time_revenue: Annotated[float | None, Field(alias="estimatedTimeRevenue")] = None + hourly_rate: Annotated[float | None, Field(alias="hourlyRate")] = None + id: int | None = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + mark_as_milestone_flag: Annotated[bool | None, Field(alias="markAsMilestoneFlag")] = None + notes: str | None = None + opportunity: OpportunityReference | None = None + parent_phase: Annotated[ProjectPhaseReference | None, Field(alias="parentPhase")] = None + po_amount: Annotated[float | None, Field(alias="poAmount")] = None + po_number: Annotated[str | None, Field(alias="poNumber")] = None """ Max length: 25; """ - po_amount: float | None = Field(default=None, alias="poAmount") - estimated_time_cost: float | None = Field(default=None, alias="estimatedTimeCost") - estimated_expense_cost: float | None = Field( - default=None, alias="estimatedExpenseCost" - ) - estimated_product_cost: float | None = Field( - default=None, alias="estimatedProductCost" - ) - estimated_time_revenue: float | None = Field( - default=None, alias="estimatedTimeRevenue" - ) - estimated_expense_revenue: float | None = Field( - default=None, alias="estimatedExpenseRevenue" - ) - estimated_product_revenue: float | None = Field( - default=None, alias="estimatedProductRevenue" - ) - currency: CurrencyReference | None = None - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - bill_to_contact: ContactReference | None = Field( - default=None, alias="billToContact" - ) - bill_to_site: SiteReference | None = Field(default=None, alias="billToSite") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_contact: ContactReference | None = Field( - default=None, alias="shipToContact" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + project_id: Annotated[int | None, Field(alias="projectId")] = None + scheduled_end: Annotated[datetime | None, Field(alias="scheduledEnd")] = None + scheduled_hours: Annotated[float | None, Field(alias="scheduledHours")] = None + scheduled_start: Annotated[datetime | None, Field(alias="scheduledStart")] = None + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + ship_to_contact: Annotated[ContactReference | None, Field(alias="shipToContact")] = None + ship_to_site: Annotated[SiteReference | None, Field(alias="shipToSite")] = None + status: PhaseStatusReference | None = None + wbs_code: Annotated[str | None, Field(alias="wbsCode")] = None + """ + Max length: 50; + """ class ProjectStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + custom_status_indicator_name: Annotated[str | None, Field(alias="customStatusIndicatorName")] = None + """ + Required when statusIndicator is Custom Max length: 30; + """ + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 30; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - no_time_flag: bool | None = Field(default=None, alias="noTimeFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - status_indicator: StatusIndicatorReference | None = Field( - default=None, alias="statusIndicator" - ) - custom_status_indicator_name: str | None = Field( - default=None, alias="customStatusIndicatorName" - ) - """ - Required when statusIndicator is Custom. Max length: 30; - """ - info: dict[str, str] | None = Field(default=None, alias="_info") + no_time_flag: Annotated[bool | None, Field(alias="noTimeFlag")] = None + status_indicator: Annotated[StatusIndicatorReference | None, Field(alias="statusIndicator")] = None class ProjectTeamMember(ConnectWiseModel): - id: int | None = None - project_id: int | None = Field(default=None, alias="projectId") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + end_date: Annotated[datetime | None, Field(alias="endDate")] = None hours: float | None = None - member: MemberReference | None = None - project_role: ProjectRoleReference | None = Field(default=None, alias="projectRole") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - start_date: datetime | None = Field(default=None, alias="startDate") - end_date: datetime | None = Field(default=None, alias="endDate") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class ProjectTemplate(ConnectWiseModel): - id: int | None = None - name: str - """ - Max length: 200; - """ - description: str | None = None - type: ProjectTypeReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class ProjectTemplateTask(ConnectWiseModel): id: int | None = None - ticket_id: int | None = Field(default=None, alias="ticketId") - sequence: int | None = None - description: str | None = None - summary: str | None = None - code: ServiceCodeReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + member: MemberReference | None = None + project_id: Annotated[int | None, Field(alias="projectId")] = None + project_role: Annotated[ProjectRoleReference | None, Field(alias="projectRole")] = None + start_date: Annotated[datetime | None, Field(alias="startDate")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None -class ProjectTemplateTicket(ConnectWiseModel): - id: int | None = None - project_template_id: int | None = Field(default=None, alias="projectTemplateId") - project_template_phase_id: int | None = Field( - default=None, alias="projectTemplatePhaseId" - ) - line_number: float | None = Field(default=None, alias="lineNumber") - description: str - """ - Max length: 100; - """ - notes: str | None = None - internal_analysis: str | None = Field(default=None, alias="internalAnalysis") - resolution: str | None = None - budget_hours: float | None = Field(default=None, alias="budgetHours") - duration: int | None = None - wbs_code: str | None = Field(default=None, alias="wbsCode") +class ProjectTicket(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + actual_hours: Annotated[float | None, Field(alias="actualHours")] = None + address_line1: Annotated[str | None, Field(alias="addressLine1")] = None """ Max length: 50; """ - bill_separately_flag: bool | None = Field(default=None, alias="billSeparatelyFlag") - mark_as_milestone_flag: bool | None = Field( - default=None, alias="markAsMilestoneFlag" - ) - record_type: str | None = Field(default=None, alias="recordType") + address_line2: Annotated[str | None, Field(alias="addressLine2")] = None """ - Max length: 1; + Max length: 50; """ - pm_tmp_project_rec_id: int | None = Field(default=None, alias="pmTmpProjectRecID") - priority: PriorityReference | None = None - source: ServiceSourceReference | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class ProjectTicket(ConnectWiseModel): - id: int | None = None - summary: str + agreement: AgreementReference | None = None + allow_all_clients_portal_view: Annotated[bool | None, Field(alias="allowAllClientsPortalView")] = None + approved: bool | None = None + automatic_email_cc: Annotated[str | None, Field(alias="automaticEmailCc")] = None """ - Max length: 100; + Max length: 1000; """ - is_issue_flag: bool | None = Field(default=None, alias="isIssueFlag") + automatic_email_cc_flag: Annotated[bool | None, Field(alias="automaticEmailCcFlag")] = None + automatic_email_contact_flag: Annotated[bool | None, Field(alias="automaticEmailContactFlag")] = None + automatic_email_resource_flag: Annotated[bool | None, Field(alias="automaticEmailResourceFlag")] = None + bill_expenses: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billExpenses") + ] = None + bill_products: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billProducts") + ] = None + bill_time: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billTime") + ] = None board: BoardReference | None = None - status: ServiceStatusReference | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - project: ProjectReference | None = None - phase: ProjectPhaseReference | None = None - wbs_code: str | None = Field(default=None, alias="wbsCode") + budget_hours: Annotated[float | None, Field(alias="budgetHours")] = None + city: str | None = None """ Max length: 50; """ + closed_by: Annotated[str | None, Field(alias="closedBy")] = None + closed_date: Annotated[datetime | None, Field(alias="closedDate")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None company: CompanyReference | None = None - site: SiteReference | None = None - site_name: str | None = Field(default=None, alias="siteName") - """ - Max length: 50; - """ - address_line1: str | None = Field(default=None, alias="addressLine1") - """ - Max length: 50; - """ - address_line2: str | None = Field(default=None, alias="addressLine2") + contact: ContactReference | None = None + contact_email_address: Annotated[str | None, Field(alias="contactEmailAddress")] = None """ - Max length: 50; + Max length: 250; """ - city: str | None = None + contact_email_lookup: Annotated[str | None, Field(alias="contactEmailLookup")] = None + contact_name: Annotated[str | None, Field(alias="contactName")] = None """ - Max length: 50; + Max length: 62; """ - state_identifier: str | None = Field(default=None, alias="stateIdentifier") + contact_phone_extension: Annotated[str | None, Field(alias="contactPhoneExtension")] = None """ - Max length: 50; + Max length: 15; """ - zip: str | None = None + contact_phone_number: Annotated[str | None, Field(alias="contactPhoneNumber")] = None """ - Max length: 12; + Max length: 20; """ country: CountryReference | None = None - contact: ContactReference | None = None - contact_name: str | None = Field(default=None, alias="contactName") - """ - Max length: 62; - """ - contact_phone_number: str | None = Field(default=None, alias="contactPhoneNumber") + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_updated_flag: Annotated[bool | None, Field(alias="customerUpdatedFlag")] = None + department: SystemDepartmentReference | None = None + duration: int | None = None + estimated_start_date: Annotated[datetime | None, Field(alias="estimatedStartDate")] = None + id: int | None = None + initial_description: Annotated[str | None, Field(alias="initialDescription")] = None """ - Max length: 20; + Only available for POST, will not be returned in the response """ - contact_phone_extension: str | None = Field( - default=None, alias="contactPhoneExtension" - ) + initial_internal_analysis: Annotated[str | None, Field(alias="initialInternalAnalysis")] = None """ - Max length: 15; + Only available for POST, will not be returned in the response """ - contact_email_address: str | None = Field(default=None, alias="contactEmailAddress") + initial_resolution: Annotated[str | None, Field(alias="initialResolution")] = None """ - Max length: 250; + Only available for POST, will not be returned in the response """ - type: ServiceTypeReference | None = None - sub_type: ServiceSubTypeReference | None = Field(default=None, alias="subType") + is_issue_flag: Annotated[bool | None, Field(alias="isIssueFlag")] = None item: ServiceItemReference | None = None + knowledge_base_category_id: Annotated[int | None, Field(alias="knowledgeBaseCategoryId")] = None + knowledge_base_link_id: Annotated[int | None, Field(alias="knowledgeBaseLinkId")] = None + knowledge_base_link_type: Annotated[ + Literal["Activity", "ProjectIssue", "KnowledgeBaseArticle", "ProjectTicket", "ServiceTicket", "Time"] | None, + Field(alias="knowledgeBaseLinkType"), + ] = None + knowledge_base_sub_category_id: Annotated[int | None, Field(alias="knowledgeBaseSubCategoryId")] = None + lag_days: Annotated[int | None, Field(alias="lagDays")] = None + lag_nonworking_days_flag: Annotated[bool | None, Field(alias="lagNonworkingDaysFlag")] = None + location: SystemLocationReference | None = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + opportunity: OpportunityReference | None = None owner: MemberReference | None = None + phase: ProjectPhaseReference | None = None + predecessor_closed_flag: Annotated[bool | None, Field(alias="predecessorClosedFlag")] = None + predecessor_id: Annotated[int | None, Field(alias="predecessorId")] = None + predecessor_type: Annotated[Literal["Ticket", "Phase"] | None, Field(alias="predecessorType")] = None priority: PriorityReference | None = None - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - source: ServiceSourceReference | None = None - required_date: datetime | None = Field(default=None, alias="requiredDate") - budget_hours: float | None = Field(default=None, alias="budgetHours") - opportunity: OpportunityReference | None = None - agreement: AgreementReference | None = None - knowledge_base_category_id: int | None = Field( - default=None, alias="knowledgeBaseCategoryId" - ) - knowledge_base_sub_category_id: int | None = Field( - default=None, alias="knowledgeBaseSubCategoryId" - ) - knowledge_base_link_id: int | None = Field( - default=None, alias="knowledgeBaseLinkId" - ) - knowledge_base_link_type: Literal[ - "Activity", - "ProjectIssue", - "KnowledgeBaseArticle", - "ProjectTicket", - "ServiceTicket", - "Time", - ] | None = Field(default=None, alias="knowledgeBaseLinkType") - allow_all_clients_portal_view: bool | None = Field( - default=None, alias="allowAllClientsPortalView" - ) - customer_updated_flag: bool | None = Field( - default=None, alias="customerUpdatedFlag" - ) - automatic_email_contact_flag: bool | None = Field( - default=None, alias="automaticEmailContactFlag" - ) - automatic_email_resource_flag: bool | None = Field( - default=None, alias="automaticEmailResourceFlag" - ) - automatic_email_cc_flag: bool | None = Field( - default=None, alias="automaticEmailCcFlag" - ) - automatic_email_cc: str | None = Field(default=None, alias="automaticEmailCc") + process_notifications: Annotated[bool | None, Field(alias="processNotifications")] = None """ - Max length: 1000; + Can be set to false to skip notification processing when adding or updating a ticket (Defaults to True) """ - closed_date: str | None = Field(default=None, alias="closedDate") - closed_by: str | None = Field(default=None, alias="closedBy") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - actual_hours: float | None = Field(default=None, alias="actualHours") - approved: bool | None = None - sub_billing_method: Literal[ - "ActualRates", "FixedFee", "NotToExceed", "OverrideRate" - ] | None = Field(default=None, alias="subBillingMethod") - sub_billing_amount: float | None = Field(default=None, alias="subBillingAmount") - sub_date_accepted: str | None = Field(default=None, alias="subDateAccepted") + project: ProjectReference | None = None + required_date: Annotated[datetime | None, Field(alias="requiredDate")] = None resources: str | None = None - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) - bill_expenses: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billExpenses") - bill_products: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billProducts") - predecessor_type: Literal["Ticket", "Phase"] | None = Field( - default=None, alias="predecessorType" - ) - predecessor_id: int | None = Field(default=None, alias="predecessorId") - predecessor_closed_flag: bool | None = Field( - default=None, alias="predecessorClosedFlag" - ) - lag_days: int | None = Field(default=None, alias="lagDays") - lag_nonworking_days_flag: bool | None = Field( - default=None, alias="lagNonworkingDaysFlag" - ) - estimated_start_date: datetime | None = Field( - default=None, alias="estimatedStartDate" - ) - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - duration: int | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - currency: CurrencyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - tasks: list[TicketTask] | None = None - initial_description: str | None = Field(default=None, alias="initialDescription") + service_location: Annotated[ServiceLocationReference | None, Field(alias="serviceLocation")] = None + site: SiteReference | None = None + site_name: Annotated[str | None, Field(alias="siteName")] = None """ - Only available for POST, will not be returned in the response. + Max length: 50; + """ + skip_callback: Annotated[bool | None, Field(alias="skipCallback")] = None + source: ServiceSourceReference | None = None + state_identifier: Annotated[str | None, Field(alias="stateIdentifier")] = None + """ + Max length: 50; """ - initial_internal_analysis: str | None = Field( - default=None, alias="initialInternalAnalysis" - ) + status: ServiceStatusReference | None = None + sub_billing_amount: Annotated[float | None, Field(alias="subBillingAmount")] = None + sub_billing_method: Annotated[ + Literal["ActualRates", "FixedFee", "NotToExceed", "OverrideRate"] | None, Field(alias="subBillingMethod") + ] = None + sub_date_accepted: Annotated[str | None, Field(alias="subDateAccepted")] = None + sub_type: Annotated[ServiceSubTypeReference | None, Field(alias="subType")] = None + summary: str """ - Only available for POST, will not be returned in the response. + Max length: 100; """ - initial_resolution: str | None = Field(default=None, alias="initialResolution") + type: ServiceTypeReference | None = None + wbs_code: Annotated[str | None, Field(alias="wbsCode")] = None """ - Only available for POST, will not be returned in the response. + Max length: 50; """ - contact_email_lookup: str | None = Field(default=None, alias="contactEmailLookup") - process_notifications: bool | None = Field( - default=None, alias="processNotifications" - ) + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None + zip: str | None = None """ - Can be set to false to skip notification processing when adding or updating a ticket (Defaults to True). + Max length: 12; """ - skip_callback: bool | None = Field(default=None, alias="skipCallback") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class ProjectTicketNote(ConnectWiseModel): - id: int | None = None - note_type: Literal["TicketNote", "TimeEntryNote", "MeetingNote"] | None = Field( - default=None, alias="noteType" - ) - ticket: TicketReference | None = None - text: str | None = None - detail_description_flag: bool | None = Field( - default=None, alias="detailDescriptionFlag" - ) - internal_analysis_flag: bool | None = Field( - default=None, alias="internalAnalysisFlag" - ) - resolution_flag: bool | None = Field(default=None, alias="resolutionFlag") - time_start: datetime | None = Field(default=None, alias="timeStart") - time_end: datetime | None = Field(default=None, alias="timeEnd") - bundled_flag: bool | None = Field(default=None, alias="bundledFlag") - merged_flag: bool | None = Field(default=None, alias="mergedFlag") - issue_flag: bool | None = Field(default=None, alias="issueFlag") - original_author: str | None = Field(default=None, alias="originalAuthor") - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + bundled_flag: Annotated[bool | None, Field(alias="bundledFlag")] = None contact: ContactReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class ProjectWorkplan(ConnectWiseModel): + detail_description_flag: Annotated[bool | None, Field(alias="detailDescriptionFlag")] = None id: int | None = None - project_id: int | None = Field(default=None, alias="projectId") - description: str | None = None - board: ProjectBoardReference | None = None - status: PhaseStatusReference | None = None - agreement: AgreementReference | None = None - opportunity: OpportunityReference | None = None - parent_phase: ProjectPhaseReference | None = Field( - default=None, alias="parentPhase" - ) - wbs_code: str | None = Field(default=None, alias="wbsCode") - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) - bill_expenses: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billExpenses") - bill_products: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billProducts") - mark_as_milestone_flag: bool | None = Field( - default=None, alias="markAsMilestoneFlag" - ) - notes: str | None = None - deadline_date: str | None = Field(default=None, alias="deadlineDate") - bill_separately_flag: bool | None = Field(default=None, alias="billSeparatelyFlag") - billing_method: Literal[ - "ActualRates", "FixedFee", "NotToExceed", "OverrideRate" - ] | None = Field(default=None, alias="billingMethod") - """ - billingMethod is required if the phase billSeparatelyFlag is true. - """ - scheduled_hours: float | None = Field(default=None, alias="scheduledHours") - scheduled_start: str | None = Field(default=None, alias="scheduledStart") - scheduled_end: str | None = Field(default=None, alias="scheduledEnd") - actual_hours: float | None = Field(default=None, alias="actualHours") - actual_start: str | None = Field(default=None, alias="actualStart") - actual_end: str | None = Field(default=None, alias="actualEnd") - budget_hours: float | None = Field(default=None, alias="budgetHours") - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - billing_start_date: str | None = Field(default=None, alias="billingStartDate") - bill_phase_closed_flag: bool | None = Field( - default=None, alias="billPhaseClosedFlag" - ) - """ - This phase can only be billed after it has been closed. - """ - bill_project_closed_flag: bool | None = Field( - default=None, alias="billProjectClosedFlag" - ) - """ - This phase can only be billed after the project has been closed. - """ - downpayment: float | None = None - po_number: str | None = Field(default=None, alias="poNumber") - po_amount: float | None = Field(default=None, alias="poAmount") - estimated_time_cost: float | None = Field(default=None, alias="estimatedTimeCost") - estimated_expense_cost: float | None = Field( - default=None, alias="estimatedExpenseCost" - ) - estimated_product_cost: float | None = Field( - default=None, alias="estimatedProductCost" - ) - estimated_time_revenue: float | None = Field( - default=None, alias="estimatedTimeRevenue" - ) - estimated_expense_revenue: float | None = Field( - default=None, alias="estimatedExpenseRevenue" - ) - estimated_product_revenue: float | None = Field( - default=None, alias="estimatedProductRevenue" - ) - currency: CurrencyReference | None = None - bill_to_company: CompanyReference | None = Field( - default=None, alias="billToCompany" - ) - bill_to_contact: ContactReference | None = Field( - default=None, alias="billToContact" - ) - bill_to_site: SiteReference | None = Field(default=None, alias="billToSite") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_contact: ContactReference | None = Field( - default=None, alias="shipToContact" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") - info: dict[str, str] | None = Field(default=None, alias="_info") - tickets: list[ProjectTicket] | None = None - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + internal_analysis_flag: Annotated[bool | None, Field(alias="internalAnalysisFlag")] = None + issue_flag: Annotated[bool | None, Field(alias="issueFlag")] = None + member: MemberReference | None = None + merged_flag: Annotated[bool | None, Field(alias="mergedFlag")] = None + note_type: Annotated[Literal["TicketNote", "TimeEntryNote", "MeetingNote"] | None, Field(alias="noteType")] = None + original_author: Annotated[str | None, Field(alias="originalAuthor")] = None + resolution_flag: Annotated[bool | None, Field(alias="resolutionFlag")] = None + text: str | None = None + ticket: TicketReference | None = None + time_end: Annotated[datetime | None, Field(alias="timeEnd")] = None + time_start: Annotated[datetime | None, Field(alias="timeStart")] = None class PurchaseOrder(ConnectWiseModel): - id: int | None = None - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - cancel_reason: str | None = Field(default=None, alias="cancelReason") - closed_flag: bool | None = Field(default=None, alias="closedFlag") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + cancel_reason: Annotated[str | None, Field(alias="cancelReason")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None """ The closed flag can only be updated via updating the purchase order status to a closed/open status. """ - closed_by: str | None = Field(default=None, alias="closedBy") - customer_city: str | None = Field(default=None, alias="customerCity") - customer_company: CompanyReference | None = Field( - default=None, alias="customerCompany" - ) - customer_contact: ContactReference | None = Field( - default=None, alias="customerContact" - ) - customer_country: CountryReference | None = Field( - default=None, alias="customerCountry" - ) - customer_extension: str | None = Field(default=None, alias="customerExtension") - customer_name: str | None = Field(default=None, alias="customerName") - customer_phone: str | None = Field(default=None, alias="customerPhone") - customer_site: SiteReference | None = Field(default=None, alias="customerSite") - customer_site_name: str | None = Field(default=None, alias="customerSiteName") - customer_state: str | None = Field(default=None, alias="customerState") - customer_street_line1: str | None = Field(default=None, alias="customerStreetLine1") - customer_street_line2: str | None = Field(default=None, alias="customerStreetLine2") - customer_zip: str | None = Field(default=None, alias="customerZip") - date_closed: datetime | None = Field(default=None, alias="dateClosed") - drop_ship_customer_flag: bool | None = Field( - default=None, alias="dropShipCustomerFlag" - ) - entered_by: str | None = Field(default=None, alias="enteredBy") - freight_cost: float | None = Field(default=None, alias="freightCost") - freight_packing_slip: str | None = Field(default=None, alias="freightPackingSlip") - freight_tax_total: float | None = Field(default=None, alias="freightTaxTotal") - internal_notes: str | None = Field(default=None, alias="internalNotes") - location_id: int | None = Field(default=None, alias="locationId") - po_date: datetime | None = Field(default=None, alias="poDate") + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_city: Annotated[str | None, Field(alias="customerCity")] = None + customer_company: Annotated[CompanyReference | None, Field(alias="customerCompany")] = None + customer_contact: Annotated[ContactReference | None, Field(alias="customerContact")] = None + customer_country: Annotated[CountryReference | None, Field(alias="customerCountry")] = None + customer_extension: Annotated[str | None, Field(alias="customerExtension")] = None + customer_name: Annotated[str | None, Field(alias="customerName")] = None + customer_phone: Annotated[str | None, Field(alias="customerPhone")] = None + customer_site: Annotated[SiteReference | None, Field(alias="customerSite")] = None + customer_site_name: Annotated[str | None, Field(alias="customerSiteName")] = None + customer_state: Annotated[str | None, Field(alias="customerState")] = None + customer_street_line1: Annotated[str | None, Field(alias="customerStreetLine1")] = None + customer_street_line2: Annotated[str | None, Field(alias="customerStreetLine2")] = None + customer_zip: Annotated[str | None, Field(alias="customerZip")] = None + date_closed: Annotated[datetime | None, Field(alias="dateClosed")] = None + drop_ship_customer_flag: Annotated[bool | None, Field(alias="dropShipCustomerFlag")] = None + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None + freight_cost: Annotated[float | None, Field(alias="freightCost")] = None + freight_packing_slip: Annotated[str | None, Field(alias="freightPackingSlip")] = None + freight_tax_total: Annotated[float | None, Field(alias="freightTaxTotal")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + po_date: Annotated[datetime | None, Field(alias="poDate")] = None """ Required On Updates; """ - po_number: str | None = Field(default=None, alias="poNumber") + po_number: Annotated[str | None, Field(alias="poNumber")] = None """ Required On Updates; Max length: 50; """ - sales_tax: float | None = Field(default=None, alias="salesTax") - shipment_date: datetime | None = Field(default=None, alias="shipmentDate") - shipment_method: ShipmentMethodReference | None = Field( - default=None, alias="shipmentMethod" - ) - shipping_instructions: str | None = Field( - default=None, alias="shippingInstructions" - ) + sales_tax: Annotated[float | None, Field(alias="salesTax")] = None + shipment_date: Annotated[datetime | None, Field(alias="shipmentDate")] = None + shipment_method: Annotated[ShipmentMethodReference | None, Field(alias="shipmentMethod")] = None + shipping_instructions: Annotated[str | None, Field(alias="shippingInstructions")] = None status: PurchaseOrderStatusReference | None = None - sub_total: float | None = Field(default=None, alias="subTotal") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - tax_freight_flag: bool | None = Field(default=None, alias="taxFreightFlag") - tax_po_flag: bool | None = Field(default=None, alias="taxPoFlag") + sub_total: Annotated[float | None, Field(alias="subTotal")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_freight_flag: Annotated[bool | None, Field(alias="taxFreightFlag")] = None + tax_po_flag: Annotated[bool | None, Field(alias="taxPoFlag")] = None terms: BillingTermsReference | None = None total: float | None = None - tracking_number: str | None = Field(default=None, alias="trackingNumber") + tracking_number: Annotated[str | None, Field(alias="trackingNumber")] = None """ Max length: 50; """ - update_shipment_info: bool | None = Field(default=None, alias="updateShipmentInfo") + update_shipment_info: Annotated[bool | None, Field(alias="updateShipmentInfo")] = None """ - Determines whether or not to update all of the shipment info for each associated line item when new shipment info is passed in. + Determines whether or not to update all of the shipment info for each associated line item when new shipment info is passed in """ - update_vendor_order_number: bool | None = Field( - default=None, alias="updateVendorOrderNumber" - ) + update_vendor_order_number: Annotated[bool | None, Field(alias="updateVendorOrderNumber")] = None """ - Determines whether or not to update vendor order number for each associated line item when new vendor order number is passed in. + Determines whether or not to update vendor order number for each associated line item when new vendor order number is passed in """ - vendor_company: CompanyReference | None = Field(default=None, alias="vendorCompany") - vendor_contact: ContactReference | None = Field(default=None, alias="vendorContact") - vendor_invoice_date: datetime | None = Field( - default=None, alias="vendorInvoiceDate" - ) - vendor_invoice_number: str | None = Field(default=None, alias="vendorInvoiceNumber") + vendor_company: Annotated[CompanyReference | None, Field(alias="vendorCompany")] = None + vendor_contact: Annotated[ContactReference | None, Field(alias="vendorContact")] = None + vendor_invoice_date: Annotated[datetime | None, Field(alias="vendorInvoiceDate")] = None + vendor_invoice_number: Annotated[str | None, Field(alias="vendorInvoiceNumber")] = None """ Max length: 50; """ - vendor_order_number: str | None = Field(default=None, alias="vendorOrderNumber") + vendor_order_number: Annotated[str | None, Field(alias="vendorOrderNumber")] = None """ Max length: 50; """ - vendor_site: SiteReference | None = Field(default=None, alias="vendorSite") + vendor_site: Annotated[SiteReference | None, Field(alias="vendorSite")] = None warehouse: WarehouseReference | None = None - warehouse_contact: ContactReference | None = Field( - default=None, alias="warehouseContact" - ) - currency: CurrencyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) class PurchaseOrderLineItem(ConnectWiseModel): - id: int | None = None - backordered_flag: bool | None = Field(default=None, alias="backorderedFlag") - canceled_by: str | None = Field(default=None, alias="canceledBy") - canceled_flag: bool | None = Field(default=None, alias="canceledFlag") - canceled_reason: str | None = Field(default=None, alias="canceledReason") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + backordered_flag: Annotated[bool | None, Field(alias="backorderedFlag")] = None + canceled_by: Annotated[str | None, Field(alias="canceledBy")] = None + canceled_flag: Annotated[bool | None, Field(alias="canceledFlag")] = None + canceled_reason: Annotated[str | None, Field(alias="canceledReason")] = None """ Max length: 100; """ - closed_flag: bool | None = Field(default=None, alias="closedFlag") - date_canceled: datetime | None = Field(default=None, alias="dateCanceled") - date_canceled_utc: datetime | None = Field(default=None, alias="dateCanceledUtc") + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + date_canceled: Annotated[datetime | None, Field(alias="dateCanceled")] = None + date_canceled_utc: Annotated[datetime | None, Field(alias="dateCanceledUtc")] = None + date_received: Annotated[datetime | None, Field(alias="dateReceived")] = None description: str """ Max length: 6000; """ - display_internal_notes_flag: bool | None = Field( - default=None, alias="displayInternalNotesFlag" - ) - expected_ship_date: datetime | None = Field(default=None, alias="expectedShipDate") - internal_notes: str | None = Field(default=None, alias="internalNotes") + display_internal_notes_flag: Annotated[bool | None, Field(alias="displayInternalNotesFlag")] = None + expected_ship_date: Annotated[datetime | None, Field(alias="expectedShipDate")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None """ Max length: 1000; """ - line_number: int = Field(..., alias="lineNumber") - packing_slip: str | None = Field(default=None, alias="packingSlip") + line_number: Annotated[int, Field(alias="lineNumber")] + packing_slip: Annotated[str | None, Field(alias="packingSlip")] = None """ Max length: 50; """ product: IvItemReference | None = None - purchase_order_id: int | None = Field(default=None, alias="purchaseOrderId") + purchase_order_id: Annotated[int | None, Field(alias="purchaseOrderId")] = None quantity: float - received_quantity: int | None = Field(default=None, alias="receivedQuantity") - serial_numbers: str | None = Field(default=None, alias="serialNumbers") - ship_date: datetime | None = Field(default=None, alias="shipDate") - shipment_method: ShipmentMethodReference | None = Field( - default=None, alias="shipmentMethod" - ) + received_quantity: Annotated[int | None, Field(alias="receivedQuantity")] = None + received_status: Annotated[ + Literal["Waiting", "FullyReceived", "PartiallyReceiveCancelRest", "PartiallyReceiveCloneRest"] | None, + Field(alias="receivedStatus"), + ] = None + serial_numbers: Annotated[str | None, Field(alias="serialNumbers")] = None + ship_date: Annotated[datetime | None, Field(alias="shipDate")] = None + ship_set: Annotated[str | None, Field(alias="shipSet")] = None + """ + Max length: 10; + """ + shipment_method: Annotated[ShipmentMethodReference | None, Field(alias="shipmentMethod")] = None tax: float | None = None - tracking_number: str | None = Field(default=None, alias="trackingNumber") + tracking_number: Annotated[str | None, Field(alias="trackingNumber")] = None """ Max length: 50; """ - unit_cost: float | None = Field(default=None, alias="unitCost") - unit_of_measure: UnitOfMeasureReference | None = Field( - default=None, alias="unitOfMeasure" - ) - vendor_order_number: str | None = Field(default=None, alias="vendorOrderNumber") + unit_cost: Annotated[float | None, Field(alias="unitCost")] = None + unit_of_measure: Annotated[UnitOfMeasureReference | None, Field(alias="unitOfMeasure")] = None + vendor_order_number: Annotated[str | None, Field(alias="vendorOrderNumber")] = None """ Max length: 50; """ - vendor_sku: str | None = Field(default=None, alias="vendorSku") + vendor_sku: Annotated[str | None, Field(alias="vendorSku")] = None """ Max length: 50; """ warehouse: WarehouseReference | None = None - warehouse_bin: WarehouseBinReference | None = Field( - default=None, alias="warehouseBin" - ) - ship_set: str | None = Field(default=None, alias="shipSet") - """ - Max length: 10; - """ - date_received: datetime | None = Field(default=None, alias="dateReceived") - received_status: Literal[ - "Waiting", - "FullyReceived", - "PartiallyReceiveCancelRest", - "PartiallyReceiveCloneRest", - ] | None = Field(default=None, alias="receivedStatus") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + warehouse_bin: Annotated[WarehouseBinReference | None, Field(alias="warehouseBin")] = None class PurchaseOrderStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_closed_flag: Annotated[bool | None, Field(alias="defaultClosedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + email_template: Annotated[PurchaseOrderStatusEmailTemplateReference | None, Field(alias="emailTemplate")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - default_closed_flag: bool | None = Field(default=None, alias="defaultClosedFlag") - sort_order: int | None = Field(default=None, alias="sortOrder") - email_template: PurchaseOrderStatusEmailTemplateReference | None = Field( - default=None, alias="emailTemplate" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class PurchaseOrderStatusEmailTemplate(ConnectWiseModel): - id: int | None = None - status: PurchaseOrderStatusReference | None = None - use_sender_flag: bool | None = Field(default=None, alias="useSenderFlag") - first_name: str | None = Field(default=None, alias="firstName") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + body: str | None = None + copy_sender_flag: Annotated[bool | None, Field(alias="copySenderFlag")] = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None """ Max length: 100; """ - last_name: str | None = Field(default=None, alias="lastName") + first_name: Annotated[str | None, Field(alias="firstName")] = None """ Max length: 100; """ - email_address: str | None = Field(default=None, alias="emailAddress") + id: int | None = None + last_name: Annotated[str | None, Field(alias="lastName")] = None """ Max length: 100; """ + status: PurchaseOrderStatusReference | None = None subject: str """ Max length: 200; """ - body: str | None = None - copy_sender_flag: bool | None = Field(default=None, alias="copySenderFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + use_sender_flag: Annotated[bool | None, Field(alias="useSenderFlag")] = None class PurchaseOrderStatusNotification(ConnectWiseModel): - id: int | None = None - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - status: PurchaseOrderStatusReference | None = None - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None email: str | None = None """ - Purchase Order Status Notification email must be entered if the notify type is "Email Address". Max length: 50; + Purchase Order Status Notification email must be entered if the notify type is "Email Address" Max length: 50; """ - workflow_step: int | None = Field(default=None, alias="workflowStep") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + member: MemberReference | None = None + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None + status: PurchaseOrderStatusReference | None = None + workflow_step: Annotated[int | None, Field(alias="workflowStep")] = None class PurchasingDemand(ConnectWiseModel): - warehouse: WarehouseReference | None = None - vendor: CompanyReference | None = None products: list[ProductDemand] | None = None - purchase_order: PurchaseOrder | None = Field(default=None, alias="purchaseOrder") + purchase_order: Annotated[PurchaseOrder | None, Field(alias="purchaseOrder")] = None + vendor: CompanyReference | None = None + warehouse: WarehouseReference | None = None class QuoteLink(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + all_locations_flag: Annotated[bool | None, Field(alias="allLocationsFlag")] = None id: int | None = None - location: SystemLocationReference | None = None link: str """ Max length: 2000; """ - all_locations_flag: bool | None = Field(default=None, alias="allLocationsFlag") - new_window_flag: bool | None = Field(default=None, alias="newWindowFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + location: SystemLocationReference | None = None + new_window_flag: Annotated[bool | None, Field(alias="newWindowFlag")] = None class ReportCardDetail(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None kpi: KPIReference | None = None - sort_order: int | None = Field(default=None, alias="sortOrder") - report_card: ReportCardReference | None = Field(default=None, alias="reportCard") - info: dict[str, str] | None = Field(default=None, alias="_info") + report_card: Annotated[ReportCardReference | None, Field(alias="reportCard")] = None + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class ResultInfo(ConnectWiseModel): - success: bool | None = None - original_index: int | None = Field(default=None, alias="originalIndex") - status_code: int | None = Field(default=None, alias="statusCode") data: IRestIdentifiedItem | None = None error: ErrorResponseMessage | None = None + original_index: Annotated[int | None, Field(alias="originalIndex")] = None + status_code: Annotated[int | None, Field(alias="statusCode")] = None + success: bool | None = None class RmaStatus(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + email_template: Annotated[RmaStatusEmailTemplateReference | None, Field(alias="emailTemplate")] = None id: int | None = None name: str """ Max length: 50; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - sort_order: int | None = Field(default=None, alias="sortOrder") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - email_template: RmaStatusEmailTemplateReference | None = Field( - default=None, alias="emailTemplate" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + sort_order: Annotated[int | None, Field(alias="sortOrder")] = None class RmaStatusEmailTemplate(ConnectWiseModel): - id: int | None = None - status: RmaStatusReference | None = None - use_sender_flag: bool | None = Field(default=None, alias="useSenderFlag") - first_name: str | None = Field(default=None, alias="firstName") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + body: str + copy_sender_flag: Annotated[bool | None, Field(alias="copySenderFlag")] = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None """ Max length: 100; """ - last_name: str | None = Field(default=None, alias="lastName") + first_name: Annotated[str | None, Field(alias="firstName")] = None """ Max length: 100; """ - email_address: str | None = Field(default=None, alias="emailAddress") + id: int | None = None + last_name: Annotated[str | None, Field(alias="lastName")] = None """ Max length: 100; """ + status: RmaStatusReference | None = None subject: str """ Max length: 200; """ - body: str - copy_sender_flag: bool | None = Field(default=None, alias="copySenderFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + use_sender_flag: Annotated[bool | None, Field(alias="useSenderFlag")] = None class RmaStatusNotification(ConnectWiseModel): - id: int | None = None - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - status: RmaStatusReference | None = None - member: MemberReference | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None email: str | None = None """ - RMA Status Notification sendEmail must be entered if the notify type is "Email Address". Max length: 50; + RMA Status Notification sendEmail must be entered if the notify type is "Email Address" Max length: 50; """ - workflow_step: int | None = Field(default=None, alias="workflowStep") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + member: MemberReference | None = None + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None + status: RmaStatusReference | None = None + workflow_step: Annotated[int | None, Field(alias="workflowStep")] = None class RmaTag(ConnectWiseModel): - id: int | None = None - service_ticket: TicketReference | None = Field(default=None, alias="serviceTicket") - sales_order: SalesOrderReference | None = Field(default=None, alias="salesOrder") - invoice: InvoiceReference | None = None - project: ProjectReference | None = None - summary: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + account_manager: Annotated[MemberReference | None, Field(alias="accountManager")] = None + closed_by: Annotated[MemberReference | None, Field(alias="closedBy")] = None + closing_notes: Annotated[str | None, Field(alias="closingNotes")] = None """ - Max length: 150; + Max length: 1000; """ - product: IvItemReference | None = None - iv_description: str | None = Field(default=None, alias="ivDescription") - product_description: str = Field(..., alias="productDescription") + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + date_closed: Annotated[datetime | None, Field(alias="dateClosed")] = None + department: SystemDepartmentReference | None = None + drop_ship_flag: Annotated[bool | None, Field(alias="dropShipFlag")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None """ - Max length: 200; + Max length: 1000; """ - serial_number: str | None = Field(default=None, alias="serialNumber") - mfg_item_id: str | None = Field(default=None, alias="mfgItemID") + invoice: InvoiceReference | None = None + iv_description: Annotated[str | None, Field(alias="ivDescription")] = None + list_price: Annotated[float | None, Field(alias="listPrice")] = None + location: SystemLocationReference | None = None + mfg_item_id: Annotated[str | None, Field(alias="mfgItemID")] = None """ Max length: 100; """ - status: RmaStatusReference | None = None - list_price: float | None = Field(default=None, alias="listPrice") - unit_price: float | None = Field(default=None, alias="unitPrice") - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - problem_description: str | None = Field(default=None, alias="problemDescription") + problem_description: Annotated[str | None, Field(alias="problemDescription")] = None """ Max length: 1000; """ - returned_company: CompanyReference | None = Field( - default=None, alias="returnedCompany" - ) - returned_contact: ContactReference | None = Field( - default=None, alias="returnedContact" - ) - returned_contact_type: str | None = Field(default=None, alias="returnedContactType") - returned_contact_phone: str | None = Field( - default=None, alias="returnedContactPhone" - ) - returned_contact_extension: str | None = Field( - default=None, alias="returnedContactExtension" - ) - returned_contact_email: str | None = Field( - default=None, alias="returnedContactEmail" - ) - returned_contact_address_line1: str | None = Field( - default=None, alias="returnedContactAddressLine1" - ) + product: IvItemReference | None = None + product_description: Annotated[str, Field(alias="productDescription")] + """ + Max length: 200; + """ + project: ProjectReference | None = None + purchased_company: Annotated[CompanyReference | None, Field(alias="purchasedCompany")] = None + purchased_contact: Annotated[ContactReference | None, Field(alias="purchasedContact")] = None + purchased_contact_address_line1: Annotated[str | None, Field(alias="purchasedContactAddressLine1")] = None """ Max length: 50; """ - returned_contact_address_line2: str | None = Field( - default=None, alias="returnedContactAddressLine2" - ) + purchased_contact_address_line2: Annotated[str | None, Field(alias="purchasedContactAddressLine2")] = None """ Max length: 50; """ - returned_contact_city: str | None = Field(default=None, alias="returnedContactCity") + purchased_contact_city: Annotated[str | None, Field(alias="purchasedContactCity")] = None """ Max length: 50; """ - returned_contact_state: str | None = Field( - default=None, alias="returnedContactState" - ) + purchased_contact_country: Annotated[CountryReference | None, Field(alias="purchasedContactCountry")] = None + purchased_contact_email: Annotated[str | None, Field(alias="purchasedContactEmail")] = None + purchased_contact_extension: Annotated[str | None, Field(alias="purchasedContactExtension")] = None + purchased_contact_phone: Annotated[str | None, Field(alias="purchasedContactPhone")] = None + purchased_contact_state: Annotated[str | None, Field(alias="purchasedContactState")] = None """ Max length: 50; """ - returned_contact_zip: str | None = Field(default=None, alias="returnedContactZip") + purchased_contact_type: Annotated[str | None, Field(alias="purchasedContactType")] = None + purchased_contact_zip: Annotated[str | None, Field(alias="purchasedContactZip")] = None """ Max length: 12; """ - returned_contact_country: CountryReference | None = Field( - default=None, alias="returnedContactCountry" - ) - rma_disposition: RmaDispositionReference | None = Field( - default=None, alias="rmaDisposition" - ) - returned_site: SiteReference | None = Field(default=None, alias="returnedSite") - purchased_company: CompanyReference | None = Field( - default=None, alias="purchasedCompany" - ) - purchased_contact: ContactReference | None = Field( - default=None, alias="purchasedContact" - ) - purchased_contact_type: str | None = Field( - default=None, alias="purchasedContactType" - ) - purchased_contact_phone: str | None = Field( - default=None, alias="purchasedContactPhone" - ) - purchased_contact_extension: str | None = Field( - default=None, alias="purchasedContactExtension" - ) - purchased_contact_email: str | None = Field( - default=None, alias="purchasedContactEmail" - ) - purchased_contact_address_line1: str | None = Field( - default=None, alias="purchasedContactAddressLine1" - ) + purchased_invoice_date: Annotated[date | None, Field(alias="purchasedInvoiceDate")] = None + purchased_invoice_number: Annotated[str | None, Field(alias="purchasedInvoiceNumber")] = None """ Max length: 50; """ - purchased_contact_address_line2: str | None = Field( - default=None, alias="purchasedContactAddressLine2" - ) + purchased_notes: Annotated[str | None, Field(alias="purchasedNotes")] = None """ - Max length: 50; + Max length: 1000; """ - purchased_contact_city: str | None = Field( - default=None, alias="purchasedContactCity" - ) + purchased_order_number: Annotated[str | None, Field(alias="purchasedOrderNumber")] = None """ Max length: 50; """ - purchased_contact_state: str | None = Field( - default=None, alias="purchasedContactState" - ) + purchased_site: Annotated[SiteReference | None, Field(alias="purchasedSite")] = None + purchased_vendor_action: Annotated[RmaActionReference | None, Field(alias="purchasedVendorAction")] = None + purchased_vendor_rma_number: Annotated[str | None, Field(alias="purchasedVendorRmaNumber")] = None """ Max length: 50; """ - purchased_contact_zip: str | None = Field(default=None, alias="purchasedContactZip") + repair_company: Annotated[CompanyReference | None, Field(alias="repairCompany")] = None + repair_contact: Annotated[ContactReference | None, Field(alias="repairContact")] = None + repair_contact_address_line1: Annotated[str | None, Field(alias="repairContactAddressLine1")] = None """ - Max length: 12; + Max length: 50; """ - purchased_contact_country: CountryReference | None = Field( - default=None, alias="purchasedContactCountry" - ) - purchased_invoice_number: str | None = Field( - default=None, alias="purchasedInvoiceNumber" - ) + repair_contact_address_line2: Annotated[str | None, Field(alias="repairContactAddressLine2")] = None """ Max length: 50; """ - purchased_invoice_date: date | None = Field( - default=None, alias="purchasedInvoiceDate" - ) - purchased_order_number: str | None = Field( - default=None, alias="purchasedOrderNumber" - ) + repair_contact_city: Annotated[str | None, Field(alias="repairContactCity")] = None """ Max length: 50; """ - purchased_vendor_action: RmaActionReference | None = Field( - default=None, alias="purchasedVendorAction" - ) - purchased_vendor_rma_number: str | None = Field( - default=None, alias="purchasedVendorRmaNumber" - ) + repair_contact_country: Annotated[CountryReference | None, Field(alias="repairContactCountry")] = None + repair_contact_email: Annotated[str | None, Field(alias="repairContactEmail")] = None + repair_contact_extension: Annotated[str | None, Field(alias="repairContactExtension")] = None + repair_contact_phone: Annotated[str | None, Field(alias="repairContactPhone")] = None + repair_contact_state: Annotated[str | None, Field(alias="repairContactState")] = None """ Max length: 50; """ - purchased_site: SiteReference | None = Field(default=None, alias="purchasedSite") - purchased_notes: str | None = Field(default=None, alias="purchasedNotes") + repair_contact_type: Annotated[str | None, Field(alias="repairContactType")] = None + repair_contact_zip: Annotated[str | None, Field(alias="repairContactZip")] = None + """ + Max length: 12; + """ + repair_notes: Annotated[str | None, Field(alias="repairNotes")] = None """ Max length: 1000; """ - warranty_company: CompanyReference | None = Field( - default=None, alias="warrantyCompany" - ) - warranty_contact: ContactReference | None = Field( - default=None, alias="warrantyContact" - ) - warranty_contact_type: str | None = Field(default=None, alias="warrantyContactType") - warranty_contact_phone: str | None = Field( - default=None, alias="warrantyContactPhone" - ) - warranty_contact_email: str | None = Field( - default=None, alias="warrantyContactEmail" - ) - warranty_contact_extension: str | None = Field( - default=None, alias="warrantyContactExtension" - ) - warranty_contact_address_line1: str | None = Field( - default=None, alias="warrantyContactAddressLine1" - ) + repair_order_number: Annotated[str | None, Field(alias="repairOrderNumber")] = None """ Max length: 50; """ - warranty_contact_address_line2: str | None = Field( - default=None, alias="warrantyContactAddressLine2" - ) + repair_site: Annotated[SiteReference | None, Field(alias="repairSite")] = None + returned_company: Annotated[CompanyReference | None, Field(alias="returnedCompany")] = None + returned_contact: Annotated[ContactReference | None, Field(alias="returnedContact")] = None + returned_contact_address_line1: Annotated[str | None, Field(alias="returnedContactAddressLine1")] = None """ Max length: 50; """ - warranty_contact_city: str | None = Field(default=None, alias="warrantyContactCity") + returned_contact_address_line2: Annotated[str | None, Field(alias="returnedContactAddressLine2")] = None """ Max length: 50; """ - warranty_contact_state: str | None = Field( - default=None, alias="warrantyContactState" - ) + returned_contact_city: Annotated[str | None, Field(alias="returnedContactCity")] = None """ Max length: 50; """ - warranty_contact_zip: str | None = Field(default=None, alias="warrantyContactZip") + returned_contact_country: Annotated[CountryReference | None, Field(alias="returnedContactCountry")] = None + returned_contact_email: Annotated[str | None, Field(alias="returnedContactEmail")] = None + returned_contact_extension: Annotated[str | None, Field(alias="returnedContactExtension")] = None + returned_contact_phone: Annotated[str | None, Field(alias="returnedContactPhone")] = None + returned_contact_state: Annotated[str | None, Field(alias="returnedContactState")] = None """ - Max length: 12; + Max length: 50; """ - warranty_contact_country: CountryReference | None = Field( - default=None, alias="warrantyContactCountry" - ) - warranty_site: SiteReference | None = Field(default=None, alias="warrantySite") - warranty_notes: str | None = Field(default=None, alias="warrantyNotes") + returned_contact_type: Annotated[str | None, Field(alias="returnedContactType")] = None + returned_contact_zip: Annotated[str | None, Field(alias="returnedContactZip")] = None """ - Max length: 1000; + Max length: 12; """ - repair_company: CompanyReference | None = Field(default=None, alias="repairCompany") - repair_contact: ContactReference | None = Field(default=None, alias="repairContact") - repair_contact_type: str | None = Field(default=None, alias="repairContactType") - repair_contact_phone: str | None = Field(default=None, alias="repairContactPhone") - repair_contact_extension: str | None = Field( - default=None, alias="repairContactExtension" - ) - repair_contact_email: str | None = Field(default=None, alias="repairContactEmail") - repair_contact_address_line1: str | None = Field( - default=None, alias="repairContactAddressLine1" - ) + returned_site: Annotated[SiteReference | None, Field(alias="returnedSite")] = None + rma_disposition: Annotated[RmaDispositionReference | None, Field(alias="rmaDisposition")] = None + sales_order: Annotated[SalesOrderReference | None, Field(alias="salesOrder")] = None + serial_number: Annotated[str | None, Field(alias="serialNumber")] = None + service_ticket: Annotated[TicketReference | None, Field(alias="serviceTicket")] = None + ship_method: Annotated[ShipmentMethodReference | None, Field(alias="shipMethod")] = None + shipping_date: Annotated[date | None, Field(alias="shippingDate")] = None + shipping_tracking_number: Annotated[str | None, Field(alias="shippingTrackingNumber")] = None """ Max length: 50; """ - repair_contact_address_line2: str | None = Field( - default=None, alias="repairContactAddressLine2" - ) + status: RmaStatusReference | None = None + summary: str | None = None """ - Max length: 50; + Max length: 150; """ - repair_contact_city: str | None = Field(default=None, alias="repairContactCity") + technical_contact: Annotated[MemberReference | None, Field(alias="technicalContact")] = None + unit_price: Annotated[float | None, Field(alias="unitPrice")] = None + warranty_company: Annotated[CompanyReference | None, Field(alias="warrantyCompany")] = None + warranty_contact: Annotated[ContactReference | None, Field(alias="warrantyContact")] = None + warranty_contact_address_line1: Annotated[str | None, Field(alias="warrantyContactAddressLine1")] = None """ Max length: 50; """ - repair_contact_state: str | None = Field(default=None, alias="repairContactState") + warranty_contact_address_line2: Annotated[str | None, Field(alias="warrantyContactAddressLine2")] = None """ Max length: 50; """ - repair_contact_zip: str | None = Field(default=None, alias="repairContactZip") - """ - Max length: 12; - """ - repair_contact_country: CountryReference | None = Field( - default=None, alias="repairContactCountry" - ) - repair_order_number: str | None = Field(default=None, alias="repairOrderNumber") + warranty_contact_city: Annotated[str | None, Field(alias="warrantyContactCity")] = None """ Max length: 50; """ - repair_site: SiteReference | None = Field(default=None, alias="repairSite") - repair_notes: str | None = Field(default=None, alias="repairNotes") - """ - Max length: 1000; - """ - drop_ship_flag: bool | None = Field(default=None, alias="dropShipFlag") - ship_method: ShipmentMethodReference | None = Field( - default=None, alias="shipMethod" - ) - shipping_date: date | None = Field(default=None, alias="shippingDate") - shipping_tracking_number: str | None = Field( - default=None, alias="shippingTrackingNumber" - ) + warranty_contact_country: Annotated[CountryReference | None, Field(alias="warrantyContactCountry")] = None + warranty_contact_email: Annotated[str | None, Field(alias="warrantyContactEmail")] = None + warranty_contact_extension: Annotated[str | None, Field(alias="warrantyContactExtension")] = None + warranty_contact_phone: Annotated[str | None, Field(alias="warrantyContactPhone")] = None + warranty_contact_state: Annotated[str | None, Field(alias="warrantyContactState")] = None """ Max length: 50; """ - internal_notes: str | None = Field(default=None, alias="internalNotes") + warranty_contact_type: Annotated[str | None, Field(alias="warrantyContactType")] = None + warranty_contact_zip: Annotated[str | None, Field(alias="warrantyContactZip")] = None """ - Max length: 1000; + Max length: 12; """ - closing_notes: str | None = Field(default=None, alias="closingNotes") + warranty_notes: Annotated[str | None, Field(alias="warrantyNotes")] = None """ Max length: 1000; """ - date_closed: str | None = Field(default=None, alias="dateClosed") - account_manager: MemberReference | None = Field( - default=None, alias="accountManager" - ) - technical_contact: MemberReference | None = Field( - default=None, alias="technicalContact" - ) - currency: CurrencyReference | None = None - closed_by: MemberReference | None = Field(default=None, alias="closedBy") - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + warranty_site: Annotated[SiteReference | None, Field(alias="warrantySite")] = None -class SalesQuota(ConnectWiseModel): +class SLAPriority(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - member: MemberReference | None = None - forecast_year: int | None = Field(default=None, alias="forecastYear") - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None + plan_within: Annotated[float | None, Field(alias="planWithin")] = None + plan_within_percent: Annotated[int | None, Field(alias="planWithinPercent")] = None + priority: PriorityReference | None = None + resolution_hours: Annotated[float | None, Field(alias="resolutionHours")] = None + resolution_percent: Annotated[int | None, Field(alias="resolutionPercent")] = None + respond_hours: Annotated[float | None, Field(alias="respondHours")] = None + respond_percent: Annotated[int | None, Field(alias="respondPercent")] = None + sla: SLAReference | None = None + + +class SalesQuota(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + april_margin: Annotated[float | None, Field(alias="aprilMargin")] = None + april_revenue: Annotated[float | None, Field(alias="aprilRevenue")] = None + august_margin: Annotated[float | None, Field(alias="augustMargin")] = None + august_revenue: Annotated[float | None, Field(alias="augustRevenue")] = None category: ProductCategoryReference | None = None - sub_category: ProductSubCategoryReference | None = Field( - default=None, alias="subCategory" - ) - january_revenue: float | None = Field(default=None, alias="januaryRevenue") - january_margin: float | None = Field(default=None, alias="januaryMargin") - february_revenue: float | None = Field(default=None, alias="februaryRevenue") - february_margin: float | None = Field(default=None, alias="februaryMargin") - march_revenue: float | None = Field(default=None, alias="marchRevenue") - march_margin: float | None = Field(default=None, alias="marchMargin") - april_revenue: float | None = Field(default=None, alias="aprilRevenue") - april_margin: float | None = Field(default=None, alias="aprilMargin") - may_revenue: float | None = Field(default=None, alias="mayRevenue") - may_margin: float | None = Field(default=None, alias="mayMargin") - june_revenue: float | None = Field(default=None, alias="juneRevenue") - june_margin: float | None = Field(default=None, alias="juneMargin") - july_revenue: float | None = Field(default=None, alias="julyRevenue") - july_margin: float | None = Field(default=None, alias="julyMargin") - august_revenue: float | None = Field(default=None, alias="augustRevenue") - august_margin: float | None = Field(default=None, alias="augustMargin") - september_revenue: float | None = Field(default=None, alias="septemberRevenue") - september_margin: float | None = Field(default=None, alias="septemberMargin") - october_revenue: float | None = Field(default=None, alias="octoberRevenue") - october_margin: float | None = Field(default=None, alias="octoberMargin") - november_revenue: float | None = Field(default=None, alias="novemberRevenue") - november_margin: float | None = Field(default=None, alias="novemberMargin") - december_revenue: float | None = Field(default=None, alias="decemberRevenue") - december_margin: float | None = Field(default=None, alias="decemberMargin") currency: CurrencyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + december_margin: Annotated[float | None, Field(alias="decemberMargin")] = None + december_revenue: Annotated[float | None, Field(alias="decemberRevenue")] = None + department: SystemDepartmentReference | None = None + february_margin: Annotated[float | None, Field(alias="februaryMargin")] = None + february_revenue: Annotated[float | None, Field(alias="februaryRevenue")] = None + forecast_year: Annotated[int | None, Field(alias="forecastYear")] = None + id: int | None = None + january_margin: Annotated[float | None, Field(alias="januaryMargin")] = None + january_revenue: Annotated[float | None, Field(alias="januaryRevenue")] = None + july_margin: Annotated[float | None, Field(alias="julyMargin")] = None + july_revenue: Annotated[float | None, Field(alias="julyRevenue")] = None + june_margin: Annotated[float | None, Field(alias="juneMargin")] = None + june_revenue: Annotated[float | None, Field(alias="juneRevenue")] = None + location: SystemLocationReference | None = None + march_margin: Annotated[float | None, Field(alias="marchMargin")] = None + march_revenue: Annotated[float | None, Field(alias="marchRevenue")] = None + may_margin: Annotated[float | None, Field(alias="mayMargin")] = None + may_revenue: Annotated[float | None, Field(alias="mayRevenue")] = None + member: MemberReference | None = None + november_margin: Annotated[float | None, Field(alias="novemberMargin")] = None + november_revenue: Annotated[float | None, Field(alias="novemberRevenue")] = None + october_margin: Annotated[float | None, Field(alias="octoberMargin")] = None + october_revenue: Annotated[float | None, Field(alias="octoberRevenue")] = None + september_margin: Annotated[float | None, Field(alias="septemberMargin")] = None + september_revenue: Annotated[float | None, Field(alias="septemberRevenue")] = None + sub_category: Annotated[ProductSubCategoryReference | None, Field(alias="subCategory")] = None class SalesTeam(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - sales_team_identifier: str = Field(..., alias="salesTeamIdentifier") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + sales_team_description: Annotated[str, Field(alias="salesTeamDescription")] """ - Max length: 20; + Max length: 50; """ - sales_team_description: str = Field(..., alias="salesTeamDescription") + sales_team_identifier: Annotated[str, Field(alias="salesTeamIdentifier")] """ - Max length: 50; + Max length: 20; """ - sales_team_location: SystemLocationReference | None = Field( - default=None, alias="salesTeamLocation" - ) - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + sales_team_location: Annotated[SystemLocationReference | None, Field(alias="salesTeamLocation")] = None class SalesTeamMember(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + allow_access_flag: Annotated[bool | None, Field(alias="allowAccessFlag")] = None + department: SystemDepartmentReference | None = None id: int | None = None - member: MemberReference | None = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - allow_access_flag: bool | None = Field(default=None, alias="allowAccessFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + member: MemberReference | None = None class ScheduleDetail(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + date_end: Annotated[datetime | None, Field(alias="dateEnd")] = None + date_start: Annotated[datetime | None, Field(alias="dateStart")] = None id: int | None = None - schedule_entry: ScheduleEntryReference | None = Field( - default=None, alias="scheduleEntry" - ) - date_start: str | None = Field(default=None, alias="dateStart") - date_end: str | None = Field(default=None, alias="dateEnd") member: MemberReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + schedule_entry: Annotated[ScheduleEntryReference | None, Field(alias="scheduleEntry")] = None class ScheduleEntry(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + acknowledged_date: Annotated[datetime | None, Field(alias="acknowledgedDate")] = None + acknowledged_flag: Annotated[bool | None, Field(alias="acknowledgedFlag")] = None + add_member_to_project_flag: Annotated[bool | None, Field(alias="addMemberToProjectFlag")] = None + allow_schedule_conflicts_flag: Annotated[bool | None, Field(alias="allowScheduleConflictsFlag")] = None + close_date: Annotated[datetime | None, Field(alias="closeDate")] = None + date_end: Annotated[datetime | None, Field(alias="dateEnd")] = None + date_start: Annotated[datetime | None, Field(alias="dateStart")] = None + done_flag: Annotated[bool | None, Field(alias="doneFlag")] = None + hours: float | None = None id: int | None = None - object_id: int | None = Field(default=None, alias="objectId") + meeting_flag: Annotated[bool | None, Field(alias="meetingFlag")] = None + member: MemberReference | None = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None name: str | None = None """ Max length: 250; """ - member: MemberReference | None = None - where: ServiceLocationReference | None = None - date_start: datetime | None = Field(default=None, alias="dateStart") - date_end: datetime | None = Field(default=None, alias="dateEnd") + object_id: Annotated[int | None, Field(alias="objectId")] = None + owner_flag: Annotated[bool | None, Field(alias="ownerFlag")] = None + project_role_id: Annotated[int | None, Field(alias="projectRoleId")] = None reminder: ReminderReference | None = None + span: ScheduleSpanReference | None = None status: ScheduleStatusReference | None = None type: ScheduleTypeReference | None = None - span: ScheduleSpanReference | None = None - done_flag: bool | None = Field(default=None, alias="doneFlag") - acknowledged_flag: bool | None = Field(default=None, alias="acknowledgedFlag") - owner_flag: bool | None = Field(default=None, alias="ownerFlag") - meeting_flag: bool | None = Field(default=None, alias="meetingFlag") - allow_schedule_conflicts_flag: bool | None = Field( - default=None, alias="allowScheduleConflictsFlag" - ) - add_member_to_project_flag: bool | None = Field( - default=None, alias="addMemberToProjectFlag" - ) - project_role_id: int | None = Field(default=None, alias="projectRoleId") - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - acknowledged_date: datetime | None = Field(default=None, alias="acknowledgedDate") - close_date: datetime | None = Field(default=None, alias="closeDate") - hours: float | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + where: ServiceLocationReference | None = None class ScheduleEntryDetail(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + date_end: Annotated[datetime | None, Field(alias="dateEnd")] = None + date_start: Annotated[datetime | None, Field(alias="dateStart")] = None + hours_scheduled: Annotated[float | None, Field(alias="hoursScheduled")] = None id: int | None = None - schedule_entry: ScheduleEntryReference | None = Field( - default=None, alias="scheduleEntry" - ) - date_start: str | None = Field(default=None, alias="dateStart") - date_end: str | None = Field(default=None, alias="dateEnd") - hours_scheduled: float | None = Field(default=None, alias="hoursScheduled") - info: dict[str, str] | None = Field(default=None, alias="_info") + schedule_entry: Annotated[ScheduleEntryReference | None, Field(alias="scheduleEntry")] = None class ScheduleStopwatch(ConnectWiseModel): - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None agreement: AgreementReference | None = None - billable_option: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billableOption") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - date_entered: datetime | None = Field(default=None, alias="dateEntered") - end_time: datetime | None = Field(default=None, alias="endTime") - id: int | None = None - internal_notes: str | None = Field(default=None, alias="internalNotes") - location_id: int | None = Field(default=None, alias="locationId") + billable_option: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billableOption") + ] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None + end_time: Annotated[datetime | None, Field(alias="endTime")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None member: MemberReference | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None notes: str | None = None """ Max length: 4000; """ - schedule_id: int = Field(..., alias="scheduleId") - schedule_mobile_guid: UUID | None = Field(default=None, alias="scheduleMobileGuid") - start_time: datetime | None = Field(default=None, alias="startTime") + schedule_id: Annotated[int, Field(alias="scheduleId")] + schedule_mobile_guid: Annotated[UUID | None, Field(alias="scheduleMobileGuid")] = None + start_time: Annotated[datetime | None, Field(alias="startTime")] = None status: Literal["Reset", "Running", "Paused", "Stopped"] - total_pause_time: int | None = Field(default=None, alias="totalPauseTime") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") + total_pause_time: Annotated[int | None, Field(alias="totalPauseTime")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class ScheduleType(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + charge_code: Annotated[ChargeCodeReference | None, Field(alias="chargeCode")] = None id: int | None = None - name: str - """ - Max length: 50; - """ identifier: str """ Max length: 1; """ - charge_code: ChargeCodeReference | None = Field(default=None, alias="chargeCode") + name: str + """ + Max length: 50; + """ + system_flag: Annotated[bool | None, Field(alias="systemFlag")] = None where: ServiceLocationReference | None = None - system_flag: bool | None = Field(default=None, alias="systemFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ScheduleTypeInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + charge_code: Annotated[ChargeCodeReference | None, Field(alias="chargeCode")] = None id: int | None = None - name: str | None = None identifier: str | None = None - charge_code: ChargeCodeReference | None = Field(default=None, alias="chargeCode") + name: str | None = None + system_flag: Annotated[bool | None, Field(alias="systemFlag")] = None where: ServiceLocationReference | None = None - system_flag: bool | None = Field(default=None, alias="systemFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class ServiceEmailTemplate(ConnectWiseModel): - id: int | None = None - type: Literal[ - "Any", - "Closed", - "Invoice", - "New", - "SalesOrder", - "PurchaseOrder", - "RMA", - "Specific", - ] - service_survey: ServiceSurveyReference | None = Field( - default=None, alias="serviceSurvey" - ) - service_board: BoardReference | None = Field(default=None, alias="serviceBoard") - use_sender_flag: bool | None = Field(default=None, alias="useSenderFlag") - first_name: str | None = Field(default=None, alias="firstName") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + body: str | None = None + copy_sender_flag: Annotated[bool | None, Field(alias="copySenderFlag")] = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None """ From fields (first name, last name, email address) are required if useSenderFlag is false. Max length: 100; """ - last_name: str | None = Field(default=None, alias="lastName") + external_contact_notifications: Annotated[bool | None, Field(alias="externalContactNotifications")] = None + first_name: Annotated[str | None, Field(alias="firstName")] = None """ From fields (first name, last name, email address) are required if useSenderFlag is false. Max length: 100; """ - email_address: str | None = Field(default=None, alias="emailAddress") + id: int | None = None + internal_contact_notifications: Annotated[bool | None, Field(alias="internalContactNotifications")] = None + last_name: Annotated[str | None, Field(alias="lastName")] = None """ From fields (first name, last name, email address) are required if useSenderFlag is false. Max length: 100; """ + resource_records_flag: Annotated[bool | None, Field(alias="resourceRecordsFlag")] = None + service_board: Annotated[BoardReference | None, Field(alias="serviceBoard")] = None + service_status: Annotated[ServiceStatusReference | None, Field(alias="serviceStatus")] = None + service_survey: Annotated[ServiceSurveyReference | None, Field(alias="serviceSurvey")] = None subject: str | None = None """ Max length: 200; """ - body: str | None = None - copy_sender_flag: bool | None = Field(default=None, alias="copySenderFlag") - tasks_flag: bool | None = Field(default=None, alias="tasksFlag") - resource_records_flag: bool | None = Field( - default=None, alias="resourceRecordsFlag" - ) - external_contact_notifications: bool | None = Field( - default=None, alias="externalContactNotifications" - ) - internal_contact_notifications: bool | None = Field( - default=None, alias="internalContactNotifications" - ) - service_status: ServiceStatusReference | None = Field( - default=None, alias="serviceStatus" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class ServiceSignoffCustomField(ConnectWiseModel): - id: int | None = None - sequence_number: float = Field(..., alias="sequenceNumber") - display_section: Literal[ - "CustomerInformation", - "Detail", - "Expenses", - "Configurations", - "AdditionalSignOffFields", - "InternalNotes", - "Time", - "Products", - "Resolution", - "Summary", - "Tasks", - ] = Field(..., alias="displaySection") - user_defined_field: UserDefinedFieldReference | None = Field( - default=None, alias="userDefinedField" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + tasks_flag: Annotated[bool | None, Field(alias="tasksFlag")] = None + type: Literal["Any", "Closed", "Invoice", "New", "SalesOrder", "PurchaseOrder", "RMA", "Specific"] + use_sender_flag: Annotated[bool | None, Field(alias="useSenderFlag")] = None class ServiceSurveyQuestion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None id: int | None = None - sequence_number: int | None = Field(default=None, alias="sequenceNumber") - type: Literal["OpenEnded", "Selection"] + include_flag: Annotated[bool | None, Field(alias="includeFlag")] = None + no_answer_points: Annotated[int | None, Field(alias="noAnswerPoints")] = None + options: list[ServiceSurveyQuestionOption] | None = None question: str """ Max length: 1000; """ - options: list[ServiceSurveyQuestionOption] | None = None - include_flag: bool | None = Field(default=None, alias="includeFlag") - required_flag: bool | None = Field(default=None, alias="requiredFlag") - no_answer_points: int | None = Field(default=None, alias="noAnswerPoints") - survey_id: int | None = Field(default=None, alias="surveyId") - info: dict[str, str] | None = Field(default=None, alias="_info") + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None + survey_id: Annotated[int | None, Field(alias="surveyId")] = None + type: Literal["OpenEnded", "Selection"] class ServiceTeam(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + delete_notify_flag: Annotated[bool | None, Field(alias="deleteNotifyFlag")] = None + department: SystemDepartmentReference | None = None id: int | None = None - name: str | None = None leader: MemberReference | None = None location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - delete_notify_flag: bool | None = Field(default=None, alias="deleteNotifyFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str | None = None class ServiceTemplate(ConnectWiseModel): - id: int | None = None - name: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement: AgreementReference | None = None + assigned_by: Annotated[MemberReference | None, Field(alias="assignedBy")] = None + assigned_notify_flag: Annotated[bool | None, Field(alias="assignedNotifyFlag")] = None + attach_schedule_to_new_service_flag: Annotated[bool | None, Field(alias="attachScheduleToNewServiceFlag")] = None + bill_complete_flag: Annotated[bool | None, Field(alias="billComplete_Flag")] = None + bill_service_separately_flag: Annotated[bool | None, Field(alias="billServiceSeparatelyFlag")] = None + bill_unapproved_time_and_expenses_flag: Annotated[ + bool | None, Field(alias="billUnapprovedTimeAndExpensesFlag") + ] = None + billing_amount: Annotated[float | None, Field(alias="billingAmount")] = None + billing_method: Annotated[ + Literal["ActualRates", "FixedFee", "NotToExceed", "OverrideRate"] | None, Field(alias="billingMethod") + ] = None board: BoardReference | None = None - type: ServiceTypeReference | None = None - item: ServiceItemReference | None = None - subtype: ServiceSubTypeReference | None = None - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - status: ServiceStatusReference | None = None - source: ServiceSourceReference | None = None - priority: PriorityReference | None = None - team: ServiceTeamReference | None = None company: CompanyReference | None = None contact: ContactReference | None = None - site: SiteReference | None = None - assigned_notify_flag: bool | None = Field(default=None, alias="assignedNotifyFlag") - location: SystemLocationReference | None = None department: SystemDepartmentReference | None = None - summary: str | None = None + email_cc: Annotated[str | None, Field(alias="emailCC")] = None + email_cc_flag: Annotated[bool | None, Field(alias="emailCCFlag")] = None + email_contact_flag: Annotated[bool | None, Field(alias="emailContactFlag")] = None + email_resource_flag: Annotated[bool | None, Field(alias="emailResourceFlag")] = None + expense_billable_flag: Annotated[bool | None, Field(alias="expenseBillableFlag")] = None + expense_invoice_flag: Annotated[bool | None, Field(alias="expenseInvoiceFlag")] = None + hours_budget: Annotated[float | None, Field(alias="hoursBudget")] = None + id: int | None = None + impact: Literal["Low", "Medium", "High"] | None = None + internal_analysis: Annotated[str | None, Field(alias="internalAnalysis")] = None + item: ServiceItemReference | None = None + location: SystemLocationReference | None = None + name: str | None = None + override_flag: Annotated[bool | None, Field(alias="overrideFlag")] = None + priority: PriorityReference | None = None problem: str | None = None - hours_budget: float | None = Field(default=None, alias="hoursBudget") - internal_analysis: str | None = Field(default=None, alias="internalAnalysis") - time_billable_flag: bool | None = Field(default=None, alias="timeBillableFlag") - expense_billable_flag: bool | None = Field( - default=None, alias="expenseBillableFlag" - ) - purchase_order_number: str | None = Field(default=None, alias="purchaseOrderNumber") + product_invoice_flag: Annotated[bool | None, Field(alias="productInvoiceFlag")] = None + purchase_order_number: Annotated[str | None, Field(alias="purchaseOrderNumber")] = None reference: str | None = None - bill_complete_flag: bool | None = Field(default=None, alias="billComplete_Flag") - bill_service_separately_flag: bool | None = Field( - default=None, alias="billServiceSeparatelyFlag" - ) - billing_amount: float | None = Field(default=None, alias="billingAmount") - bill_unapproved_time_and_expenses_flag: bool | None = Field( - default=None, alias="billUnapprovedTimeAndExpensesFlag" - ) - override_flag: bool | None = Field(default=None, alias="overrideFlag") - time_invoice_flag: bool | None = Field(default=None, alias="timeInvoiceFlag") - expense_invoice_flag: bool | None = Field(default=None, alias="expenseInvoiceFlag") - product_invoice_flag: bool | None = Field(default=None, alias="productInvoiceFlag") - agreement: AgreementReference | None = None - billing_method: Literal[ - "ActualRates", "FixedFee", "NotToExceed", "OverrideRate" - ] | None = Field(default=None, alias="billingMethod") + restrict_downpayment_flag: Annotated[bool | None, Field(alias="restrictDownpaymentFlag")] = None + schedule_days_before: Annotated[int | None, Field(alias="scheduleDaysBefore")] = None + service_days_before: Annotated[int | None, Field(alias="serviceDaysBefore")] = None + service_location: Annotated[ServiceLocationReference | None, Field(alias="serviceLocation")] = None severity: Literal["Low", "Medium", "High"] | None = None - impact: Literal["Low", "Medium", "High"] | None = None - assigned_by: MemberReference | None = Field(default=None, alias="assignedBy") - schedule_days_before: int | None = Field(default=None, alias="scheduleDaysBefore") - service_days_before: int | None = Field(default=None, alias="serviceDaysBefore") - attach_schedule_to_new_service_flag: bool | None = Field( - default=None, alias="attachScheduleToNewServiceFlag" - ) - template_flag: bool | None = Field(default=None, alias="templateFlag") - email_contact_flag: bool | None = Field(default=None, alias="emailContactFlag") - email_resource_flag: bool | None = Field(default=None, alias="emailResourceFlag") - email_cc_flag: bool | None = Field(default=None, alias="emailCCFlag") - email_cc: str | None = Field(default=None, alias="emailCC") - restrict_downpayment_flag: bool | None = Field( - default=None, alias="restrictDownpaymentFlag" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + site: SiteReference | None = None + source: ServiceSourceReference | None = None + status: ServiceStatusReference | None = None + subtype: ServiceSubTypeReference | None = None + summary: str | None = None + team: ServiceTeamReference | None = None + template_flag: Annotated[bool | None, Field(alias="templateFlag")] = None + time_billable_flag: Annotated[bool | None, Field(alias="timeBillableFlag")] = None + time_invoice_flag: Annotated[bool | None, Field(alias="timeInvoiceFlag")] = None + type: ServiceTypeReference | None = None class ServiceTicketNote(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + bundled_flag: Annotated[bool | None, Field(alias="bundledFlag")] = None + contact: ContactReference | None = None + detail_description_flag: Annotated[bool | None, Field(alias="detailDescriptionFlag")] = None id: int | None = None - note_type: Literal["TicketNote", "TimeEntryNote", "MeetingNote"] | None = Field( - default=None, alias="noteType" - ) - ticket: TicketReference | None = None - text: str | None = None - is_markdown_flag: bool | None = Field(default=None, alias="isMarkdownFlag") - detail_description_flag: bool | None = Field( - default=None, alias="detailDescriptionFlag" - ) - internal_analysis_flag: bool | None = Field( - default=None, alias="internalAnalysisFlag" - ) - resolution_flag: bool | None = Field(default=None, alias="resolutionFlag") - time_start: str | None = Field(default=None, alias="timeStart") - time_end: str | None = Field(default=None, alias="timeEnd") - bundled_flag: bool | None = Field(default=None, alias="bundledFlag") - merged_flag: bool | None = Field(default=None, alias="mergedFlag") - issue_flag: bool | None = Field(default=None, alias="issueFlag") - original_author: str | None = Field(default=None, alias="originalAuthor") + internal_analysis_flag: Annotated[bool | None, Field(alias="internalAnalysisFlag")] = None + is_markdown_flag: Annotated[bool | None, Field(alias="isMarkdownFlag")] = None + issue_flag: Annotated[bool | None, Field(alias="issueFlag")] = None member: MemberReference | None = None - contact: ContactReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + merged_flag: Annotated[bool | None, Field(alias="mergedFlag")] = None + note_type: Annotated[Literal["TicketNote", "TimeEntryNote", "MeetingNote"] | None, Field(alias="noteType")] = None + original_author: Annotated[str | None, Field(alias="originalAuthor")] = None + resolution_flag: Annotated[bool | None, Field(alias="resolutionFlag")] = None + text: str | None = None + ticket: TicketReference | None = None + time_end: Annotated[datetime | None, Field(alias="timeEnd")] = None + time_start: Annotated[datetime | None, Field(alias="timeStart")] = None class Skill(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + category: SkillCategoryReference | None = None id: int | None = None name: str """ Max length: 50; """ - category: SkillCategoryReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class SLAPriority(ConnectWiseModel): - id: int | None = None - priority: PriorityReference | None = None - respond_hours: float | None = Field(default=None, alias="respondHours") - respond_percent: int | None = Field(default=None, alias="respondPercent") - plan_within: float | None = Field(default=None, alias="planWithin") - plan_within_percent: int | None = Field(default=None, alias="planWithinPercent") - resolution_hours: float | None = Field(default=None, alias="resolutionHours") - resolution_percent: int | None = Field(default=None, alias="resolutionPercent") - sla: SLAReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class StandardNote(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None + contents: str + department: SystemDepartmentReference | None = None id: int | None = None + location: SystemLocationReference | None = None name: str """ Max length: 50; """ - contents: str - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - board: BoardReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class StandardNoteInfo(ConnectWiseModel): - id: int | None = None - name: str | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + board: BoardReference | None = None contents: str | None = None - location: SystemLocationReference | None = None department: SystemDepartmentReference | None = None - board: BoardReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + location: SystemLocationReference | None = None + name: str | None = None class SurveyQuestion(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + entry_type: Annotated[Literal["Date", "EntryField", "List", "Option"], Field(alias="entryType")] + field_type: Annotated[ + Literal[ + "TextArea", + "Button", + "Currency", + "Date", + "Hyperlink", + "IPAddress", + "Checkbox", + "Number", + "Percent", + "Text", + "Password", + ], + Field(alias="fieldType"), + ] id: int | None = None - survey: SurveyReference | None = None - field_type: Literal[ - "TextArea", - "Button", - "Currency", - "Date", - "Hyperlink", - "IPAddress", - "Checkbox", - "Number", - "Percent", - "Text", - "Password", - ] = Field(..., alias="fieldType") - entry_type: Literal["Date", "EntryField", "List", "Option"] = Field( - ..., alias="entryType" - ) - sequence_number: float = Field(..., alias="sequenceNumber") + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + number_of_decimals: Annotated[int | None, Field(alias="numberOfDecimals")] = None question: str """ Max length: 1000; """ - number_of_decimals: int | None = Field(default=None, alias="numberOfDecimals") - required_flag: bool | None = Field(default=None, alias="requiredFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + sequence_number: Annotated[float, Field(alias="sequenceNumber")] + survey: SurveyReference | None = None class SurveyQuestionValue(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None - survey: SurveyReference | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + point_value: Annotated[int | None, Field(alias="pointValue")] = None question: SurveyQuestionReference | None = None + survey: SurveyReference | None = None value: str """ Max length: 1000; """ - default_flag: bool | None = Field(default=None, alias="defaultFlag") - point_value: int | None = Field(default=None, alias="pointValue") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") class SurveyResult(ConnectWiseModel): - id: int | None = None - ticket_id: int = Field(..., alias="ticketId") - email_address: str | None = Field(default=None, alias="emailAddress") - footer_response: str | None = Field(default=None, alias="footerResponse") - contact_me_flag: bool | None = Field(default=None, alias="contactMeFlag") - contact: ContactReference | None = None - results: list[SurveyResultDetail] | None = None - total_points: int | None = Field(default=None, alias="totalPoints") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None company: CompanyReference | None = None - survey_id: int | None = Field(default=None, alias="surveyId") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class TaxableExpenseTypeLevel(ConnectWiseModel): + contact: ContactReference | None = None + contact_me_flag: Annotated[bool | None, Field(alias="contactMeFlag")] = None + email_address: Annotated[str | None, Field(alias="emailAddress")] = None + footer_response: Annotated[str | None, Field(alias="footerResponse")] = None id: int | None = None - tax_code_level: TaxCodeLevelReference | None = Field( - default=None, alias="taxCodeLevel" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class TaxableProductTypeLevel(TaxableExpenseTypeLevel): - pass - - -class TaxableWorkRoleLevel(TaxableExpenseTypeLevel): - pass - - -class TaxableXRefLevel(TaxableExpenseTypeLevel): - pass + results: list[SurveyResultDetail] | None = None + survey_id: Annotated[int | None, Field(alias="surveyId")] = None + ticket_id: Annotated[int, Field(alias="ticketId")] + total_points: Annotated[int | None, Field(alias="totalPoints")] = None class Ticket(ConnectWiseModel): - id: int | None = None - summary: str - """ - Max length: 100; - """ - record_type: Literal[ - "ProjectIssue", "ProjectTicket", "ServiceTicket" - ] | None = Field(default=None, alias="recordType") - board: BoardReference | None = None - status: ServiceStatusReference | None = None - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - company: CompanyReference | None = None - site: SiteReference | None = None - site_name: str | None = Field(default=None, alias="siteName") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + actual_hours: Annotated[float | None, Field(alias="actualHours")] = None + address_line1: Annotated[str | None, Field(alias="addressLine1")] = None """ Max length: 50; """ - address_line1: str | None = Field(default=None, alias="addressLine1") + address_line2: Annotated[str | None, Field(alias="addressLine2")] = None """ Max length: 50; """ - address_line2: str | None = Field(default=None, alias="addressLine2") + agreement: AgreementReference | None = None + allow_all_clients_portal_view: Annotated[bool | None, Field(alias="allowAllClientsPortalView")] = None + approved: bool | None = None + automatic_email_cc: Annotated[str | None, Field(alias="automaticEmailCc")] = None """ - Max length: 50; + Max length: 1000; """ + automatic_email_cc_flag: Annotated[bool | None, Field(alias="automaticEmailCcFlag")] = None + automatic_email_contact_flag: Annotated[bool | None, Field(alias="automaticEmailContactFlag")] = None + automatic_email_resource_flag: Annotated[bool | None, Field(alias="automaticEmailResourceFlag")] = None + bill_expenses: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billExpenses") + ] = None + bill_products: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billProducts") + ] = None + bill_time: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billTime") + ] = None + billing_amount: Annotated[float | None, Field(alias="billingAmount")] = None + billing_method: Annotated[ + Literal["ActualRates", "FixedFee", "NotToExceed", "OverrideRate"] | None, Field(alias="billingMethod") + ] = None + board: BoardReference | None = None + budget_hours: Annotated[float | None, Field(alias="budgetHours")] = None city: str | None = None """ Max length: 50; """ - state_identifier: str | None = Field(default=None, alias="stateIdentifier") - """ - Max length: 50; - """ - zip: str | None = None - """ - Max length: 12; - """ - country: CountryReference | None = None + closed_by: Annotated[str | None, Field(alias="closedBy")] = None + closed_date: Annotated[datetime | None, Field(alias="closedDate")] = None + closed_flag: Annotated[bool | None, Field(alias="closedFlag")] = None + company: CompanyReference | None = None contact: ContactReference | None = None - contact_name: str | None = Field(default=None, alias="contactName") + contact_email_address: Annotated[str | None, Field(alias="contactEmailAddress")] = None """ - Max length: 62; + Max length: 250; """ - contact_phone_number: str | None = Field(default=None, alias="contactPhoneNumber") + contact_email_lookup: Annotated[str | None, Field(alias="contactEmailLookup")] = None + contact_name: Annotated[str | None, Field(alias="contactName")] = None """ - Max length: 20; + Max length: 62; """ - contact_phone_extension: str | None = Field( - default=None, alias="contactPhoneExtension" - ) + contact_phone_extension: Annotated[str | None, Field(alias="contactPhoneExtension")] = None """ Max length: 15; """ - contact_email_address: str | None = Field(default=None, alias="contactEmailAddress") + contact_phone_number: Annotated[str | None, Field(alias="contactPhoneNumber")] = None """ - Max length: 250; + Max length: 20; """ - type: ServiceTypeReference | None = None - sub_type: ServiceSubTypeReference | None = Field(default=None, alias="subType") - item: ServiceItemReference | None = None - team: ServiceTeamReference | None = None - owner: MemberReference | None = None - priority: PriorityReference | None = None - service_location: ServiceLocationReference | None = Field( - default=None, alias="serviceLocation" - ) - source: ServiceSourceReference | None = None - required_date: datetime | None = Field(default=None, alias="requiredDate") - budget_hours: float | None = Field(default=None, alias="budgetHours") - opportunity: OpportunityReference | None = None - agreement: AgreementReference | None = None - severity: Literal["Low", "Medium", "High"] | None = None + country: CountryReference | None = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + customer_updated_flag: Annotated[bool | None, Field(alias="customerUpdatedFlag")] = None + date_resolved: Annotated[str | None, Field(alias="dateResolved")] = None + date_resplan: Annotated[str | None, Field(alias="dateResplan")] = None + date_responded: Annotated[str | None, Field(alias="dateResponded")] = None + department: SystemDepartmentReference | None = None + duration: int | None = None + escalation_level: Annotated[int | None, Field(alias="escalationLevel")] = None + escalation_start_date_utc: Annotated[datetime | None, Field(alias="escalationStartDateUTC")] = None + estimated_expense_cost: Annotated[float | None, Field(alias="estimatedExpenseCost")] = None + estimated_expense_revenue: Annotated[float | None, Field(alias="estimatedExpenseRevenue")] = None + estimated_product_cost: Annotated[float | None, Field(alias="estimatedProductCost")] = None + estimated_product_revenue: Annotated[float | None, Field(alias="estimatedProductRevenue")] = None + estimated_start_date: Annotated[datetime | None, Field(alias="estimatedStartDate")] = None + estimated_time_cost: Annotated[float | None, Field(alias="estimatedTimeCost")] = None + estimated_time_revenue: Annotated[float | None, Field(alias="estimatedTimeRevenue")] = None + external_x_ref: Annotated[str | None, Field(alias="externalXRef")] = None """ - Required On Updates; + Max length: 100; """ + has_child_ticket: Annotated[bool | None, Field(alias="hasChildTicket")] = None + has_merged_child_ticket_flag: Annotated[bool | None, Field(alias="hasMergedChildTicketFlag")] = None + hourly_rate: Annotated[float | None, Field(alias="hourlyRate")] = None + id: int | None = None impact: Literal["Low", "Medium", "High"] | None = None """ Required On Updates; """ - external_x_ref: str | None = Field(default=None, alias="externalXRef") + initial_description: Annotated[str | None, Field(alias="initialDescription")] = None """ - Max length: 100; + Only available for POST, will not be returned in the response """ - po_number: str | None = Field(default=None, alias="poNumber") - """ - Max length: 50; - """ - knowledge_base_category_id: int | None = Field( - default=None, alias="knowledgeBaseCategoryId" - ) - knowledge_base_sub_category_id: int | None = Field( - default=None, alias="knowledgeBaseSubCategoryId" - ) - allow_all_clients_portal_view: bool | None = Field( - default=None, alias="allowAllClientsPortalView" - ) - customer_updated_flag: bool | None = Field( - default=None, alias="customerUpdatedFlag" - ) - automatic_email_contact_flag: bool | None = Field( - default=None, alias="automaticEmailContactFlag" - ) - automatic_email_resource_flag: bool | None = Field( - default=None, alias="automaticEmailResourceFlag" - ) - automatic_email_cc_flag: bool | None = Field( - default=None, alias="automaticEmailCcFlag" - ) - automatic_email_cc: str | None = Field(default=None, alias="automaticEmailCc") + initial_description_from: Annotated[str | None, Field(alias="initialDescriptionFrom")] = None + initial_internal_analysis: Annotated[str | None, Field(alias="initialInternalAnalysis")] = None """ - Max length: 1000; + Only available for POST, will not be returned in the response + """ + initial_resolution: Annotated[str | None, Field(alias="initialResolution")] = None """ - initial_description: str | None = Field(default=None, alias="initialDescription") + Only available for POST, will not be returned in the response """ - Only available for POST, will not be returned in the response. + integrator_tags: Annotated[list[str] | None, Field(alias="integratorTags")] = None + is_in_sla: Annotated[bool | None, Field(alias="isInSla")] = None + item: ServiceItemReference | None = None + knowledge_base_category_id: Annotated[int | None, Field(alias="knowledgeBaseCategoryId")] = None + knowledge_base_link_id: Annotated[int | None, Field(alias="knowledgeBaseLinkId")] = None + knowledge_base_link_type: Annotated[ + Literal["Activity", "ProjectIssue", "KnowledgeBaseArticle", "ProjectTicket", "ServiceTicket", "Time"] | None, + Field(alias="knowledgeBaseLinkType"), + ] = None + knowledge_base_sub_category_id: Annotated[int | None, Field(alias="knowledgeBaseSubCategoryId")] = None + lag_days: Annotated[int | None, Field(alias="lagDays")] = None + lag_nonworking_days_flag: Annotated[bool | None, Field(alias="lagNonworkingDaysFlag")] = None + location: SystemLocationReference | None = None + merged_parent_ticket: Annotated[TicketReference | None, Field(alias="mergedParentTicket")] = None + minutes_before_waiting: Annotated[int | None, Field(alias="minutesBeforeWaiting")] = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + opportunity: OpportunityReference | None = None + owner: MemberReference | None = None + parent_ticket_id: Annotated[int | None, Field(alias="parentTicketId")] = None + po_number: Annotated[str | None, Field(alias="poNumber")] = None """ - initial_internal_analysis: str | None = Field( - default=None, alias="initialInternalAnalysis" - ) + Max length: 50; + """ + predecessor_closed_flag: Annotated[bool | None, Field(alias="predecessorClosedFlag")] = None + predecessor_id: Annotated[int | None, Field(alias="predecessorId")] = None + predecessor_type: Annotated[Literal["Ticket", "Phase"] | None, Field(alias="predecessorType")] = None + priority: PriorityReference | None = None + process_notifications: Annotated[bool | None, Field(alias="processNotifications")] = None """ - Only available for POST, will not be returned in the response. + Can be set to false to skip notification processing when adding or updating a ticket (Defaults to True) """ - initial_resolution: str | None = Field(default=None, alias="initialResolution") + record_type: Annotated[ + Literal["ProjectIssue", "ProjectTicket", "ServiceTicket"] | None, Field(alias="recordType") + ] = None + request_for_change_flag: Annotated[bool | None, Field(alias="requestForChangeFlag")] = None + required_date: Annotated[datetime | None, Field(alias="requiredDate")] = None + res_plan_minutes: Annotated[int | None, Field(alias="resPlanMinutes")] = None + resolve_minutes: Annotated[int | None, Field(alias="resolveMinutes")] = None + resources: str | None = None + resplan_skipped_minutes: Annotated[int | None, Field(alias="resplanSkippedMinutes")] = None + respond_minutes: Annotated[int | None, Field(alias="respondMinutes")] = None + responded_skipped_minutes: Annotated[int | None, Field(alias="respondedSkippedMinutes")] = None + service_location: Annotated[ServiceLocationReference | None, Field(alias="serviceLocation")] = None + severity: Literal["Low", "Medium", "High"] | None = None """ - Only available for POST, will not be returned in the response. + Required On Updates; """ - initial_description_from: str | None = Field( - default=None, alias="initialDescriptionFrom" - ) - contact_email_lookup: str | None = Field(default=None, alias="contactEmailLookup") - process_notifications: bool | None = Field( - default=None, alias="processNotifications" - ) + site: SiteReference | None = None + site_name: Annotated[str | None, Field(alias="siteName")] = None """ - Can be set to false to skip notification processing when adding or updating a ticket (Defaults to True). + Max length: 50; """ - skip_callback: bool | None = Field(default=None, alias="skipCallback") - closed_date: str | None = Field(default=None, alias="closedDate") - closed_by: str | None = Field(default=None, alias="closedBy") - closed_flag: bool | None = Field(default=None, alias="closedFlag") - actual_hours: float | None = Field(default=None, alias="actualHours") - approved: bool | None = None - estimated_expense_cost: float | None = Field( - default=None, alias="estimatedExpenseCost" - ) - estimated_expense_revenue: float | None = Field( - default=None, alias="estimatedExpenseRevenue" - ) - estimated_product_cost: float | None = Field( - default=None, alias="estimatedProductCost" - ) - estimated_product_revenue: float | None = Field( - default=None, alias="estimatedProductRevenue" - ) - estimated_time_cost: float | None = Field(default=None, alias="estimatedTimeCost") - estimated_time_revenue: float | None = Field( - default=None, alias="estimatedTimeRevenue" - ) - billing_method: Literal[ - "ActualRates", "FixedFee", "NotToExceed", "OverrideRate" - ] | None = Field(default=None, alias="billingMethod") - billing_amount: float | None = Field(default=None, alias="billingAmount") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - sub_billing_method: Literal[ - "ActualRates", "FixedFee", "NotToExceed", "OverrideRate" - ] | None = Field(default=None, alias="subBillingMethod") - sub_billing_amount: float | None = Field(default=None, alias="subBillingAmount") - sub_date_accepted: str | None = Field(default=None, alias="subDateAccepted") - date_resolved: str | None = Field(default=None, alias="dateResolved") - date_resplan: str | None = Field(default=None, alias="dateResplan") - date_responded: str | None = Field(default=None, alias="dateResponded") - resolve_minutes: int | None = Field(default=None, alias="resolveMinutes") - res_plan_minutes: int | None = Field(default=None, alias="resPlanMinutes") - respond_minutes: int | None = Field(default=None, alias="respondMinutes") - is_in_sla: bool | None = Field(default=None, alias="isInSla") - knowledge_base_link_id: int | None = Field( - default=None, alias="knowledgeBaseLinkId" - ) - resources: str | None = None - parent_ticket_id: int | None = Field(default=None, alias="parentTicketId") - has_child_ticket: bool | None = Field(default=None, alias="hasChildTicket") - has_merged_child_ticket_flag: bool | None = Field( - default=None, alias="hasMergedChildTicketFlag" - ) - knowledge_base_link_type: Literal[ - "Activity", - "ProjectIssue", - "KnowledgeBaseArticle", - "ProjectTicket", - "ServiceTicket", - "Time", - ] | None = Field(default=None, alias="knowledgeBaseLinkType") - bill_time: Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None = Field( - default=None, alias="billTime" - ) - bill_expenses: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billExpenses") - bill_products: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billProducts") - predecessor_type: Literal["Ticket", "Phase"] | None = Field( - default=None, alias="predecessorType" - ) - predecessor_id: int | None = Field(default=None, alias="predecessorId") - predecessor_closed_flag: bool | None = Field( - default=None, alias="predecessorClosedFlag" - ) - lag_days: int | None = Field(default=None, alias="lagDays") - lag_nonworking_days_flag: bool | None = Field( - default=None, alias="lagNonworkingDaysFlag" - ) - estimated_start_date: datetime | None = Field( - default=None, alias="estimatedStartDate" - ) - duration: int | None = None - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") + skip_callback: Annotated[bool | None, Field(alias="skipCallback")] = None sla: SLAReference | None = None - sla_status: str | None = Field(default=None, alias="slaStatus") - request_for_change_flag: bool | None = Field( - default=None, alias="requestForChangeFlag" - ) - currency: CurrencyReference | None = None - merged_parent_ticket: TicketReference | None = Field( - default=None, alias="mergedParentTicket" - ) - integrator_tags: list[str] | None = Field(default=None, alias="integratorTags") - info: dict[str, str] | None = Field(default=None, alias="_info") - escalation_start_date_utc: str | None = Field( - default=None, alias="escalationStartDateUTC" - ) - escalation_level: int | None = Field(default=None, alias="escalationLevel") - minutes_before_waiting: int | None = Field( - default=None, alias="minutesBeforeWaiting" - ) - responded_skipped_minutes: int | None = Field( - default=None, alias="respondedSkippedMinutes" - ) - resplan_skipped_minutes: int | None = Field( - default=None, alias="resplanSkippedMinutes" - ) - responded_hours: float | None = Field(default=None, alias="respondedHours") - responded_by: str | None = Field(default=None, alias="respondedBy") - resplan_hours: float | None = Field(default=None, alias="resplanHours") - resplan_by: str | None = Field(default=None, alias="resplanBy") - resolution_hours: float | None = Field(default=None, alias="resolutionHours") - resolved_by: str | None = Field(default=None, alias="resolvedBy") - minutes_waiting: int | None = Field(default=None, alias="minutesWaiting") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + sla_status: Annotated[str | None, Field(alias="slaStatus")] = None + source: ServiceSourceReference | None = None + state_identifier: Annotated[str | None, Field(alias="stateIdentifier")] = None + """ + Max length: 50; + """ + status: ServiceStatusReference | None = None + sub_billing_amount: Annotated[float | None, Field(alias="subBillingAmount")] = None + sub_billing_method: Annotated[ + Literal["ActualRates", "FixedFee", "NotToExceed", "OverrideRate"] | None, Field(alias="subBillingMethod") + ] = None + sub_date_accepted: Annotated[str | None, Field(alias="subDateAccepted")] = None + sub_type: Annotated[ServiceSubTypeReference | None, Field(alias="subType")] = None + summary: str + """ + Max length: 100; + """ + team: ServiceTeamReference | None = None + type: ServiceTypeReference | None = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None + zip: str | None = None + """ + Max length: 12; + """ class TicketStopwatch(ConnectWiseModel): - info: dict[str, str] | None = Field(default=None, alias="_info") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None agreement: AgreementReference | None = None - billable_option: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billableOption") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - date_entered: datetime | None = Field(default=None, alias="dateEntered") - end_time: datetime | None = Field(default=None, alias="endTime") - id: int | None = None - internal_notes: str | None = Field(default=None, alias="internalNotes") - location_id: int | None = Field(default=None, alias="locationId") + billable_option: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billableOption") + ] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None + email_notes_to_contact_flag: Annotated[bool | None, Field(alias="emailNotesToContactFlag")] = None + email_notes_to_resources_flag: Annotated[bool | None, Field(alias="emailNotesToResourcesFlag")] = None + end_time: Annotated[datetime | None, Field(alias="endTime")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None member: MemberReference | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None notes: str | None = None """ Max length: 4000; """ - service_status: ServiceStatusReference | None = Field( - default=None, alias="serviceStatus" - ) - start_time: datetime | None = Field(default=None, alias="startTime") + service_status: Annotated[ServiceStatusReference | None, Field(alias="serviceStatus")] = None + show_notes_in_discussion_flag: Annotated[bool | None, Field(alias="showNotesInDiscussionFlag")] = None + show_notes_in_internal_flag: Annotated[bool | None, Field(alias="showNotesInInternalFlag")] = None + show_notes_in_resolution_flag: Annotated[bool | None, Field(alias="showNotesInResolutionFlag")] = None + start_time: Annotated[datetime | None, Field(alias="startTime")] = None status: Literal["Reset", "Running", "Paused", "Stopped"] ticket: TicketReference | None = None - ticket_mobile_guid: UUID | None = Field(default=None, alias="ticketMobileGuid") - total_pause_time: int | None = Field(default=None, alias="totalPauseTime") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - show_notes_in_discussion_flag: bool | None = Field( - default=None, alias="showNotesInDiscussionFlag" - ) - show_notes_in_internal_flag: bool | None = Field( - default=None, alias="showNotesInInternalFlag" - ) - show_notes_in_resolution_flag: bool | None = Field( - default=None, alias="showNotesInResolutionFlag" - ) - email_notes_to_contact_flag: bool | None = Field( - default=None, alias="emailNotesToContactFlag" - ) - email_notes_to_resources_flag: bool | None = Field( - default=None, alias="emailNotesToResourcesFlag" - ) + ticket_mobile_guid: Annotated[UUID | None, Field(alias="ticketMobileGuid")] = None + total_pause_time: Annotated[int | None, Field(alias="totalPauseTime")] = None + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class TimeAccrualDetail(ConnectWiseModel): - id: int | None = None - accrual_type: Literal["Holiday", "PTO", "Sick", "Vacation"] = Field( - ..., alias="accrualType" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + accrual_type: Annotated[Literal["Holiday", "PTO", "Sick", "Vacation"], Field(alias="accrualType")] """ Available types are: Holiday, PTO, Sick and Vacation. """ - start_year: int = Field(..., alias="startYear") - end_year: int = Field(..., alias="endYear") + end_year: Annotated[int, Field(alias="endYear")] hours: float - time_accrual: TimeAccrualReference | None = Field(default=None, alias="timeAccrual") - info: dict[str, str] | None = Field(default=None, alias="_info") + id: int | None = None + start_year: Annotated[int, Field(alias="startYear")] + time_accrual: Annotated[TimeAccrualReference | None, Field(alias="timeAccrual")] = None class TimeEntry(ConnectWiseModel): - id: int | None = None - company: CompanyReference | None = None - charge_to_id: int | None = Field(default=None, alias="chargeToId") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + actual_hours: Annotated[float | None, Field(alias="actualHours")] = None + add_to_detail_description_flag: Annotated[bool | None, Field(alias="addToDetailDescriptionFlag")] = None + add_to_internal_analysis_flag: Annotated[bool | None, Field(alias="addToInternalAnalysisFlag")] = None + add_to_resolution_flag: Annotated[bool | None, Field(alias="addToResolutionFlag")] = None + agreement: AgreementReference | None = None + agreement_amount: Annotated[float | None, Field(alias="agreementAmount")] = None + agreement_hours: Annotated[float | None, Field(alias="agreementHours")] = None + billable_option: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billableOption") + ] = None """ - If chargeToId is not specified, we asume you enter time against the company specified + Required On Updates; """ - charge_to_type: Literal[ - "ServiceTicket", "ProjectTicket", "ChargeCode", "Activity" - ] | None = Field(default=None, alias="chargeToType") + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + charge_to_id: Annotated[int | None, Field(alias="chargeToId")] = None """ If chargeToId is not specified, we asume you enter time against the company specified """ - member: MemberReference | None = None - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - work_type: WorkTypeReference | None = Field(default=None, alias="workType") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - agreement: AgreementReference | None = None - time_start: datetime = Field(..., alias="timeStart") - time_end: datetime | None = Field(default=None, alias="timeEnd") - hours_deduct: float | None = Field(default=None, alias="hoursDeduct") - actual_hours: float | None = Field(default=None, alias="actualHours") - billable_option: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billableOption") + charge_to_type: Annotated[ + Literal["ServiceTicket", "ProjectTicket", "ChargeCode", "Activity"] | None, Field(alias="chargeToType") + ] = None """ - Required On Updates; + If chargeToId is not specified, we asume you enter time against the company specified """ - notes: str | None = None - internal_notes: str | None = Field(default=None, alias="internalNotes") - add_to_detail_description_flag: bool | None = Field( - default=None, alias="addToDetailDescriptionFlag" - ) - add_to_internal_analysis_flag: bool | None = Field( - default=None, alias="addToInternalAnalysisFlag" - ) - add_to_resolution_flag: bool | None = Field( - default=None, alias="addToResolutionFlag" - ) - email_resource_flag: bool | None = Field(default=None, alias="emailResourceFlag") + company: CompanyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None + date_entered: Annotated[datetime | None, Field(alias="dateEntered")] = None + email_cc: Annotated[str | None, Field(alias="emailCc")] = None """ - This is an action flag. To update this value use the /service/tickets endpoint automaticEmailResourceFlag field + To update this value use the /service/tickets endpoint automaticEmailCc field """ - email_contact_flag: bool | None = Field(default=None, alias="emailContactFlag") + email_cc_flag: Annotated[bool | None, Field(alias="emailCcFlag")] = None """ - This is an action flag. To update this value use the /service/tickets endpoint automaticEmailContactFlag field + This is an action flag. To update this value use the /service/tickets endpoint automaticEmailCcFlag field """ - email_cc_flag: bool | None = Field(default=None, alias="emailCcFlag") + email_contact_flag: Annotated[bool | None, Field(alias="emailContactFlag")] = None """ - This is an action flag. To update this value use the /service/tickets endpoint automaticEmailCcFlag field + This is an action flag. To update this value use the /service/tickets endpoint automaticEmailContactFlag field """ - email_cc: str | None = Field(default=None, alias="emailCc") + email_resource_flag: Annotated[bool | None, Field(alias="emailResourceFlag")] = None """ - To update this value use the /service/tickets endpoint automaticEmailCc field + This is an action flag. To update this value use the /service/tickets endpoint automaticEmailResourceFlag field """ - hours_billed: float | None = Field(default=None, alias="hoursBilled") - invoice_hours: float | None = Field(default=None, alias="invoiceHours") - entered_by: str | None = Field(default=None, alias="enteredBy") - date_entered: datetime | None = Field(default=None, alias="dateEntered") - invoice: InvoiceReference | None = None - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - hourly_rate: float | None = Field(default=None, alias="hourlyRate") + entered_by: Annotated[str | None, Field(alias="enteredBy")] = None + hourly_rate: Annotated[float | None, Field(alias="hourlyRate")] = None """ This field may only be Updated, it is defaulted on Create """ - overage_rate: float | None = Field(default=None, alias="overageRate") - agreement_hours: float | None = Field(default=None, alias="agreementHours") - agreement_amount: float | None = Field(default=None, alias="agreementAmount") - time_sheet: TimeSheetReference | None = Field(default=None, alias="timeSheet") + hours_billed: Annotated[float | None, Field(alias="hoursBilled")] = None + hours_deduct: Annotated[float | None, Field(alias="hoursDeduct")] = None + id: int | None = None + internal_notes: Annotated[str | None, Field(alias="internalNotes")] = None + invoice: InvoiceReference | None = None + invoice_hours: Annotated[float | None, Field(alias="invoiceHours")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + member: MemberReference | None = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + notes: str | None = None + overage_rate: Annotated[float | None, Field(alias="overageRate")] = None + phase: ProjectPhaseReference | None = None + project: ProjectReference | None = None status: Literal[ "Open", "Rejected", @@ -16228,369 +12732,338 @@ class TimeEntry(ConnectWiseModel): "BilledAgreement", ] | None = None ticket: TicketReference | None = None - project: ProjectReference | None = None - phase: ProjectPhaseReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + time_end: Annotated[datetime | None, Field(alias="timeEnd")] = None + time_sheet: Annotated[TimeSheetReference | None, Field(alias="timeSheet")] = None + time_start: Annotated[datetime, Field(alias="timeStart")] + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + work_type: Annotated[WorkTypeReference | None, Field(alias="workType")] = None class TimePeriod(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + deadline_date: Annotated[datetime | None, Field(alias="deadlineDate")] = None + end_date: Annotated[datetime | None, Field(alias="endDate")] = None id: int | None = None - time_period_setup: TimePeriodSetupReference | None = Field( - default=None, alias="timePeriodSetup" - ) period: int | None = None - start_date: str | None = Field(default=None, alias="startDate") - end_date: str | None = Field(default=None, alias="endDate") - deadline_date: str | None = Field(default=None, alias="deadlineDate") - info: dict[str, str] | None = Field(default=None, alias="_info") + start_date: Annotated[datetime | None, Field(alias="startDate")] = None + time_period_setup: Annotated[TimePeriodSetupReference | None, Field(alias="timePeriodSetup")] = None class TrackAction(ConnectWiseModel): - id: int | None = None - notify_type: Literal[ - "CreateActivity", - "SendEmail", - "AddToGroup", - "AttachTrack", - "ChangeCompanyStatus", - "CreateServiceTicket", - ] = Field(..., alias="notifyType") - service_template: ServiceTemplateReference | None = Field( - default=None, alias="serviceTemplate" - ) - specific_member_to: MemberReference | None = Field( - default=None, alias="specificMemberTo" - ) - email_recipient: str | None = Field(default=None, alias="emailRecipient") + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + activity_status: Annotated[ActivityStatusReference | None, Field(alias="activityStatus")] = None + activity_type: Annotated[ActivityTypeReference | None, Field(alias="activityType")] = None + attached_track: Annotated[TrackReference | None, Field(alias="attachedTrack")] = None + bcc_contact: Annotated[ContactReference | None, Field(alias="bccContact")] = None + cc_contact: Annotated[ContactReference | None, Field(alias="ccContact")] = None + company_status: Annotated[CompanyStatusReference | None, Field(alias="companyStatus")] = None + days_to_execute: Annotated[int | None, Field(alias="daysToExecute")] = None + email_from: Annotated[str | None, Field(alias="emailFrom")] = None """ Max length: 250; """ - specific_member_from: MemberReference | None = Field( - default=None, alias="specificMemberFrom" - ) - email_from: str | None = Field(default=None, alias="emailFrom") + email_recipient: Annotated[str | None, Field(alias="emailRecipient")] = None """ Max length: 250; """ + group: GroupReference | None = None + id: int | None = None + notes: str | None = None + notify_from: Annotated[NotificationRecipientReference | None, Field(alias="notifyFrom")] = None + notify_type: Annotated[ + Literal[ + "CreateActivity", "SendEmail", "AddToGroup", "AttachTrack", "ChangeCompanyStatus", "CreateServiceTicket" + ], + Field(alias="notifyType"), + ] + notify_who: Annotated[NotificationRecipientReference | None, Field(alias="notifyWho")] = None + service_template: Annotated[ServiceTemplateReference | None, Field(alias="serviceTemplate")] = None + specific_member_from: Annotated[MemberReference | None, Field(alias="specificMemberFrom")] = None + specific_member_to: Annotated[MemberReference | None, Field(alias="specificMemberTo")] = None subject: str | None = None """ Max length: 100; """ - notes: str | None = None - activity_type: ActivityTypeReference | None = Field( - default=None, alias="activityType" - ) - activity_status: ActivityStatusReference | None = Field( - default=None, alias="activityStatus" - ) - company_status: CompanyStatusReference | None = Field( - default=None, alias="companyStatus" - ) track: TrackReference | None = None - attached_track: TrackReference | None = Field(default=None, alias="attachedTrack") - group: GroupReference | None = None - cc_contact: ContactReference | None = Field(default=None, alias="ccContact") - bcc_contact: ContactReference | None = Field(default=None, alias="bccContact") - days_to_execute: int | None = Field(default=None, alias="daysToExecute") - notify_who: NotificationRecipientReference | None = Field( - default=None, alias="notifyWho" - ) - notify_from: NotificationRecipientReference | None = Field( - default=None, alias="notifyFrom" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") class UserDefinedField(ConnectWiseModel): - id: int | None = None - """ - ID of the custom user defined field + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + add_all_business_units: Annotated[bool | None, Field(alias="addAllBusinessUnits")] = None + add_all_locations: Annotated[bool | None, Field(alias="addAllLocations")] = None + business_unit_ids: Annotated[list[int] | None, Field(alias="businessUnitIds")] = None + button_url: Annotated[str | None, Field(alias="buttonUrl")] = None """ - pod_id: int = Field(..., alias="podId") - """ - Id of the Pod where the custom field will be placed + Only available with Button Field Type. Required when entryTypeIdentifier is button Max length: 1000; """ caption: str """ Field caption Max length: 25; """ - sequence_number: int = Field(..., alias="sequenceNumber") - """ - Must be between 1 and 500. This defines the order in which the custom fields will appear - """ - screen_id: str | None = Field(default=None, alias="screenId") + date_created: Annotated[datetime | None, Field(alias="dateCreated")] = None """ - Field ScreenID Max length: 25; + Date in UTC the custom field was created """ - help_text: str | None = Field(default=None, alias="helpText") + display_on_screen_flag: Annotated[bool | None, Field(alias="displayOnScreenFlag")] = None + entry_type_identifier: Annotated[ + Literal["Date", "EntryField", "List", "Option"] | None, Field(alias="entryTypeIdentifier") + ] = None + field_type_identifier: Annotated[ + Literal[ + "TextArea", + "Button", + "Currency", + "Date", + "Hyperlink", + "IPAddress", + "Checkbox", + "Number", + "Percent", + "Text", + "Password", + ], + Field(alias="fieldTypeIdentifier"), + ] + help_text: Annotated[str | None, Field(alias="helpText")] = None """ Help text to accompany the custom field Max length: 1000; """ - field_type_identifier: Literal[ - "TextArea", - "Button", - "Currency", - "Date", - "Hyperlink", - "IPAddress", - "Checkbox", - "Number", - "Percent", - "Text", - "Password", - ] = Field(..., alias="fieldTypeIdentifier") - number_decimals: int | None = Field(default=None, alias="numberDecimals") + id: int | None = None """ - Only valid for Number or percent + ID of the custom user defined field """ - entry_type_identifier: Literal[ - "Date", "EntryField", "List", "Option" - ] | None = Field(default=None, alias="entryTypeIdentifier") - required_flag: bool | None = Field(default=None, alias="requiredFlag") - display_on_screen_flag: bool | None = Field( - default=None, alias="displayOnScreenFlag" - ) - read_only_flag: bool | None = Field(default=None, alias="readOnlyFlag") - list_view_flag: bool | None = Field(default=None, alias="listViewFlag") + list_view_flag: Annotated[bool | None, Field(alias="listViewFlag")] = None """ Denotes that this custom field is included on a list view """ - button_url: str | None = Field(default=None, alias="buttonUrl") + location_ids: Annotated[list[int] | None, Field(alias="locationIds")] = None + number_decimals: Annotated[int | None, Field(alias="numberDecimals")] = None """ - Only available with Button Field Type. Required when entryTypeIdentifier is button Max length: 1000; + Only valid for Number or percent """ options: list[UserDefinedFieldOption] | None = None - business_unit_ids: list[int] | None = Field(default=None, alias="businessUnitIds") - location_ids: list[int] | None = Field(default=None, alias="locationIds") - add_all_business_units: bool | None = Field( - default=None, alias="addAllBusinessUnits" - ) - remove_all_business_units: bool | None = Field( - default=None, alias="removeAllBusinessUnits" - ) - add_all_locations: bool | None = Field(default=None, alias="addAllLocations") - remove_all_locations: bool | None = Field(default=None, alias="removeAllLocations") - date_created: datetime | None = Field(default=None, alias="dateCreated") + pod_id: Annotated[int, Field(alias="podId")] """ - Date in UTC the custom field was created + Id of the Pod where the custom field will be placed + """ + read_only_flag: Annotated[bool | None, Field(alias="readOnlyFlag")] = None + remove_all_business_units: Annotated[bool | None, Field(alias="removeAllBusinessUnits")] = None + remove_all_locations: Annotated[bool | None, Field(alias="removeAllLocations")] = None + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + sequence_number: Annotated[int, Field(alias="sequenceNumber")] + """ + Must be between 1 and 500. This defines the order in which the custom fields will appear """ - info: dict[str, str] | None = Field(default=None, alias="_info") class UserDefinedFieldInfo(ConnectWiseModel): - id: int | None = None + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + business_unit_ids: Annotated[list[int] | None, Field(alias="businessUnitIds")] = None """ - ID of the custom user defined field + List of business unit ids using custom field """ - pod_id: int | None = Field(default=None, alias="podId") + button_url: Annotated[str | None, Field(alias="buttonUrl")] = None """ - Id of the Pod where the custom field will be placed + Only available with Button Field Type. Required when entryTypeIdentifier is button """ caption: str | None = None """ Field caption """ - sequence_number: int | None = Field(default=None, alias="sequenceNumber") + date_created: Annotated[datetime | None, Field(alias="dateCreated")] = None """ - Must be between 1 and 500. This defines the order in which the custom fields will appear + Date in UTC the custom field was created """ - help_text: str | None = Field(default=None, alias="helpText") + display_on_screen_flag: Annotated[bool | None, Field(alias="displayOnScreenFlag")] = None + entry_type_identifier: Annotated[ + Literal["Date", "EntryField", "List", "Option"] | None, Field(alias="entryTypeIdentifier") + ] = None + field_type_identifier: Annotated[ + Literal[ + "TextArea", + "Button", + "Currency", + "Date", + "Hyperlink", + "IPAddress", + "Checkbox", + "Number", + "Percent", + "Text", + "Password", + ] + | None, + Field(alias="fieldTypeIdentifier"), + ] = None + help_text: Annotated[str | None, Field(alias="helpText")] = None """ Help text to accompany the custom field """ - field_type_identifier: Literal[ - "TextArea", - "Button", - "Currency", - "Date", - "Hyperlink", - "IPAddress", - "Checkbox", - "Number", - "Percent", - "Text", - "Password", - ] | None = Field(default=None, alias="fieldTypeIdentifier") - number_decimals: int | None = Field(default=None, alias="numberDecimals") + id: int | None = None """ - Only valid for Number or percent + ID of the custom user defined field """ - entry_type_identifier: Literal[ - "Date", "EntryField", "List", "Option" - ] | None = Field(default=None, alias="entryTypeIdentifier") - required_flag: bool | None = Field(default=None, alias="requiredFlag") - display_on_screen_flag: bool | None = Field( - default=None, alias="displayOnScreenFlag" - ) - read_only_flag: bool | None = Field(default=None, alias="readOnlyFlag") - list_view_flag: bool | None = Field(default=None, alias="listViewFlag") + list_view_flag: Annotated[bool | None, Field(alias="listViewFlag")] = None """ Denotes that this custom field is included on a list view """ - button_url: str | None = Field(default=None, alias="buttonUrl") + location_ids: Annotated[list[int] | None, Field(alias="locationIds")] = None """ - Only available with Button Field Type. Required when entryTypeIdentifier is button + List of locations ids using custom field """ - options: list[UserDefinedFieldOption] | None = None - business_unit_ids: list[int] | None = Field(default=None, alias="businessUnitIds") + number_decimals: Annotated[int | None, Field(alias="numberDecimals")] = None """ - List of business unit ids using custom field + Only valid for Number or percent """ - location_ids: list[int] | None = Field(default=None, alias="locationIds") + options: list[UserDefinedFieldOption] | None = None + pod_id: Annotated[int | None, Field(alias="podId")] = None """ - List of locations ids using custom field + Id of the Pod where the custom field will be placed """ - date_created: str | None = Field(default=None, alias="dateCreated") + read_only_flag: Annotated[bool | None, Field(alias="readOnlyFlag")] = None + required_flag: Annotated[bool | None, Field(alias="requiredFlag")] = None + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None """ - Date in UTC the custom field was created + Must be between 1 and 500. This defines the order in which the custom fields will appear """ - info: dict[str, str] | None = Field(default=None, alias="_info") class WarehouseBin(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + company: CompanyReference | None = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None + department: SystemDepartmentReference | None = None + height: float | None = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None + length: float | None = None + location: SystemLocationReference | None = None + manager: MemberReference | None = None + max_quantity: Annotated[float | None, Field(alias="maxQuantity")] = None + min_quantity: Annotated[float | None, Field(alias="minQuantity")] = None name: str """ Max length: 50; """ + overflow_bin: Annotated[WarehouseBinReference | None, Field(alias="overflowBin")] = None + quantity_on_hand: Annotated[int | None, Field(alias="quantityOnHand")] = None + transfer_bin: Annotated[WarehouseBinReference | None, Field(alias="transferBin")] = None warehouse: WarehouseReference | None = None - location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - min_quantity: float | None = Field(default=None, alias="minQuantity") - max_quantity: float | None = Field(default=None, alias="maxQuantity") - overflow_bin: WarehouseBinReference | None = Field( - default=None, alias="overflowBin" - ) - manager: MemberReference | None = None - length: float | None = None - width: float | None = None - height: float | None = None weight: float | None = None - default_flag: bool | None = Field(default=None, alias="defaultFlag") - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - quantity_on_hand: int | None = Field(default=None, alias="quantityOnHand") - company: CompanyReference | None = None - transfer_bin: WarehouseBinReference | None = Field( - default=None, alias="transferBin" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + width: float | None = None class WarehouseBinInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + default_flag: Annotated[bool | None, Field(alias="defaultFlag")] = None id: int | None = None + inactive_flag: Annotated[bool | None, Field(alias="inactiveFlag")] = None name: str | None = None warehouse: WarehouseReference | None = None - inactive_flag: bool | None = Field(default=None, alias="inactiveFlag") - default_flag: bool | None = Field(default=None, alias="defaultFlag") - info: dict[str, str] | None = Field(default=None, alias="_info") -class Workflow(ConnectWiseModel): +class WorkRoleExemption(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + id: int | None = None + taxable_levels: Annotated[list[int] | None, Field(alias="taxableLevels")] = None + work_role: Annotated[WorkRoleReference, Field(alias="workRole")] + + +class WorkRoleLocation(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + hourly_rate: Annotated[float | None, Field(alias="hourlyRate")] = None id: int | None = None - name: str - """ - Max length: 100; - """ - table_type: WorkflowTableTypeReference | None = Field( - default=None, alias="tableType" - ) location: SystemLocationReference | None = None - department: SystemDepartmentReference | None = None - activate_flag: bool | None = Field(default=None, alias="activateFlag") + work_role: Annotated[WorkRoleReference | None, Field(alias="workRole")] = None + + +class Workflow(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + activate_flag: Annotated[bool | None, Field(alias="activateFlag")] = None """ Batches can not be turned on until after the workflow is created and it has atleast one event associated with it """ - batch_interval: int | None = Field(default=None, alias="batchInterval") - batch_frequency_unit: Literal["Minutes", "Hours", "Days"] | None = Field( - default=None, alias="batchFrequencyUnit" - ) + batch_frequency_unit: Annotated[ + Literal["Minutes", "Hours", "Days"] | None, Field(alias="batchFrequencyUnit") + ] = None """ If not specified, defaults to Minutes. Months is not supported as month length varies """ - batch_last_ran: datetime | None = Field(default=None, alias="batchLastRan") - batch_schedule: Literal[ - "AnyTime", "MyCompanyOfficeHours", "SlaHours" - ] | None = Field(default=None, alias="batchSchedule") + batch_interval: Annotated[int | None, Field(alias="batchInterval")] = None + batch_last_ran: Annotated[datetime | None, Field(alias="batchLastRan")] = None + batch_schedule: Annotated[ + Literal["AnyTime", "MyCompanyOfficeHours", "SlaHours"] | None, Field(alias="batchSchedule") + ] = None """ If activateFlag is true, batchSchedule is required """ board: BoardReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class WorkRoleExemption(ConnectWiseModel): - id: int | None = None - work_role: WorkRoleReference = Field(..., alias="workRole") - taxable_levels: list[int] | None = Field(default=None, alias="taxableLevels") - info: dict[str, str] | None = Field(default=None, alias="_info") - - -class WorkRoleLocation(ConnectWiseModel): + department: SystemDepartmentReference | None = None id: int | None = None location: SystemLocationReference | None = None - hourly_rate: float | None = Field(default=None, alias="hourlyRate") - work_role: WorkRoleReference | None = Field(default=None, alias="workRole") - info: dict[str, str] | None = Field(default=None, alias="_info") + name: str + """ + Max length: 100; + """ + table_type: Annotated[WorkflowTableTypeReference | None, Field(alias="tableType")] = None class BulkResult(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None payload: list[ResultInfo] | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class BundleResult(ConnectWiseModel): - sequence_number: int | None = Field(default=None, alias="sequenceNumber") - resource_type: str | None = Field(default=None, alias="resourceType") - entities: list[IRestIdentifiedItem] | None = None count: int | None = None - version: str | None = None - success: bool | None = None - status_code: int | None = Field(default=None, alias="statusCode") + entities: list[IRestIdentifiedItem] | None = None error: ErrorResponseMessage | None = None + resource_type: Annotated[str | None, Field(alias="resourceType")] = None + sequence_number: Annotated[int | None, Field(alias="sequenceNumber")] = None + status_code: Annotated[int | None, Field(alias="statusCode")] = None + success: bool | None = None + version: str | None = None class BundleResultsCollection(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None results: list[BundleResult] | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") class ExpenseEntry(ConnectWiseModel): - id: int | None = None - expense_report: ExpenseReportReference | None = Field( - default=None, alias="expenseReport" - ) - company: CompanyReference | None = None - charge_to_id: int | None = Field(default=None, alias="chargeToId") - charge_to_type: Literal[ - "ServiceTicket", "ProjectTicket", "ChargeCode", "Activity" - ] | None = Field(default=None, alias="chargeToType") - """ - Gets or sets - company or chargeToType is required. + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement: AgreementReference | None = None + agreement_amount: Annotated[float | None, Field(alias="agreementAmount")] = None + amount: float + bill_amount: Annotated[float | None, Field(alias="billAmount")] = None + billable_option: Annotated[ + Literal["Billable", "DoNotBill", "NoCharge", "NoDefault"] | None, Field(alias="billableOption") + ] = None + business_unit_id: Annotated[int | None, Field(alias="businessUnitId")] = None + charge_to_id: Annotated[int | None, Field(alias="chargeToId")] = None + charge_to_type: Annotated[ + Literal["ServiceTicket", "ProjectTicket", "ChargeCode", "Activity"] | None, Field(alias="chargeToType") + ] = None + """ + Company or chargeToType is required """ - type: ExpenseTypeReference | None = None - member: MemberReference | None = None - payment_method: PaymentMethodReference | None = Field( - default=None, alias="paymentMethod" - ) classification: ClassificationReference | None = None - amount: float - billable_option: Literal[ - "Billable", "DoNotBill", "NoCharge", "NoDefault" - ] | None = Field(default=None, alias="billableOption") + company: CompanyReference | None = None + currency: CurrencyReference | None = None + custom_fields: Annotated[list[CustomFieldValue] | None, Field(alias="customFields")] = None date: datetime - location_id: int | None = Field(default=None, alias="locationId") - business_unit_id: int | None = Field(default=None, alias="businessUnitId") - notes: str | None = None - agreement: AgreementReference | None = None - invoice_amount: float | None = Field(default=None, alias="invoiceAmount") - mobile_guid: UUID | None = Field(default=None, alias="mobileGuid") - taxes: list[ExpenseTax] | None = None + expense_report: Annotated[ExpenseReportReference | None, Field(alias="expenseReport")] = None + id: int | None = None invoice: InvoiceReference | None = None - currency: CurrencyReference | None = None + invoice_amount: Annotated[float | None, Field(alias="invoiceAmount")] = None + location_id: Annotated[int | None, Field(alias="locationId")] = None + member: MemberReference | None = None + mobile_guid: Annotated[UUID | None, Field(alias="mobileGuid")] = None + notes: str | None = None + odometer_end: Annotated[float | None, Field(alias="odometerEnd")] = None + odometer_start: Annotated[float | None, Field(alias="odometerStart")] = None + payment_method: Annotated[PaymentMethodReference | None, Field(alias="paymentMethod")] = None + phase: ProjectPhaseReference | None = None + project: ProjectReference | None = None status: Literal[ "Open", "Rejected", @@ -16605,347 +13078,206 @@ class ExpenseEntry(ConnectWiseModel): "WrittenOff", "BilledAgreement", ] | None = None - bill_amount: float | None = Field(default=None, alias="billAmount") - agreement_amount: float | None = Field(default=None, alias="agreementAmount") - odometer_start: float | None = Field(default=None, alias="odometerStart") - odometer_end: float | None = Field(default=None, alias="odometerEnd") + taxes: list[ExpenseTax] | None = None ticket: TicketReference | None = None - project: ProjectReference | None = None - phase: ProjectPhaseReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") - custom_fields: list[CustomFieldValue] | None = Field( - default=None, alias="customFields" - ) + type: ExpenseTypeReference | None = None class Forecast(ConnectWiseModel): - id: int | None = None - forecast_items: list[ForecastItem] | None = Field( - default=None, alias="forecastItems" - ) - product_revenue: ProductRevenueReference | None = Field( - default=None, alias="productRevenue" - ) - service_revenue: ServiceRevenueReference | None = Field( - default=None, alias="serviceRevenue" - ) - agreement_revenue: AgreementRevenueReference | None = Field( - default=None, alias="agreementRevenue" - ) - time_revenue: TimeRevenueReference | None = Field(default=None, alias="timeRevenue") - expense_revenue: ExpenseRevenueReference | None = Field( - default=None, alias="expenseRevenue" - ) - forecast_revenue_totals: ForecastRevenueReference | None = Field( - default=None, alias="forecastRevenueTotals" - ) - inclusive_revenue_totals: InclusiveRevenueReference | None = Field( - default=None, alias="inclusiveRevenueTotals" - ) - recurring_total: float | None = Field(default=None, alias="recurringTotal") - won_revenue: WonRevenueReference | None = Field(default=None, alias="wonRevenue") - lost_revenue: LostRevenueReference | None = Field(default=None, alias="lostRevenue") - open_revenue: OpenRevenueReference | None = Field(default=None, alias="openRevenue") - other_revenue1: Other1RevenueReference | None = Field( - default=None, alias="otherRevenue1" - ) - other_revenue2: Other2RevenueReference | None = Field( - default=None, alias="otherRevenue2" - ) - sales_tax_revenue: float | None = Field(default=None, alias="salesTaxRevenue") - forecast_total_with_taxes: float | None = Field( - default=None, alias="forecastTotalWithTaxes" - ) - expected_probability: int | None = Field(default=None, alias="expectedProbability") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_revenue: Annotated[AgreementRevenueReference | None, Field(alias="agreementRevenue")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None currency: CurrencyReference | None = None - info: dict[str, str] | None = Field(default=None, alias="_info") + expected_probability: Annotated[int | None, Field(alias="expectedProbability")] = None + expense_revenue: Annotated[ExpenseRevenueReference | None, Field(alias="expenseRevenue")] = None + forecast_items: Annotated[list[ForecastItem] | None, Field(alias="forecastItems")] = None + forecast_revenue_totals: Annotated[ForecastRevenueReference | None, Field(alias="forecastRevenueTotals")] = None + forecast_total_with_taxes: Annotated[float | None, Field(alias="forecastTotalWithTaxes")] = None + id: int | None = None + inclusive_revenue_totals: Annotated[InclusiveRevenueReference | None, Field(alias="inclusiveRevenueTotals")] = None + lost_revenue: Annotated[LostRevenueReference | None, Field(alias="lostRevenue")] = None + open_revenue: Annotated[OpenRevenueReference | None, Field(alias="openRevenue")] = None + other_revenue1: Annotated[Other1RevenueReference | None, Field(alias="otherRevenue1")] = None + other_revenue2: Annotated[Other2RevenueReference | None, Field(alias="otherRevenue2")] = None + product_revenue: Annotated[ProductRevenueReference | None, Field(alias="productRevenue")] = None + recurring_total: Annotated[float | None, Field(alias="recurringTotal")] = None + sales_tax_revenue: Annotated[float | None, Field(alias="salesTaxRevenue")] = None + service_revenue: Annotated[ServiceRevenueReference | None, Field(alias="serviceRevenue")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + time_revenue: Annotated[TimeRevenueReference | None, Field(alias="timeRevenue")] = None + won_revenue: Annotated[WonRevenueReference | None, Field(alias="wonRevenue")] = None class GLExportAdjustmentTransaction(ConnectWiseModel): + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + adjustment_description: Annotated[str | None, Field(alias="adjustmentDescription")] = None + adjustment_detail: Annotated[ + list[GLExportAdjustmentTransactionDetail] | None, Field(alias="adjustmentDetail") + ] = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeID")] = None id: str | None = None - document_type: str | None = Field(default=None, alias="documentType") - document_date: str | None = Field(default=None, alias="documentDate") - gl_type_id: str | None = Field(default=None, alias="glTypeID") - account_number: str | None = Field(default=None, alias="accountNumber") memo: str | None = None - gl_class: str | None = Field(default=None, alias="glClass") - adjustment_description: str | None = Field( - default=None, alias="adjustmentDescription" - ) - adjustment_detail: list[GLExportAdjustmentTransactionDetail] | None = Field( - default=None, alias="adjustmentDetail" - ) class GLExportExpense(ConnectWiseModel): - id: int | None = None - document_date: str | None = Field(default=None, alias="documentDate") - document_type: str | None = Field(default=None, alias="documentType") - ap_account_number: str | None = Field(default=None, alias="apAccountNumber") - ap_class: str | None = Field(default=None, alias="apClass") - account_number: str | None = Field(default=None, alias="accountNumber") - gl_class: str | None = Field(default=None, alias="glClass") - gl_type_id: str | None = Field(default=None, alias="glTypeId") - memo: str | None = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + ap_account_number: Annotated[str | None, Field(alias="apAccountNumber")] = None + ap_class: Annotated[str | None, Field(alias="apClass")] = None + company: CompanyReference | None = None + company_account_number: Annotated[str | None, Field(alias="companyAccountNumber")] = None + currency: CurrencyReference | None = None description: str | None = None - period_start_date: str | None = Field(default=None, alias="periodStartDate") - period_end_date: str | None = Field(default=None, alias="periodEndDate") + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None + id: int | None = None member: MemberReference | None = None - vendor_number: str | None = Field(default=None, alias="vendorNumber") - company: CompanyReference | None = None - company_account_number: str | None = Field( - default=None, alias="companyAccountNumber" - ) + memo: str | None = None + offset: GLExportExpenseOffset | None = None + period_end_date: Annotated[datetime | None, Field(alias="periodEndDate")] = None + period_start_date: Annotated[datetime | None, Field(alias="periodStartDate")] = None project: ProjectReference | None = None - currency: CurrencyReference | None = None total: float | None = None - offset: GLExportExpenseOffset | None = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None class GLExportPurchaseTransaction(ConnectWiseModel): - id: str | None = None - document_date: str | None = Field(default=None, alias="documentDate") - document_number: str | None = Field(default=None, alias="documentNumber") - description: str | None = None - memo: str | None = None - ap_account_number: str | None = Field(default=None, alias="apAccountNumber") - purchase_date: str | None = Field(default=None, alias="purchaseDate") + ap_account_number: Annotated[str | None, Field(alias="apAccountNumber")] = None + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + billing_terms_xref: Annotated[str | None, Field(alias="billingTermsXref")] = None + city_tax_xref: Annotated[str | None, Field(alias="cityTaxXref")] = None company: CompanyReference | None = None - company_type: CompanyTypeReference | None = Field(default=None, alias="companyType") + company_type: Annotated[CompanyTypeReference | None, Field(alias="companyType")] = None contact: ContactReference | None = None - site: SiteReference | None = None - purchase_class: str | None = Field(default=None, alias="purchaseClass") - freight_amount: float | None = Field(default=None, alias="freightAmount") - freight_packing_slip: str | None = Field(default=None, alias="freightPackingSlip") - packing_slip: str | None = Field(default=None, alias="packingSlip") - dropship_flag: bool | None = Field(default=None, alias="dropshipFlag") + county_tax_xref: Annotated[str | None, Field(alias="countyTaxXref")] = None currency: CurrencyReference | None = None + description: str | None = None + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_number: Annotated[str | None, Field(alias="documentNumber")] = None + dropship_flag: Annotated[bool | None, Field(alias="dropshipFlag")] = None + due_days: Annotated[int | None, Field(alias="dueDays")] = None + freight_amount: Annotated[float | None, Field(alias="freightAmount")] = None + freight_packing_slip: Annotated[str | None, Field(alias="freightPackingSlip")] = None + id: str | None = None + memo: str | None = None + packing_slip: Annotated[str | None, Field(alias="packingSlip")] = None + purchase_class: Annotated[str | None, Field(alias="purchaseClass")] = None + purchase_date: Annotated[datetime | None, Field(alias="purchaseDate")] = None + purchase_detail: Annotated[list[GLExportPurchaseTransactionDetail] | None, Field(alias="purchaseDetail")] = None + purchase_detail_tax: Annotated[ + list[GLExportPurchaseTransactionDetailTax] | None, Field(alias="purchaseDetailTax") + ] = None + purchase_header_freight_taxable_flag: Annotated[bool | None, Field(alias="purchaseHeaderFreightTaxableFlag")] = None + purchase_header_tax_group: Annotated[str | None, Field(alias="purchaseHeaderTaxGroup")] = None + purchase_header_taxable_flag: Annotated[bool | None, Field(alias="purchaseHeaderTaxableFlag")] = None + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + ship_to_company_account_number: Annotated[str | None, Field(alias="shipToCompanyAccountNumber")] = None + ship_to_company_type: Annotated[CompanyTypeReference | None, Field(alias="shipToCompanyType")] = None + ship_to_contact: Annotated[ContactReference | None, Field(alias="shipToContact")] = None + ship_to_site: Annotated[SiteReference | None, Field(alias="shipToSite")] = None + ship_to_tax_group: Annotated[str | None, Field(alias="shipToTaxGroup")] = None + site: SiteReference | None = None + state_tax_xref: Annotated[str | None, Field(alias="stateTaxXref")] = None + tax_agency_xref: Annotated[str | None, Field(alias="taxAgencyXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_group_rate: Annotated[float | None, Field(alias="taxGroupRate")] = None + tax_levels: Annotated[list[GLExportPurchaseTransactionTaxLevel] | None, Field(alias="taxLevels")] = None total: float | None = None - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - billing_terms_xref: str | None = Field(default=None, alias="billingTermsXref") - due_days: int | None = Field(default=None, alias="dueDays") - vendor_number: str | None = Field(default=None, alias="vendorNumber") - vendor_account_number: str | None = Field(default=None, alias="vendorAccountNumber") - vendor_invoice_date: str | None = Field(default=None, alias="vendorInvoiceDate") - vendor_invoice_number: str | None = Field(default=None, alias="vendorInvoiceNumber") - tax_agency_xref: str | None = Field(default=None, alias="taxAgencyXref") - state_tax_xref: str | None = Field(default=None, alias="stateTaxXref") - county_tax_xref: str | None = Field(default=None, alias="countyTaxXref") - city_tax_xref: str | None = Field(default=None, alias="cityTaxXref") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_company_account_number: str | None = Field( - default=None, alias="shipToCompanyAccountNumber" - ) - ship_to_company_type: CompanyTypeReference | None = Field( - default=None, alias="shipToCompanyType" - ) - ship_to_contact: ContactReference | None = Field( - default=None, alias="shipToContact" - ) - ship_to_site: SiteReference | None = Field(default=None, alias="shipToSite") - ship_to_tax_group: str | None = Field(default=None, alias="shipToTaxGroup") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - tax_group_rate: float | None = Field(default=None, alias="taxGroupRate") - use_avalara_tax_flag: bool | None = Field(default=None, alias="useAvalaraTaxFlag") - purchase_header_tax_group: str | None = Field( - default=None, alias="purchaseHeaderTaxGroup" - ) - purchase_header_taxable_flag: bool | None = Field( - default=None, alias="purchaseHeaderTaxableFlag" - ) - purchase_header_freight_taxable_flag: bool | None = Field( - default=None, alias="purchaseHeaderFreightTaxableFlag" - ) - tax_levels: list[GLExportPurchaseTransactionTaxLevel] | None = Field( - default=None, alias="taxLevels" - ) - purchase_detail: list[GLExportPurchaseTransactionDetail] | None = Field( - default=None, alias="purchaseDetail" - ) - purchase_detail_tax: list[GLExportPurchaseTransactionDetailTax] | None = Field( - default=None, alias="purchaseDetailTax" - ) + use_avalara_tax_flag: Annotated[bool | None, Field(alias="useAvalaraTaxFlag")] = None + vendor_account_number: Annotated[str | None, Field(alias="vendorAccountNumber")] = None + vendor_invoice_date: Annotated[datetime | None, Field(alias="vendorInvoiceDate")] = None + vendor_invoice_number: Annotated[str | None, Field(alias="vendorInvoiceNumber")] = None + vendor_number: Annotated[str | None, Field(alias="vendorNumber")] = None class GLExportTransaction(ConnectWiseModel): - id: int | None = None - gl_class: str | None = Field(default=None, alias="glClass") - gl_type_id: str | None = Field(default=None, alias="glTypeId") - document_date: str | None = Field(default=None, alias="documentDate") - document_number: str | None = Field(default=None, alias="documentNumber") - document_type: str | None = Field(default=None, alias="documentType") - memo: str | None = None - description: str | None = None + account_number: Annotated[str | None, Field(alias="accountNumber")] = None + agreement_pre_payment_flag: Annotated[bool | None, Field(alias="agreementPrePaymentFlag")] = None attention: str | None = None - sales_territory: str | None = Field(default=None, alias="salesTerritory") + billing_terms: Annotated[BillingTermsReference | None, Field(alias="billingTerms")] = None + billing_terms_xref: Annotated[str | None, Field(alias="billingTermsXref")] = None + billing_type: Annotated[str | None, Field(alias="billingType")] = None + city_tax: Annotated[float | None, Field(alias="cityTax")] = None company: CompanyReference | None = None - company_type: CompanyTypeReference | None = Field(default=None, alias="companyType") - company_account_number: str | None = Field( - default=None, alias="companyAccountNumber" - ) - site: SiteReference | None = None - billing_terms: BillingTermsReference | None = Field( - default=None, alias="billingTerms" - ) - billing_terms_xref: str | None = Field(default=None, alias="billingTermsXref") - due_days: int | None = Field(default=None, alias="dueDays") - due_date: str | None = Field(default=None, alias="dueDate") - email_delivery_flag: bool | None = Field(default=None, alias="emailDeliveryFlag") - print_delivery_flag: bool | None = Field(default=None, alias="printDeliveryFlag") - agreement_pre_payment_flag: bool | None = Field( - default=None, alias="agreementPrePaymentFlag" - ) - account_number: str | None = Field(default=None, alias="accountNumber") - billing_type: str | None = Field(default=None, alias="billingType") - gl_entry_ids: str | None = Field(default=None, alias="glEntryIds") - purchase_order: PurchaseOrderReference | None = Field( - default=None, alias="purchaseOrder" - ) - project: ProjectReference | None = None + company_account_number: Annotated[str | None, Field(alias="companyAccountNumber")] = None + company_type: Annotated[CompanyTypeReference | None, Field(alias="companyType")] = None + county_tax: Annotated[float | None, Field(alias="countyTax")] = None + county_tax_xref: Annotated[str | None, Field(alias="countyTaxXref")] = None currency: CurrencyReference | None = None - total: float | None = None - sales_rep_id: str | None = Field(default=None, alias="salesRepId") - sales_rep_name: str | None = Field(default=None, alias="salesRepName") - taxable: bool | None = None - taxable_total: float | None = Field(default=None, alias="taxableTotal") - tax_code: TaxCodeReference | None = Field(default=None, alias="taxCode") - tax_group_rate: float | None = Field(default=None, alias="taxGroupRate") - piggy_back_flag: bool | None = Field(default=None, alias="piggyBackFlag") - tax_account_number: str | None = Field(default=None, alias="taxAccountNumber") - sales_tax: float | None = Field(default=None, alias="salesTax") - state_tax: float | None = Field(default=None, alias="stateTax") - county_tax: float | None = Field(default=None, alias="countyTax") - city_tax: float | None = Field(default=None, alias="cityTax") - taxable_amount1: float | None = Field(default=None, alias="taxableAmount1") - taxable_amount2: float | None = Field(default=None, alias="taxableAmount2") - taxable_amount3: float | None = Field(default=None, alias="taxableAmount3") - taxable_amount4: float | None = Field(default=None, alias="taxableAmount4") - taxable_amount5: float | None = Field(default=None, alias="taxableAmount5") - tax_agency_xref: str | None = Field(default=None, alias="taxAgencyXref") - state_tax_xref: str | None = Field(default=None, alias="stateTaxXref") - county_tax_xref: str | None = Field(default=None, alias="countyTaxXref") - tax_id: str | None = Field(default=None, alias="taxId") - tax_dp_applied_flag: bool | None = Field(default=None, alias="taxDpAppliedFlag") - use_avalara_flag: bool | None = Field(default=None, alias="useAvalaraFlag") - send_avalara_tax_flag: bool | None = Field(default=None, alias="sendAvalaraTaxFlag") - ship_to_company: CompanyReference | None = Field( - default=None, alias="shipToCompany" - ) - ship_to_company_account_number: str | None = Field( - default=None, alias="shipToCompanyAccountNumber" - ) - ship_to_company_type: CompanyTypeReference | None = Field( - default=None, alias="shipToCompanyType" - ) - ship_to_tax_id: str | None = Field(default=None, alias="shipToTaxId") - ship_site: SiteReference | None = Field(default=None, alias="shipSite") - ship_contact: str | None = Field(default=None, alias="shipContact") + description: str | None = None detail: list[GLExportTransactionDetail] | None = None - tax_levels: list[GLExportTransactionTaxLevel] | None = Field( - default=None, alias="taxLevels" - ) + document_date: Annotated[datetime | None, Field(alias="documentDate")] = None + document_number: Annotated[str | None, Field(alias="documentNumber")] = None + document_type: Annotated[str | None, Field(alias="documentType")] = None + due_date: Annotated[datetime | None, Field(alias="dueDate")] = None + due_days: Annotated[int | None, Field(alias="dueDays")] = None + email_delivery_flag: Annotated[bool | None, Field(alias="emailDeliveryFlag")] = None + gl_class: Annotated[str | None, Field(alias="glClass")] = None + gl_entry_ids: Annotated[str | None, Field(alias="glEntryIds")] = None + gl_type_id: Annotated[str | None, Field(alias="glTypeId")] = None + id: int | None = None + memo: str | None = None + piggy_back_flag: Annotated[bool | None, Field(alias="piggyBackFlag")] = None + print_delivery_flag: Annotated[bool | None, Field(alias="printDeliveryFlag")] = None + project: ProjectReference | None = None + purchase_order: Annotated[PurchaseOrderReference | None, Field(alias="purchaseOrder")] = None + sales_rep_id: Annotated[str | None, Field(alias="salesRepId")] = None + sales_rep_name: Annotated[str | None, Field(alias="salesRepName")] = None + sales_tax: Annotated[float | None, Field(alias="salesTax")] = None + sales_territory: Annotated[str | None, Field(alias="salesTerritory")] = None + send_avalara_tax_flag: Annotated[bool | None, Field(alias="sendAvalaraTaxFlag")] = None + ship_contact: Annotated[str | None, Field(alias="shipContact")] = None + ship_site: Annotated[SiteReference | None, Field(alias="shipSite")] = None + ship_to_company: Annotated[CompanyReference | None, Field(alias="shipToCompany")] = None + ship_to_company_account_number: Annotated[str | None, Field(alias="shipToCompanyAccountNumber")] = None + ship_to_company_type: Annotated[CompanyTypeReference | None, Field(alias="shipToCompanyType")] = None + ship_to_tax_id: Annotated[str | None, Field(alias="shipToTaxId")] = None + site: SiteReference | None = None + state_tax: Annotated[float | None, Field(alias="stateTax")] = None + state_tax_xref: Annotated[str | None, Field(alias="stateTaxXref")] = None + tax_account_number: Annotated[str | None, Field(alias="taxAccountNumber")] = None + tax_agency_xref: Annotated[str | None, Field(alias="taxAgencyXref")] = None + tax_code: Annotated[TaxCodeReference | None, Field(alias="taxCode")] = None + tax_dp_applied_flag: Annotated[bool | None, Field(alias="taxDpAppliedFlag")] = None + tax_group_rate: Annotated[float | None, Field(alias="taxGroupRate")] = None + tax_id: Annotated[str | None, Field(alias="taxId")] = None + tax_levels: Annotated[list[GLExportTransactionTaxLevel] | None, Field(alias="taxLevels")] = None + taxable: bool | None = None + taxable_amount1: Annotated[float | None, Field(alias="taxableAmount1")] = None + taxable_amount2: Annotated[float | None, Field(alias="taxableAmount2")] = None + taxable_amount3: Annotated[float | None, Field(alias="taxableAmount3")] = None + taxable_amount4: Annotated[float | None, Field(alias="taxableAmount4")] = None + taxable_amount5: Annotated[float | None, Field(alias="taxableAmount5")] = None + taxable_total: Annotated[float | None, Field(alias="taxableTotal")] = None + total: float | None = None + use_avalara_flag: Annotated[bool | None, Field(alias="useAvalaraFlag")] = None class InvoiceInfo(ConnectWiseModel): + info: Annotated[dict[str, str] | None, Field(alias="_info")] = None + agreement_billing_info: Annotated[list[AgreementBillingInfo] | None, Field(alias="agreementBillingInfo")] = None + billing_setup: Annotated[BillingSetup | None, Field(alias="billingSetup")] = None + bundled_components_info: Annotated[list[ProductComponent] | None, Field(alias="bundledComponentsInfo")] = None + expenses: list[ExpenseEntry] | None = None id: int | None = None invoice: Invoice | None = None - invoice_template: InvoiceTemplate | None = Field( - default=None, alias="invoiceTemplate" - ) - products: list[ProductItem] | None = None - bundled_components_info: list[ProductComponent] | None = Field( - default=None, alias="bundledComponentsInfo" - ) - expenses: list[ExpenseEntry] | None = None - time_entries: list[TimeEntry] | None = Field(default=None, alias="timeEntries") + invoice_template: Annotated[InvoiceTemplate | None, Field(alias="invoiceTemplate")] = None logo: DocumentInfo | None = None - billing_setup: BillingSetup | None = Field(default=None, alias="billingSetup") - agreement_billing_info: list[AgreementBillingInfo] | None = Field( - default=None, alias="agreementBillingInfo" - ) - info: dict[str, str] | None = Field(default=None, alias="_info") + products: list[ProductItem] | None = None + time_entries: Annotated[list[TimeEntry] | None, Field(alias="timeEntries")] = None class MemberDeactivation(ConnectWiseModel): activity: MemberDeactivationSalesActivity | None = None - service_team: MemberDeactivationServiceTeam | None = Field( - default=None, alias="serviceTeam" - ) - company_team: list[MemberDeactivationCompanyTeam] | None = Field( - default=None, alias="companyTeam" - ) + company_team: Annotated[list[MemberDeactivationCompanyTeam] | None, Field(alias="companyTeam")] = None """ A list of customers for which the member holds a team role """ - workflow_email: MemberDeactivationWorkflow | None = Field( - default=None, alias="workflowEmail" - ) - service_status_workflow: list[MemberDeactivationStatusWorkflow] | None = Field( - default=None, alias="serviceStatusWorkflow" - ) - ticket_template: MemberDeactivationServiceTemplate | None = Field( - default=None, alias="ticketTemplate" - ) - opportunity: MemberDeactivationOpportunity | None = None - sales_team: MemberDeactivationSalesTeam | None = Field( - default=None, alias="salesTeam" - ) - project_manager: MemberDeactivationProjectManager | None = Field( - default=None, alias="projectManager" - ) - project_time_approver: MemberDeactivationProjectManager | None = Field( - default=None, alias="projectTimeApprover" - ) - project_expense_approver: MemberDeactivationProjectManager | None = Field( - default=None, alias="projectExpenseApprover" - ) - knowledge_base_article: MemberDeactivationKnowledgebaseArticle | None = Field( - default=None, alias="knowledgeBaseArticle" - ) - my_company_president: MemberDeactivationMyCompanyPresidentRole | None = Field( - default=None, alias="myCompanyPresident" - ) - my_company_coo: MemberDeactivationMyCompanyCOORole | None = Field( - default=None, alias="myCompanyCOO" - ) - my_company_controller: MemberDeactivationMyCompanyControllerRole | None = Field( - default=None, alias="myCompanyController" - ) - my_company_dispatch: MemberDeactivationMyCompanyDispatchRole | None = Field( - default=None, alias="myCompanyDispatch" - ) - my_company_service_manager: MemberDeactivationMyCompanyServiceManagerRole | None = ( - Field(default=None, alias="myCompanyServiceManager") - ) - my_company_duty_manager_role: MemberDeactivationMyCompanyDutyManagerRole | None = ( - Field(default=None, alias="myCompanyDutyManagerRole") - ) - department_manager: MemberDeactivationDepartmentMananager | None = Field( - default=None, alias="departmentManager" - ) - dispatch_member: MemberDeactivationDispatchMember | None = Field( - default=None, alias="dispatchMember" - ) - service_manager: MemberDeactivationServiceManger | None = Field( - default=None, alias="serviceManager" - ) - duty_manager: MemberDeactivationDutyManager | None = Field( - default=None, alias="dutyManager" - ) - send_from_email_notify: MemberDeactivationSendFromEmailNotify | None = Field( - default=None, alias="sendFromEmailNotify" - ) - delete_open_time_sheets_flag: bool | None = Field( - default=None, alias="deleteOpenTimeSheetsFlag" - ) + delete_open_time_sheets_flag: Annotated[bool | None, Field(alias="deleteOpenTimeSheetsFlag")] = None """ By default, this is set to false If there is any open timesheets, system will return error message @@ -16953,28 +13285,58 @@ class MemberDeactivation(ConnectWiseModel): If user would like to delete member with open timesheets, they can set this boolean to TRUE System will delete member and any associated open timesheets """ + department_manager: Annotated[MemberDeactivationDepartmentMananager | None, Field(alias="departmentManager")] = None + dispatch_member: Annotated[MemberDeactivationDispatchMember | None, Field(alias="dispatchMember")] = None + duty_manager: Annotated[MemberDeactivationDutyManager | None, Field(alias="dutyManager")] = None + knowledge_base_article: Annotated[ + MemberDeactivationKnowledgebaseArticle | None, Field(alias="knowledgeBaseArticle") + ] = None + my_company_coo: Annotated[MemberDeactivationMyCompanyCOORole | None, Field(alias="myCompanyCOO")] = None + my_company_controller: Annotated[ + MemberDeactivationMyCompanyControllerRole | None, Field(alias="myCompanyController") + ] = None + my_company_dispatch: Annotated[ + MemberDeactivationMyCompanyDispatchRole | None, Field(alias="myCompanyDispatch") + ] = None + my_company_duty_manager_role: Annotated[ + MemberDeactivationMyCompanyDutyManagerRole | None, Field(alias="myCompanyDutyManagerRole") + ] = None + my_company_president: Annotated[ + MemberDeactivationMyCompanyPresidentRole | None, Field(alias="myCompanyPresident") + ] = None + my_company_service_manager: Annotated[ + MemberDeactivationMyCompanyServiceManagerRole | None, Field(alias="myCompanyServiceManager") + ] = None + opportunity: MemberDeactivationOpportunity | None = None + project_expense_approver: Annotated[ + MemberDeactivationProjectManager | None, Field(alias="projectExpenseApprover") + ] = None + project_manager: Annotated[MemberDeactivationProjectManager | None, Field(alias="projectManager")] = None + project_time_approver: Annotated[MemberDeactivationProjectManager | None, Field(alias="projectTimeApprover")] = None + sales_team: Annotated[MemberDeactivationSalesTeam | None, Field(alias="salesTeam")] = None + send_from_email_notify: Annotated[ + MemberDeactivationSendFromEmailNotify | None, Field(alias="sendFromEmailNotify") + ] = None + service_manager: Annotated[MemberDeactivationServiceManger | None, Field(alias="serviceManager")] = None + service_status_workflow: Annotated[ + list[MemberDeactivationStatusWorkflow] | None, Field(alias="serviceStatusWorkflow") + ] = None + service_team: Annotated[MemberDeactivationServiceTeam | None, Field(alias="serviceTeam")] = None + ticket_template: Annotated[MemberDeactivationServiceTemplate | None, Field(alias="ticketTemplate")] = None + workflow_email: Annotated[MemberDeactivationWorkflow | None, Field(alias="workflowEmail")] = None class GLExport(ConnectWiseModel): - export_settings: GLExportSettings | None = Field( - default=None, alias="exportSettings" - ) - vendors: list[GLExportVendor] | None = None + adjustment_transactions: Annotated[ + list[GLExportAdjustmentTransaction] | None, Field(alias="adjustmentTransactions") + ] = None customers: list[GLExportCustomer] | None = None - transactions: list[GLExportTransaction] | None = None + expense_bills: Annotated[list[GLExportExpenseBill] | None, Field(alias="expenseBills")] = None expenses: list[GLExportExpense] | None = None - expense_bills: list[GLExportExpenseBill] | None = Field( - default=None, alias="expenseBills" - ) - purchase_transactions: list[GLExportPurchaseTransaction] | None = Field( - default=None, alias="purchaseTransactions" - ) - adjustment_transactions: list[GLExportAdjustmentTransaction] | None = Field( - default=None, alias="adjustmentTransactions" - ) - inventory_transfers: list[GLExportInventoryTransfer] | None = Field( - default=None, alias="inventoryTransfers" - ) - - -Manager.model_rebuild() + export_settings: Annotated[GLExportSettings | None, Field(alias="exportSettings")] = None + inventory_transfers: Annotated[list[GLExportInventoryTransfer] | None, Field(alias="inventoryTransfers")] = None + purchase_transactions: Annotated[ + list[GLExportPurchaseTransaction] | None, Field(alias="purchaseTransactions") + ] = None + transactions: list[GLExportTransaction] | None = None + vendors: list[GLExportVendor] | None = None diff --git a/src/pyconnectwise/responses/paginated_response.py b/src/pyconnectwise/responses/paginated_response.py index 92659d68f..813444435 100644 --- a/src/pyconnectwise/responses/paginated_response.py +++ b/src/pyconnectwise/responses/paginated_response.py @@ -1,12 +1,16 @@ from __future__ import annotations -from pyconnectwise.utils.helpers import parse_link_headers + from typing import TYPE_CHECKING, Generic, TypeVar +from pyconnectwise.utils.helpers import parse_link_headers + if TYPE_CHECKING: from collections.abc import Iterable - from pyconnectwise.types import RequestParams - from requests import Response + from pydantic import BaseModel + from requests import Response + + from pyconnectwise.types import RequestParams TModel = TypeVar("TModel", bound="BaseModel") @@ -79,12 +83,8 @@ def _initialize( # noqa: ANN202 self.params = params if self.parsed_link_headers is not None: # ConnectWise Manage API gives us handy headers to parse for Pagination - self.has_next_page: bool = self.parsed_link_headers.get( - "has_next_page", False - ) - self.has_prev_page: bool = self.parsed_link_headers.get( - "has_prev_page", False - ) + self.has_next_page: bool = self.parsed_link_headers.get("has_next_page", False) + self.has_prev_page: bool = self.parsed_link_headers.get("has_prev_page", False) self.first_page: int = self.parsed_link_headers.get("first_page", None) self.prev_page: int = self.parsed_link_headers.get("prev_page", None) self.next_page: int = self.parsed_link_headers.get("next_page", None) @@ -98,9 +98,7 @@ def _initialize( # noqa: ANN202 self.prev_page = page - 1 if page > 1 else 1 self.next_page = page + 1 self.last_page = 999999 - self.data: list[TModel] = [ - response_model.model_validate(d) for d in response.json() - ] + self.data: list[TModel] = [response_model.model_validate(d) for d in response.json()] self.has_data = self.data and len(self.data) > 0 self.index = 0 @@ -116,9 +114,7 @@ def get_next_page(self) -> PaginatedResponse[TModel]: self.has_data = False return self - next_response = self.endpoint.paginated( - self.next_page, self.page_size, self.params - ) + next_response = self.endpoint.paginated(self.next_page, self.page_size, self.params) self._initialize( next_response.response, next_response.response_model, @@ -141,9 +137,7 @@ def get_previous_page(self) -> PaginatedResponse[TModel]: self.has_data = False return self - prev_response = self.endpoint.paginated( - self.prev_page, self.page_size, self.params - ) + prev_response = self.endpoint.paginated(self.prev_page, self.page_size, self.params) self._initialize( prev_response.response, prev_response.response_model, diff --git a/src/pyconnectwise/types.py b/src/pyconnectwise/types.py index 1f9293ce3..ecbb5d51c 100644 --- a/src/pyconnectwise/types.py +++ b/src/pyconnectwise/types.py @@ -1,5 +1,6 @@ from typing import Literal, TypeAlias -from typing_extensions import TypedDict, NotRequired + +from typing_extensions import NotRequired, TypedDict Literals: TypeAlias = str | int | float | bool JSON: TypeAlias = dict[str, "JSON"] | list["JSON"] | Literals | None @@ -35,11 +36,7 @@ class ConnectWiseAutomateRequestParams(TypedDict): GenericRequestParams: TypeAlias = dict[str, Literals] -RequestParams: TypeAlias = ( - ConnectWiseManageRequestParams - | ConnectWiseAutomateRequestParams - | GenericRequestParams -) +RequestParams: TypeAlias = ConnectWiseManageRequestParams | ConnectWiseAutomateRequestParams | GenericRequestParams PatchRequestData: TypeAlias = list[Patch] RequestData: TypeAlias = JSON | PatchRequestData RequestMethod: TypeAlias = Literal["GET", "POST", "PUT", "PATCH", "DELETE"] diff --git a/src/pyconnectwise/utils/experimental/condition.py b/src/pyconnectwise/utils/experimental/condition.py index 9c28d1049..c944bfa3a 100644 --- a/src/pyconnectwise/utils/experimental/condition.py +++ b/src/pyconnectwise/utils/experimental/condition.py @@ -1,10 +1,11 @@ from __future__ import annotations -from enum import Enum -from datetime import datetime -from typing import Any + import inspect import re -from typing import TypeVar, Generic, TYPE_CHECKING +from datetime import datetime +from enum import Enum +from typing import TYPE_CHECKING, Any, Generic, TypeVar + from pyconnectwise.utils.naming import to_camel_case if TYPE_CHECKING: @@ -35,9 +36,7 @@ def field(self: Condition[T], selector: Callable[[type[T]], Any]) -> Condition[T if m: caller_lines = m.group(1) - field = to_camel_case( - "/".join(caller_lines.replace("(", "").replace(")", "").split(".")[1:]) - ) + field = to_camel_case("/".join(caller_lines.replace("(", "").replace(")", "").split(".")[1:])) finally: del frame @@ -61,7 +60,8 @@ def less_than(self: Condition[T], value: Any) -> Condition[T]: # noqa: ANN401 return self def less_than_or_equals( - self: Condition[T], value: Any # noqa: ANN401 + self: Condition[T], + value: Any, # noqa: ANN401 ) -> Condition[T]: self._condition_string += " <= " self.__add_typed_value_to_string(value, type(value)) @@ -73,7 +73,8 @@ def greater_than(self: Condition[T], value: Any) -> Condition[T]: # noqa: ANN40 return self def greater_than_or_equals( - self: Condition[T], value: Any # noqa: ANN401 + self: Condition[T], + value: Any, # noqa: ANN401 ) -> Condition[T]: self._condition_string += " >= " self.__add_typed_value_to_string(value, type(value)) @@ -100,7 +101,9 @@ def not_(self: Condition[T], value: Any) -> Condition[T]: # noqa: ANN401 return self def __add_typed_value_to_string( # noqa: ANN202 - self: Condition[T], value: Any, type: type # noqa: ANN401, A002 + self: Condition[T], + value: Any, # noqa: ANN401 + type: type, # noqa: A002 ): if type is str: self._condition_string += f'"{value}"' @@ -113,9 +116,7 @@ def __add_typed_value_to_string( # noqa: ANN202 else: self._condition_string += f'"{value}"' - def and_( - self: Condition[T], selector: Callable[[type[T]], Any] | None = None - ) -> Condition[T]: + def and_(self: Condition[T], selector: Callable[[type[T]], Any] | None = None) -> Condition[T]: self._condition_string += " AND " if selector is not None: @@ -128,9 +129,7 @@ def and_( if m: caller_lines = m.group(1) - field = "/".join( - caller_lines.replace("(", "").replace(")", "").split(".")[1:] - ) + field = "/".join(caller_lines.replace("(", "").replace(")", "").split(".")[1:]) finally: del frame @@ -138,9 +137,7 @@ def and_( self._condition_string += field return self - def or_( - self: Condition[T], selector: Callable[[type[T]], Any] | None = None - ) -> Condition[T]: + def or_(self: Condition[T], selector: Callable[[type[T]], Any] | None = None) -> Condition[T]: self._condition_string += " OR " if selector is not None: @@ -153,9 +150,7 @@ def or_( if m: caller_lines = m.group(1) - field = "/".join( - caller_lines.replace("(", "").replace(")", "").split(".")[1:] - ) + field = "/".join(caller_lines.replace("(", "").replace(")", "").split(".")[1:]) finally: del frame @@ -163,9 +158,7 @@ def or_( self._condition_string += field return self - def wrap( - self: Condition[T], condition: Callable[[Condition[T]], Condition[T]] - ) -> Condition[T]: + def wrap(self: Condition[T], condition: Callable[[Condition[T]], Condition[T]]) -> Condition[T]: self._condition_string += f"({condition(Condition[T]())})" return self diff --git a/src/pyconnectwise/utils/experimental/patch_maker.py b/src/pyconnectwise/utils/experimental/patch_maker.py index 46b098ae6..cab354e4c 100644 --- a/src/pyconnectwise/utils/experimental/patch_maker.py +++ b/src/pyconnectwise/utils/experimental/patch_maker.py @@ -1,6 +1,6 @@ +import json from enum import Enum from typing import Any -import json class Patch: diff --git a/src/pyconnectwise/utils/generator/client_gen.py b/src/pyconnectwise/utils/generator/client_gen.py deleted file mode 100644 index b2c445636..000000000 --- a/src/pyconnectwise/utils/generator/client_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -from pyconnectwise.utils.generator.templates import ( - manage_client_template, - automate_client_template, -) -from pyconnectwise.utils.fs import save_py_file -import os - - -def generate_manage_client(client_output_path, endpoints): # noqa: ANN001, ANN201 - imports = [ - f"from pyconnectwise.endpoints.manage.{endpoint} import {endpoint}" - for endpoint in endpoints - ] - endpoint_registrations = [ - {"field_name": endpoint.replace("Endpoint", "").lower(), "class_name": endpoint} - for endpoint in endpoints - ] - client_code = manage_client_template.render( - imports=imports, endpoints=endpoint_registrations - ) - save_py_file( - os.path.join(client_output_path, "manage_client.py"), # noqa: PTH118 - client_code, - ) - - -def generate_automate_client(client_output_path, endpoints): # noqa: ANN001, ANN201 - imports = [ - f"from pyconnectwise.endpoints.automate.{endpoint} import {endpoint}" - for endpoint in endpoints - ] - endpoint_registrations = [ - {"field_name": endpoint.replace("Endpoint", "").lower(), "class_name": endpoint} - for endpoint in endpoints - ] - client_code = automate_client_template.render( - imports=imports, endpoints=endpoint_registrations - ) - save_py_file( - os.path.join(client_output_path, "automate_client.py"), # noqa: PTH118 - client_code, - ) diff --git a/src/pyconnectwise/utils/generator/templates.py b/src/pyconnectwise/utils/generator/templates.py deleted file mode 100644 index ceba94d69..000000000 --- a/src/pyconnectwise/utils/generator/templates.py +++ /dev/null @@ -1,325 +0,0 @@ -from jinja2 import Template - -endpoint_template = Template( - """from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint -from pyconnectwise.responses.paginated_response import PaginatedResponse -from typing import Any -from pyconnectwise.types import JSON, ConnectWiseManageRequestParams, ConnectWiseAutomateRequestParams, PatchRequestData -from pyconnectwise.interfaces import ( - IPaginateable, - IGettable, - IPostable, - IPatchable, - IPuttable, - IDeleteable -) -{%- if additional_imports is defined %} -{%- for additional_import in additional_imports %} -{{ additional_import }} -{%- endfor %} -{%- endif %} - -class {{ endpoint_class }}(ConnectWiseEndpoint{% for interface in interfaces %}, {{ interface.class }}[{% if interface.return_type is not none %}{{interface.return_type}},{%endif%}{% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %}]{% endfor %}{% if pagination_model_class is not none %}, IPaginateable[{{pagination_model_class}}, {% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %}]{% endif %}): - def __init__(self, client, parent_endpoint=None): - ConnectWiseEndpoint.__init__(self, client, "{{ endpoint_path }}", parent_endpoint=parent_endpoint) - {%- for interface in interfaces %} - {{interface.class}}.__init__(self, {{interface.return_type}}) - {%- endfor %} - {%- if pagination_model_class is not none %} - IPaginateable.__init__(self, {{pagination_model_class}}) - {%- endif %} - {% if child_endpoints is defined %} - {%- for child_endpoint in child_endpoints %} - self.{{ child_endpoint.field_name }} = self._register_child_endpoint( - {{ child_endpoint.class_name }}(client, parent_endpoint=self) - ) - {%- endfor %} - {%- endif %} - - {% if has_id_child %} - def id(self, id: int) -> {{ id_child_endpoint_class }}: - \""" - Sets the ID for this endpoint and returns an initialized {{ id_child_endpoint_class }} object to move down the chain. - - Parameters: - id (int): The ID to set. - Returns: - {{ id_child_endpoint_class }}: The initialized {{ id_child_endpoint_class }} object. - \""" - child = {{ id_child_endpoint_class }}(self.client, parent_endpoint=self) - child._id = id - return child - {% endif %} - - {%- if pagination_model_class is not none %} - def paginated(self, page: int, page_size: int, params: {% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %} | None = None) -> PaginatedResponse[{{ pagination_model_class }}]: - \""" - Performs a GET request against the {{ raw_path }} endpoint and returns an initialized PaginatedResponse object. - - Parameters: - page (int): The page number to request. - page_size (int): The number of results to return per page. - params (dict[str, int | str]): The parameters to send in the request query string. - Returns: - PaginatedResponse[{{ pagination_model_class }}]: The initialized PaginatedResponse object. - \""" - if params: - params["page"] = page - params["pageSize"] = page_size - else: - params = { - 'page': page, - 'pageSize': page_size - } - return PaginatedResponse( - super()._make_request( - "GET", - params=params - ), - {{ pagination_model_class }}, - self, - page, - page_size, - params - ) - {% endif %} - - {%- for operation in operations %} - def {{ operation.name }}(self, data: {% if operation.name == "patch" %}PatchRequestData{% else %}JSON | None = None{% endif %}, params: {% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %} | None = None) -> {{ 'None' if operation.void else operation.return_type }}: - \""" - Performs a {{ operation.name.upper() }} request against the {{ raw_path }} endpoint. - - Parameters: - data (dict[str, Any]): The data to send in the request body. - params (dict[str, int | str]): The parameters to send in the request query string. - {%- if not operation.void %} - Returns: - {{ operation.return_type }}: The parsed response data. - {%- endif %} - \""" - - {%- if operation.returns_single %} - return self._parse_one({{operation.return_class}}, super()._make_request("{{ operation.name.upper() }}", data=data, params=params).json()) - {% elif operation.void %} - super()._make_request("{{ operation.name.upper() }}", data=data, params=params) - {% else %} - return self._parse_many({{operation.return_class}}, super()._make_request("{{ operation.name.upper() }}", data=data, params=params).json()) - {% endif %} - {%- endfor %} -""" -) - -manage_client_template = Template( - """import base64 -from pyconnectwise.clients.connectwise_client import ConnectWiseClient -from pyconnectwise.config import Config -{%- if imports is defined %} -{%- for import in imports %} -{{ import }} -{%- endfor %} -{%- endif %} - -class ConnectWiseManageAPIClient(ConnectWiseClient): - \""" - ConnectWise Manage API client. Handles the connection to the ConnectWise Manage API - and the configuration of all the available endpoints. - \""" - def __init__( - self, - company_name: str, - manage_url: str, - client_id: str, - public_key: str, - private_key: str, - codebase: str | None = None, - config: Config | None = None - ): - \""" - Initializes the client with the given credentials and optionally a specific codebase. - If no codebase is given, it tries to get it from the API. - - Parameters: - company_name (str): Name of your company. - manage_url (str): URL of your ConnectWise Manage instance. - client_id (str): Your ConnectWise Manage API Client ID. - public_key (str): Your ConnectWise Manage API Public key. - private_key (str): Your ConnectWise Manage API Private key. - codebase (str, optional): Your ConnectWise Manage Codebase. If not provided, it will be fetched from the API. Defaults to None. - config (Config, optional): Optional additional configuration for API interactions - \""" - self.client_id: str = client_id - self.company_name: str = company_name - self.manage_url: str = manage_url - self.public_key: str = public_key - self.private_key: str = private_key - - if config: - self.config = config - - # Retrieve codebase from the API if not provided - if not codebase: - codebase_request = self._try_get_codebase_from_api( - manage_url=manage_url, - company_name=company_name, - headers=self._get_headers(), - ) - - if codebase_request is None: - # we need to except here - raise Exception("Could not retrieve codebase from API.") - self.codebase: str = codebase_request - - - # Initializing endpoints - {%- for endpoint in endpoints %} - self.{{ endpoint.field_name }} = {{ endpoint.class_name }}(self) - {%- endfor %} - - def _get_url(self) -> str: - \""" - Generates and returns the URL for the ConnectWise Manage API endpoints based on the company url and codebase. - - Returns: - str: API URL. - \""" - return f"https://{self.manage_url}/{self.codebase.strip('/')}/apis/3.0" - - def _try_get_codebase_from_api(self, manage_url: str, company_name: str, headers: dict[str, str]) -> str: - \""" - Tries to retrieve the codebase from the API using the provided company url, company name and headers. - - Parameters: - company_url (str): URL of the company. - company_name (str): Name of the company. - headers (dict[str, str]): Headers to be sent in the request. - - Returns: - str: Codebase string or None if an error occurs. - \""" - url = f"https://{manage_url}/login/companyinfo/{company_name}" - response = self._make_request("GET", url, headers=headers) - return response.json().get("Codebase") - - def _get_auth_string(self) -> str: - \""" - Creates and returns the base64 encoded authorization string required for API requests. - - Returns: - str: Base64 encoded authorization string. - \""" - return "Basic " + base64.b64encode( - bytes( - f"{self.company_name}+{self.public_key}:{self.private_key}", - encoding="utf8", - ) - ).decode("ascii") - - def _get_headers(self) -> dict[str, str]: - \""" - Generates and returns the headers required for making API requests. - - Returns: - dict[str, str]: Dictionary of headers including Content-Type, Client ID, and Authorization. - \""" - headers = { - "Content-Type": "application/json", - "clientId": self.client_id, - "Authorization": self._get_auth_string(), - } - return headers - -""" -) - -automate_client_template = Template( - """import base64 -from pyconnectwise.clients.connectwise_client import ConnectWiseClient -from pyconnectwise.config import Config -from datetime import datetime -{%- if imports is defined %} -{%- for import in imports %} -{{ import }} -{%- endfor %} -{%- endif %} - -class ConnectWiseAutomateAPIClient(ConnectWiseClient): - \""" - ConnectWise Automate API client. Handles the connection to the ConnectWise Automate API - and the configuration of all the available endpoints. - \""" - def __init__( - self, - automate_url: str, - client_id: str, - username: str, - password: str, - config: Config | None = None - ): - \""" - Initializes the client with the given credentials and optionally a specific codebase. - If no codebase is given, it tries to get it from the API. - - Parameters: - automate_url (str): URL of your ConnectWise Automate instance. - client_id (str): Your ConnectWise Automate API Client ID. - username (str): Your ConnectWise Automate API username. - password (str): Your ConnectWise Automate API password. - config (Config, optional): Optional additional configuration for API interactions. - \""" - self.client_id: str = client_id - self.automate_url: str = automate_url - self.username: str = username - self.password: str = password - self.token_expiry_time: datetime = datetime.utcnow() - - if config: - self.config = config - - # Grab first access token - self.access_token: str = self._get_access_token() - - # Initializing endpoints - {%- for endpoint in endpoints %} - self.{{ endpoint.field_name }} = {{ endpoint.class_name }}(self) - {%- endfor %} - - def _get_url(self) -> str: - \""" - Generates and returns the URL for the ConnectWise Automate API endpoints based on the company url and codebase. - Logs in an obtains an access token. - Returns: - str: API URL. - \""" - return f"https://{self.automate_url}/cwa/api/v1" - - def _get_access_token(self) -> str: - \""" - Performs a request to the ConnectWise Automate API to obtain an access token. - \""" - auth_response = self._make_request("POST", f"{self._get_url()}/apitoken", data={"UserName": self.username, "Password": self.password}, headers={"Content-Type": "application/json", "ClientId": self.client_id}) - auth_resp_json = auth_response.json() - token = auth_resp_json["AccessToken"] - self.token_expiry_time = datetime.fromisoformat(auth_resp_json["ExpirationDate"]) - return token - - def _refresh_access_token_if_necessary(self): - if datetime.utcnow() > self.token_expiry_time: - self.access_token = self._get_access_token() - - def _get_headers(self) -> dict[str, str]: - \""" - Generates and returns the headers required for making API requests. The access token is refreshed if necessary before returning. - - Returns: - dict[str, str]: Dictionary of headers including Content-Type, Client ID, and Authorization. - \""" - self._refresh_access_token_if_necessary() - headers = { - "Content-Type": "application/json", - "clientId": self.client_id, - "Authorization": f"Bearer {self.access_token}", - } - return headers - -""" -) diff --git a/src/pyconnectwise/utils/helpers.py b/src/pyconnectwise/utils/helpers.py index 4fc4644df..97123a529 100644 --- a/src/pyconnectwise/utils/helpers.py +++ b/src/pyconnectwise/utils/helpers.py @@ -1,6 +1,7 @@ -from datetime import datetime import re +from datetime import datetime from typing import Any + from requests.structures import CaseInsensitiveDict diff --git a/src/pyconnectwise/utils/generator/__init__.py b/src/pyconnectwise_generator/__init__.py similarity index 100% rename from src/pyconnectwise/utils/generator/__init__.py rename to src/pyconnectwise_generator/__init__.py diff --git a/src/pyconnectwise_generator/__main__.py b/src/pyconnectwise_generator/__main__.py new file mode 100644 index 000000000..df692ca85 --- /dev/null +++ b/src/pyconnectwise_generator/__main__.py @@ -0,0 +1,62 @@ +import logging +from pathlib import Path + +import typer + +from pyconnectwise_generator.normalize_schema_refs import normalize_json_schema + +from .models import generate_models +from .parser import ( + generate_automate, + generate_manage, + load_schema, + merge_automate_specs, +) + +app = typer.Typer() + + +@app.command() +def generate_manage_code( + schema_path: str, + *, + gen_models: bool = True, + gen_endpoints: bool = True, + endpoint_output_path: str = "src/pyconnectwise/endpoints/manage", + model_output_path: str = "src/pyconnectwise/models/manage", + client_output_path: str = "src/pyconnectwise/clients", +) -> None: + schema = load_schema(schema_path) + schema = normalize_json_schema(schema) + if gen_models: + logging.info("Generating models") + generate_models(schema, Path(model_output_path) / "__init__.py") + if gen_endpoints: + generate_manage(endpoint_output_path, model_output_path, client_output_path, schema) + + print("After generating run `ruff src/pyconnectwise/models/manage --fix --unsafe-fixes`") + + +@app.command() +def generate_automate_code( # noqa: ANN201 + schema_folder_path: str, + *, + gen_models: bool = True, + gen_endpoints: bool = True, + endpoint_output_path: str = "src/pyconnectwise/endpoints/automate", + model_output_path: str = "src/pyconnectwise/models/automate", + client_output_path: str = "src/pyconnectwise/clients", +): + schema = merge_automate_specs(schema_folder_path) + # schema = load_schema(schema_path) + + # Does this need normalize_json_schema too?? + if gen_models: + generate_models(schema, Path(model_output_path) / "__init__.py") + if gen_endpoints: + generate_automate(endpoint_output_path, model_output_path, client_output_path, schema) + + print("After generating run `ruff src/pyconnectwise/models/automate --fix --unsafe-fixes`") + + +app() diff --git a/src/pyconnectwise_generator/client_gen.py b/src/pyconnectwise_generator/client_gen.py new file mode 100644 index 000000000..76c9ee1d1 --- /dev/null +++ b/src/pyconnectwise_generator/client_gen.py @@ -0,0 +1,44 @@ +import os +from typing import Literal + +from pyconnectwise_generator.templates import ( + automate_client_template, + manage_client_template, +) +from pyconnectwise_generator.utils.fs import save_py_file + + +def create_null_client(client_output_path: str, client_type: Literal["automate", "manage"]) -> None: + """Create an empty client to avoid import errors in case the last generation didn't work right""" + client_code = f"""class ConnectWise{client_type[0].upper()}{client_type[1:]}APIClient: + pass + """ + + save_py_file( + os.path.join(client_output_path, f"{client_type}_client.py"), # noqa: PTH118 + client_code, + ) + + +def generate_manage_client(client_output_path: str, endpoints: list[str]) -> None: + imports = [f"from pyconnectwise.endpoints.manage.{endpoint} import {endpoint}" for endpoint in endpoints] + endpoint_registrations = [ + {"field_name": endpoint.replace("Endpoint", "").lower(), "class_name": endpoint} for endpoint in endpoints + ] + client_code = manage_client_template.render(imports=imports, endpoints=endpoint_registrations) + save_py_file( + os.path.join(client_output_path, "manage_client.py"), # noqa: PTH118 + client_code, + ) + + +def generate_automate_client(client_output_path: str, endpoints: list[str]) -> None: + imports = [f"from pyconnectwise.endpoints.automate.{endpoint} import {endpoint}" for endpoint in endpoints] + endpoint_registrations = [ + {"field_name": endpoint.replace("Endpoint", "").lower(), "class_name": endpoint} for endpoint in endpoints + ] + client_code = automate_client_template.render(imports=imports, endpoints=endpoint_registrations) + save_py_file( + os.path.join(client_output_path, "automate_client.py"), # noqa: PTH118 + client_code, + ) diff --git a/src/pyconnectwise/utils/generator/endpoint_gen.py b/src/pyconnectwise_generator/endpoint_gen.py similarity index 67% rename from src/pyconnectwise/utils/generator/endpoint_gen.py rename to src/pyconnectwise_generator/endpoint_gen.py index ac407d90b..ff8f3bea3 100644 --- a/src/pyconnectwise/utils/generator/endpoint_gen.py +++ b/src/pyconnectwise_generator/endpoint_gen.py @@ -1,15 +1,25 @@ # endpoint_gen.py in src/pyconnectwise/utils/generator +import importlib +import logging import os -from pyconnectwise.utils.fs import save_py_file -from pyconnectwise.utils.generator.templates import ( - endpoint_template, -) -from pyconnectwise.utils.generator.path_formatting import ( + +from pyconnectwise.utils.naming import ensure_not_reserved, to_snake_case +from pyconnectwise_generator.path_formatting import ( format_endpoint_path, get_endpoint_class_name_from_path, normalize_path_parameters, ) -from pyconnectwise.utils.naming import to_snake_case, ensure_not_reserved +from pyconnectwise_generator.templates import ( + endpoint_template, +) +from pyconnectwise_generator.utils.fs import save_py_file + + +class ModelNotFoundError(Exception): + def __init__(self, module_name: str, model_name: str) -> None: + self.module_name = module_name + self.model_name = model_name + super().__init__(f"Model {model_name} not found in module {module_name}") def generate_endpoint( # noqa: ANN201, C901 @@ -18,22 +28,22 @@ def generate_endpoint( # noqa: ANN201, C901 path: str, path_info: dict, relationships: dict, + *, is_manage: bool, ): formatted_path = format_endpoint_path(path) endpoint_class_name = get_endpoint_class_name_from_path(formatted_path) model_class_name = endpoint_class_name.replace("Endpoint", "Model") - model_module_name = model_class_name.lower() + models_module_name = model_class_name.lower() endpoint_import_directory = endpoint_output_directory.split("/")[-1] model_import_directory = model_output_directory.split("/")[-1] + models_module_name = f"pyconnectwise.models.{model_import_directory}" operations = list(path_info.keys()) - child_endpoints = list( - {format_endpoint_path(child) for child in relationships.get(path, [])} - ) + child_endpoints = list({format_endpoint_path(child) for child in relationships.get(path, [])}) - print(f"Generating {endpoint_class_name}") + logging.info(f"Generating {endpoint_class_name} from {path}") id_child_endpoint_class_name = None has_id_child = False @@ -44,9 +54,7 @@ def generate_endpoint( # noqa: ANN201, C901 continue if "Id" in child_endpoint: - id_child_endpoint_class_name = endpoint_class_name.replace( - "Endpoint", "IdEndpoint" - ) + id_child_endpoint_class_name = endpoint_class_name.replace("Endpoint", "IdEndpoint") if endpoint_class_name == id_child_endpoint_class_name: continue @@ -56,20 +64,14 @@ def generate_endpoint( # noqa: ANN201, C901 has_id_child = True else: child_endpoint_path = child_endpoint - child_endpoint_class_name = get_endpoint_class_name_from_path( - child_endpoint - ) + child_endpoint_class_name = get_endpoint_class_name_from_path(child_endpoint) if endpoint_class_name == child_endpoint_class_name: continue child_endpoint_definitions.append( { - "field_name": ensure_not_reserved( - to_snake_case(child_endpoint.split("/")[-1]) - ), - "class_name": endpoint_class_name.replace( - "Endpoint", child_endpoint_class_name - ), + "field_name": ensure_not_reserved(to_snake_case(child_endpoint.split("/")[-1])), + "class_name": endpoint_class_name.replace("Endpoint", child_endpoint_class_name), "path": child_endpoint_path.split("/")[-1], } ) @@ -77,16 +79,16 @@ def generate_endpoint( # noqa: ANN201, C901 f"from pyconnectwise.endpoints.{endpoint_import_directory}.{endpoint_class_name.replace('Endpoint', child_endpoint_class_name)} import {endpoint_class_name.replace('Endpoint', child_endpoint_class_name)}" ) + # sort child_endpoint_definitions by field_name so they always appear in the same order in the generated file + child_endpoint_definitions.sort(key=lambda x: x["field_name"]) + imported_models = [] op_definitions = [] interfaces = [] pagination_model_class = None for operation in operations: - print(f" Processing OP: {operation}") - if ( - path_info.get(operation) is None - or path_info[operation].get("responses") is None - ): + logging.info(f" Processing OP: {operation}") + if path_info.get(operation) is None or path_info[operation].get("responses") is None: continue operation_responses = path_info[operation]["responses"] operation_params = [] @@ -108,8 +110,8 @@ def generate_endpoint( # noqa: ANN201, C901 else: resp_content = response.get("content") schema_object = resp_content.get(next(iter(resp_content))).get("schema") - schema_ref = None - is_array = False + schema_ref: str | None = None + is_array: bool = False if schema_object.get("type") == "array": is_array = True @@ -124,27 +126,31 @@ def generate_endpoint( # noqa: ANN201, C901 schema_ref = schema_object.get("$ref") if schema_ref: + if not isinstance(schema_ref, str): + raise TypeError(f"schema_ref is not a string: {schema_ref}") # noqa: TRY003 model_name = schema_ref.split("/")[-1] - split = model_name.split(".") - if len(split) >= 2: - model_name = split[0] + split[-1] - else: - model_name = "".join(model_name.split(".")) + + model_name_split = model_name.split(".") + if len(model_name_split) >= 2: + model_name = model_name_split[0] + model_name_split[-1] + return_type = model_name for param in operation_params: param_name = param.get("name") - if param_name is not None: # noqa: SIM102 - if "page" in param_name: - pagination_model_class = model_name + if param_name is not None and "page" in param_name: + pagination_model_class = model_name if is_array: return_type = f"list[{model_name}]" if model_name not in imported_models: - additional_imports.append( - f"from pyconnectwise.models.{model_import_directory} import {model_name}" - ) + # Check if the model can be be found, otherwise bail so we don't add imports that won't work. + if not hasattr(importlib.import_module(models_module_name), model_name): + logging.error(f"Class {model_name} does not exist in module {models_module_name}") + raise ModelNotFoundError(models_module_name, model_name) + + additional_imports.append(f"from {models_module_name} import {model_name}") imported_models.append(model_name) op_definitions.append( @@ -164,24 +170,18 @@ def generate_endpoint( # noqa: ANN201, C901 } ) elif operation.lower() == "post": - interfaces.append( - {"class": "IPostable", "return_type": return_type} - ) + interfaces.append({"class": "IPostable", "return_type": return_type}) elif operation.lower() == "patch": - interfaces.append( - {"class": "IPatchable", "return_type": return_type} - ) + interfaces.append({"class": "IPatchable", "return_type": return_type}) elif operation.lower() == "put": - interfaces.append( - {"class": "IPuttable", "return_type": return_type} - ) + interfaces.append({"class": "IPuttable", "return_type": return_type}) elif operation.lower() == "delete": interfaces.append({"class": "IDeleteable", "return_type": None}) endpoint_code = endpoint_template.render( endpoint_class=endpoint_class_name, model_class=model_class_name, - model_module=model_module_name, + model_module=models_module_name, pagination_model_class=pagination_model_class, endpoint_path=normalize_path_parameters(path.split("/")[-1]).rstrip("/"), operations=op_definitions, diff --git a/src/pyconnectwise/utils/generator/model_postprocessor.py b/src/pyconnectwise_generator/model_postprocessor.py similarity index 90% rename from src/pyconnectwise/utils/generator/model_postprocessor.py rename to src/pyconnectwise_generator/model_postprocessor.py index 9aedcda74..d542de8b4 100644 --- a/src/pyconnectwise/utils/generator/model_postprocessor.py +++ b/src/pyconnectwise_generator/model_postprocessor.py @@ -1,8 +1,10 @@ -import os import ast +import os +import re from ast import parse +from pathlib import Path + from astunparse import unparse -import re def move_imports_to_bottom(filename): # noqa: ANN001, ANN201 @@ -14,8 +16,7 @@ def move_imports_to_bottom(filename): # noqa: ANN001, ANN201 "__future__", "pyconnectwise.models.base.connectwise_model", ] - with open(filename) as file: # noqa: PTH123 - source_code = file.read() + source_code = Path(filename).read_text() module = parse(source_code) body = module.body @@ -23,7 +24,7 @@ def move_imports_to_bottom(filename): # noqa: ANN001, ANN201 # Check each statement in the body of the module for i, statement in reversed(list(enumerate(body))): # If the statement is an import - if isinstance(statement, (ast.Import, ast.ImportFrom)): # noqa: SIM102 + if isinstance(statement, ast.Import | ast.ImportFrom): # noqa: SIM102 # If the imported module is not in the list of exceptions if not any(ex in unparse(statement) for ex in exceptions): # Remove the import statement from its current position and append it to the end of the body diff --git a/src/pyconnectwise_generator/models.py b/src/pyconnectwise_generator/models.py new file mode 100644 index 000000000..b7d7be9fb --- /dev/null +++ b/src/pyconnectwise_generator/models.py @@ -0,0 +1,24 @@ +import json +import tempfile +from pathlib import Path +from typing import Any + +# Use main instead of generate() so that it loads pyproject.toml +from datamodel_code_generator.__main__ import Exit, main + + +def generate_models(schema: dict[str, Any], model_output_dir: Path) -> None: + # datamodel-gen needs a file... + with tempfile.NamedTemporaryFile("w") as schema_file: + schema_file.write(json.dumps(schema)) + + e = main( + [ + "--input", + str(schema_file.name), + "--output", + str(model_output_dir), + ] + ) + if e != Exit.OK: + raise Exception("Model generation failed") # noqa: TRY002, TRY003 diff --git a/src/pyconnectwise/utils/generator/normalize_schema_refs.py b/src/pyconnectwise_generator/normalize_schema_refs.py similarity index 75% rename from src/pyconnectwise/utils/generator/normalize_schema_refs.py rename to src/pyconnectwise_generator/normalize_schema_refs.py index 3dedf67a6..1a574700a 100644 --- a/src/pyconnectwise/utils/generator/normalize_schema_refs.py +++ b/src/pyconnectwise_generator/normalize_schema_refs.py @@ -1,5 +1,7 @@ -import json import argparse +import json +from pathlib import Path +from typing import Any def normalize_schema_name(schema_name): # noqa: ANN001, ANN201 @@ -19,9 +21,7 @@ def update_schema_references(data, name_mapping): # noqa: ANN001, ANN201 ref_schema_name = value.split("/")[-1] # Update the reference if the schema name is in name_mapping if ref_schema_name in name_mapping: - data[key] = value.replace( - ref_schema_name, name_mapping[ref_schema_name] - ) + data[key] = value.replace(ref_schema_name, name_mapping[ref_schema_name]) else: update_schema_references(value, name_mapping) elif isinstance(data, list): @@ -29,18 +29,7 @@ def update_schema_references(data, name_mapping): # noqa: ANN001, ANN201 update_schema_references(item, name_mapping) -def main(): # noqa: ANN201 - # Parsing command-line arguments - parser = argparse.ArgumentParser(description="Normalize OpenAPI JSON schema names.") - parser.add_argument( - "--input", type=str, required=True, help="Path to the OpenAPI JSON file." - ) - args = parser.parse_args() - - # Loading the JSON file - with open(args.input) as file: # noqa: PTH123 - data = json.load(file) - +def normalize_json_schema(data: dict[str, Any]) -> dict[str, Any]: # Normalizing schema names and storing the old-new name mapping name_mapping = {} schemas = data.get("components", {}).get("schemas", {}) @@ -51,10 +40,25 @@ def main(): # noqa: ANN201 # Updating all path references update_schema_references(data, name_mapping) + return data + + +def main(): # noqa: ANN201 + # Parsing command-line arguments + parser = argparse.ArgumentParser(description="Normalize OpenAPI JSON schema names.") + parser.add_argument("--input", type=str, required=True, help="Path to the OpenAPI JSON file.") + args = parser.parse_args() + + infile = Path(args.input).resolve(strict=True) + outfile = infile.with_suffix(".normalized.json") + + # Loading the JSON file + data = json.loads(infile.read_bytes()) + + data = normalize_json_schema(data) # Writing the updated JSON back to the file - with open(args.input, "w") as file: # noqa: PTH123 - json.dump(data, file, indent=4) + outfile.write_text(json.dumps(data, indent=4)) if __name__ == "__main__": diff --git a/src/pyconnectwise/utils/generator/parser.py b/src/pyconnectwise_generator/parser.py similarity index 79% rename from src/pyconnectwise/utils/generator/parser.py rename to src/pyconnectwise_generator/parser.py index 181b10bcb..7a0eff048 100644 --- a/src/pyconnectwise/utils/generator/parser.py +++ b/src/pyconnectwise_generator/parser.py @@ -1,17 +1,15 @@ import glob import json from collections import defaultdict +from pathlib import Path -from .client_gen import generate_automate_client, generate_manage_client +from .client_gen import create_null_client, generate_automate_client, generate_manage_client from .endpoint_gen import generate_endpoint, normalize_path_parameters def capitalize_path(path): # noqa: ANN001, ANN201 segments = path.split("/") - segments = [ - "{" + segment[1:] if segment.startswith("{") else segment.title() - for segment in segments - ] + segments = ["{" + segment[1:] if segment.startswith("{") else segment.title() for segment in segments] return "/".join(segments) @@ -37,12 +35,8 @@ def merge_automate_specs(folder_path): # noqa: ANN001, ANN201 # Merge components if "components" in spec: if "requestBodies" in spec["components"]: - for req_body, req_body_content in spec["components"][ - "requestBodies" - ].items(): - merged_spec["components"]["requestBodies"][ - req_body - ] = req_body_content + for req_body, req_body_content in spec["components"]["requestBodies"].items(): + merged_spec["components"]["requestBodies"][req_body] = req_body_content if "schemas" in spec["components"]: for schema, schema_content in spec["components"]["schemas"].items(): @@ -52,37 +46,8 @@ def merge_automate_specs(folder_path): # noqa: ANN001, ANN201 return merged_spec -def load_schema(filename): # noqa: ANN001, ANN201 - with open(filename) as f: # noqa: PTH123 - return json.load(f) - - -def generate_manage_code( # noqa: ANN201 - schema_path: str, - endpoint_output_path: str, - model_output_path: str, - client_output_path: str, -): - schema = load_schema(schema_path) - _generate_manage( - endpoint_output_path, model_output_path, client_output_path, schema - ) - pass - - -def generate_automate_code( # noqa: ANN201 - schema_folder_path: str, - endpoint_output_path: str, - model_output_path: str, - client_output_path: str, -): - schema = merge_automate_specs(schema_folder_path) - # schema = load_schema(schema_path) - # - _generate_automate( - endpoint_output_path, model_output_path, client_output_path, schema - ) - pass +def load_schema(filename: str): # noqa: ANN201 + return json.loads(Path(filename).read_bytes()) def _pre_process_schema(schema: dict) -> list[str]: @@ -121,18 +86,34 @@ def _parse_relationships( return dict(relationships), dict(top_level_endpoints) -def _generate_manage( # noqa: ANN202 +# Malformed endpoints found in 2022.1 and 2022.2 schemas that generate invalid +# code. +# +# If these actually work in the API, then someone should probably fix this part +# of the generation... +MALFORMED_MANAGE_ENDPOINTS = { + "/system/members/{memberIdentifier:regex(^(types. |(", + "/system/info/members/{memberIdentifier:regex(^(types. |(", +} + + +def generate_manage( endpoint_output_path: str, model_output_path: str, client_output_path: str, schema: dict, -): +) -> None: + create_null_client(client_output_path, "manage") schema = _pre_process_schema(schema) relationships, top_level_endpoints = _parse_relationships(schema["paths"]) client_top_level_endpoints = [] for endpoint in relationships: path = f"{endpoint}" path_info = {} + + if path in MALFORMED_MANAGE_ENDPOINTS: + continue + if schema["paths"].get(path) is not None: path_info = dict(schema["paths"][path].items()) generate_endpoint( @@ -141,7 +122,7 @@ def _generate_manage( # noqa: ANN202 path, path_info, relationships, - True, + is_manage=True, ) for endpoint in top_level_endpoints: @@ -155,19 +136,20 @@ def _generate_manage( # noqa: ANN202 path, path_info, relationships, - True, + is_manage=True, ) client_top_level_endpoints.append(endpoint_class) generate_manage_client(client_output_path, client_top_level_endpoints) -def _generate_automate( # noqa: ANN202 +def generate_automate( endpoint_output_path: str, model_output_path: str, client_output_path: str, schema: dict, -): +) -> None: + create_null_client(client_output_path, "automate") schema = _pre_process_schema(schema) relationships, top_level_endpoints = _parse_relationships(schema["paths"]) client_top_level_endpoints = [] @@ -182,7 +164,7 @@ def _generate_automate( # noqa: ANN202 path, path_info, relationships, - False, + is_manage=False, ) for endpoint in top_level_endpoints: @@ -197,7 +179,7 @@ def _generate_automate( # noqa: ANN202 path, path_info, relationships, - False, + is_manage=False, ) client_top_level_endpoints.append(endpoint_class) diff --git a/src/pyconnectwise/utils/generator/path_formatting.py b/src/pyconnectwise_generator/path_formatting.py similarity index 94% rename from src/pyconnectwise/utils/generator/path_formatting.py rename to src/pyconnectwise_generator/path_formatting.py index 3a1d2376a..a8c37685d 100644 --- a/src/pyconnectwise/utils/generator/path_formatting.py +++ b/src/pyconnectwise_generator/path_formatting.py @@ -1,4 +1,5 @@ import re + from pyconnectwise.utils.naming import to_title_case_preserve_case @@ -71,7 +72,5 @@ def get_endpoint_class_name_from_path(endpoint_path: str) -> str: str: Formatted class name. """ words = endpoint_path.split("/") - title_cased_words = map( - to_title_case_preserve_case, [word.lower() for word in words] - ) + title_cased_words = map(to_title_case_preserve_case, [word.lower() for word in words]) return "".join(title_cased_words) + "Endpoint" diff --git a/src/pyconnectwise_generator/templates.py b/src/pyconnectwise_generator/templates.py new file mode 100644 index 000000000..37b8922d0 --- /dev/null +++ b/src/pyconnectwise_generator/templates.py @@ -0,0 +1,9 @@ +from pathlib import Path + +from jinja2 import Template + +template_dir = Path(__file__).parent / "templates" + +endpoint_template = Template((template_dir / "endpoint_template.py.jinja2").read_text()) +manage_client_template = Template((template_dir / "manage_client_template.py.jinja2").read_text()) +automate_client_template = Template((template_dir / "automate_client_template.py.jinja2").read_text()) diff --git a/src/pyconnectwise_generator/templates/automate_client_template.py.jinja2 b/src/pyconnectwise_generator/templates/automate_client_template.py.jinja2 new file mode 100644 index 000000000..7f854d448 --- /dev/null +++ b/src/pyconnectwise_generator/templates/automate_client_template.py.jinja2 @@ -0,0 +1,97 @@ +from datetime import UTC, datetime +import typing + +from pyconnectwise.clients.connectwise_client import ConnectWiseClient +from pyconnectwise.config import Config + +if typing.TYPE_CHECKING: + {%- if imports is defined %} + {%- for import in imports %} + {{ import }} + {%- endfor %} + {%- endif %} + + +class ConnectWiseAutomateAPIClient(ConnectWiseClient): + """ + ConnectWise Automate API client. Handles the connection to the ConnectWise Automate API + and the configuration of all the available endpoints. + """ + def __init__( + self, + automate_url: str, + client_id: str, + username: str, + password: str, + config: Config | None = None + ): + """ + Initializes the client with the given credentials and optionally a specific codebase. + If no codebase is given, it tries to get it from the API. + + Parameters: + automate_url (str): URL of your ConnectWise Automate instance. + client_id (str): Your ConnectWise Automate API Client ID. + username (str): Your ConnectWise Automate API username. + password (str): Your ConnectWise Automate API password. + config (Config, optional): Optional additional configuration for API interactions. + """ + self.client_id: str = client_id + self.automate_url: str = automate_url + self.username: str = username + self.password: str = password + self.token_expiry_time: datetime = datetime.utcnow() + + if config: + self.config = config + + # Grab first access token + self.access_token: str = self._get_access_token() + + # Initializing endpoints + {%- for endpoint in endpoints %} + @property + def {{ endpoint.field_name }}(self) -> "{{ endpoint.class_name }}": + from pyconnectwise.endpoints.manage.{{ endpoint.class_name }} import {{ endpoint.class_name }} + + return {{ endpoint.class_name }}(self) + + {%- endfor %} + + def _get_url(self) -> str: + """ + Generates and returns the URL for the ConnectWise Automate API endpoints based on the company url and codebase. + Logs in an obtains an access token. + Returns: + str: API URL. + """ + return f"https://{self.automate_url}/cwa/api/v1" + + def _get_access_token(self) -> str: + """ + Performs a request to the ConnectWise Automate API to obtain an access token. + """ + auth_response = self._make_request("POST", f"{self._get_url()}/apitoken", data={"UserName": self.username, "Password": self.password}, headers={"Content-Type": "application/json", "ClientId": self.client_id}) + auth_resp_json = auth_response.json() + token = auth_resp_json["AccessToken"] + self.token_expiry_time = datetime.fromisoformat(auth_resp_json["ExpirationDate"]) + return token + + def _refresh_access_token_if_necessary(self): + if datetime.utcnow() > self.token_expiry_time: + self.access_token = self._get_access_token() + + def _get_headers(self) -> dict[str, str]: + """ + Generates and returns the headers required for making API requests. The access token is refreshed if necessary before returning. + + Returns: + dict[str, str]: Dictionary of headers including Content-Type, Client ID, and Authorization. + """ + self._refresh_access_token_if_necessary() + headers = { + "Content-Type": "application/json", + "clientId": self.client_id, + "Authorization": f"Bearer {self.access_token}", + } + return headers diff --git a/src/pyconnectwise_generator/templates/endpoint_template.py.jinja2 b/src/pyconnectwise_generator/templates/endpoint_template.py.jinja2 new file mode 100644 index 000000000..9321bdef3 --- /dev/null +++ b/src/pyconnectwise_generator/templates/endpoint_template.py.jinja2 @@ -0,0 +1,115 @@ +from typing import Any, TYPE_CHECKING + +from pyconnectwise.endpoints.base.connectwise_endpoint import ConnectWiseEndpoint +from pyconnectwise.interfaces import ( + IPaginateable, + IGettable, + IPostable, + IPatchable, + IPuttable, + IDeleteable +) +from pyconnectwise.responses.paginated_response import PaginatedResponse +from pyconnectwise.types import ( + JSON, + ConnectWiseManageRequestParams, + ConnectWiseAutomateRequestParams, + PatchRequestData, +) +{%- if additional_imports is defined %} +{%- for additional_import in additional_imports %} +{{ additional_import }} +{%- endfor %} +{%- endif %} + +if TYPE_CHECKING: + from pyconnectwise.clients.connectwise_client import ConnectWiseClient + + +class {{ endpoint_class }}(ConnectWiseEndpoint{% for interface in interfaces %}, {{ interface.class }}[{% if interface.return_type is not none %}{{interface.return_type}},{%endif%}{% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %}]{% endfor %}{% if pagination_model_class is not none %}, IPaginateable[{{pagination_model_class}}, {% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %}]{% endif %}): + def __init__(self, client:"ConnectWiseClient", parent_endpoint:ConnectWiseEndpoint=None) -> None: + ConnectWiseEndpoint.__init__(self, client, "{{ endpoint_path }}", parent_endpoint=parent_endpoint) + {%- for interface in interfaces %} + {{interface.class}}.__init__(self, {{interface.return_type}}) + {%- endfor %} + {%- if pagination_model_class is not none %} + IPaginateable.__init__(self, {{pagination_model_class}}) + {%- endif %} + {% if child_endpoints is defined %} + {%- for child_endpoint in child_endpoints %} + self.{{ child_endpoint.field_name }} = self._register_child_endpoint( + {{ child_endpoint.class_name }}(client, parent_endpoint=self) + ) + {%- endfor %} + {%- endif %} + + {% if has_id_child %} + def id(self, _id: int) -> {{ id_child_endpoint_class }}: # noqa: A002 + """ + Sets the ID for this endpoint and returns an initialized {{ id_child_endpoint_class }} object to move down the chain. + + Parameters: + _id (int): The ID to set. + Returns: + {{ id_child_endpoint_class }}: The initialized {{ id_child_endpoint_class }} object. + """ + child = {{ id_child_endpoint_class }}(self.client, parent_endpoint=self) + child._id = _id + return child + {% endif %} + + {%- if pagination_model_class is not none %} + def paginated(self, page: int, page_size: int, params: {% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %} | None = None) -> PaginatedResponse[{{ pagination_model_class }}]: + """ + Performs a GET request against the {{ raw_path }} endpoint and returns an initialized PaginatedResponse object. + + Parameters: + page (int): The page number to request. + page_size (int): The number of results to return per page. + params (dict[str, int | str]): The parameters to send in the request query string. + Returns: + PaginatedResponse[{{ pagination_model_class }}]: The initialized PaginatedResponse object. + """ + if params: + params["page"] = page + params["pageSize"] = page_size + else: + params = { + 'page': page, + 'pageSize': page_size + } + return PaginatedResponse( + super()._make_request( + "GET", + params=params + ), + {{ pagination_model_class }}, + self, + page, + page_size, + params + ) + {% endif %} + + {%- for operation in operations %} + def {{ operation.name }}(self, data: {% if operation.name == "patch" %}PatchRequestData{% else %}JSON | None = None{% endif %}, params: {% if is_manage %}ConnectWiseManageRequestParams{% else %}ConnectWiseAutomateRequestParams{% endif %} | None = None) -> {{ 'None' if operation.void else operation.return_type }}: + """ + Performs a {{ operation.name.upper() }} request against the {{ raw_path }} endpoint. + + Parameters: + data (dict[str, Any]): The data to send in the request body. + params (dict[str, int | str]): The parameters to send in the request query string. + {%- if not operation.void %} + Returns: + {{ operation.return_type }}: The parsed response data. + {%- endif %} + """ + + {%- if operation.returns_single %} + return self._parse_one({{operation.return_class}}, super()._make_request("{{ operation.name.upper() }}", data=data, params=params).json()) + {% elif operation.void %} + super()._make_request("{{ operation.name.upper() }}", data=data, params=params) + {% else %} + return self._parse_many({{operation.return_class}}, super()._make_request("{{ operation.name.upper() }}", data=data, params=params).json()) + {% endif %} + {%- endfor %} diff --git a/src/pyconnectwise_generator/templates/manage_client_template.py.jinja2 b/src/pyconnectwise_generator/templates/manage_client_template.py.jinja2 new file mode 100644 index 000000000..9eab02da1 --- /dev/null +++ b/src/pyconnectwise_generator/templates/manage_client_template.py.jinja2 @@ -0,0 +1,133 @@ +import base64 +import typing + +from pyconnectwise.clients.connectwise_client import ConnectWiseClient +from pyconnectwise.config import Config + +if typing.TYPE_CHECKING: + {%- if imports is defined %} + {%- for import in imports %} + {{ import }} + {%- endfor %} + {%- endif %} + + +class ManageCodebaseError(Exception): + def __init__(self) -> None: + super().__init__("Could not retrieve codebase from API.") + + +class ConnectWiseManageAPIClient(ConnectWiseClient): + """ + ConnectWise Manage API client. Handles the connection to the ConnectWise Manage API + and the configuration of all the available endpoints. + """ + def __init__( + self, + company_name: str, + manage_url: str, + client_id: str, + public_key: str, + private_key: str, + codebase: str | None = None, + config: Config | None = None + ) -> None: + """ + Initializes the client with the given credentials and optionally a specific codebase. + If no codebase is given, it tries to get it from the API. + + Parameters: + company_name (str): Name of your company. + manage_url (str): URL of your ConnectWise Manage instance. + client_id (str): Your ConnectWise Manage API Client ID. + public_key (str): Your ConnectWise Manage API Public key. + private_key (str): Your ConnectWise Manage API Private key. + codebase (str, optional): Your ConnectWise Manage Codebase. If not provided, it will be fetched from the API. Defaults to None. + config (Config, optional): Optional additional configuration for API interactions + """ + self.client_id: str = client_id + self.company_name: str = company_name + self.manage_url: str = manage_url + self.public_key: str = public_key + self.private_key: str = private_key + + if config: + self.config = config + + # Retrieve codebase from the API if not provided + if not codebase: + codebase_request = self._try_get_codebase_from_api( + manage_url=manage_url, + company_name=company_name, + headers=self._get_headers(), + ) + + if codebase_request is None: + # we need to except here + raise ManageCodebaseError() + self.codebase: str = codebase_request + + + # Initializing endpoints + {%- for endpoint in endpoints %} + @property + def {{ endpoint.field_name }}(self) -> "{{ endpoint.class_name }}": + from pyconnectwise.endpoints.manage.{{ endpoint.class_name }} import {{ endpoint.class_name }} + + return {{ endpoint.class_name }}(self) + + {%- endfor %} + + def _get_url(self) -> str: + """ + Generates and returns the URL for the ConnectWise Manage API endpoints based on the company url and codebase. + + Returns: + str: API URL. + """ + return f"https://{self.manage_url}/{self.codebase.strip('/')}/apis/3.0" + + def _try_get_codebase_from_api( + self, manage_url: str, company_name: str, headers: dict[str, str] + ) -> str: + """ + Tries to retrieve the codebase from the API using the provided company url, company name and headers. + + Parameters: + company_url (str): URL of the company. + company_name (str): Name of the company. + headers (dict[str, str]): Headers to be sent in the request. + + Returns: + str: Codebase string or None if an error occurs. + """ + url = f"https://{manage_url}/login/companyinfo/{company_name}" + response = self._make_request("GET", url, headers=headers) + return response.json().get("Codebase") + + def _get_auth_string(self) -> str: + """ + Creates and returns the base64 encoded authorization string required for API requests. + + Returns: + str: Base64 encoded authorization string. + """ + return "Basic " + base64.b64encode( + bytes( + f"{self.company_name}+{self.public_key}:{self.private_key}", + encoding="utf8", + ) + ).decode("ascii") + + def _get_headers(self) -> dict[str, str]: + """ + Generates and returns the headers required for making API requests. + + Returns: + dict[str, str]: Dictionary of headers including Content-Type, Client ID, and Authorization. + """ + return { + "Content-Type": "application/json", + "clientId": self.client_id, + "Authorization": self._get_auth_string(), + } diff --git a/src/pyconnectwise_generator/utils/__init__.py b/src/pyconnectwise_generator/utils/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/pyconnectwise/utils/fs.py b/src/pyconnectwise_generator/utils/fs.py similarity index 70% rename from src/pyconnectwise/utils/fs.py rename to src/pyconnectwise_generator/utils/fs.py index 809142ac5..b119e6f4f 100644 --- a/src/pyconnectwise/utils/fs.py +++ b/src/pyconnectwise_generator/utils/fs.py @@ -1,9 +1,9 @@ import black -from black import NothingChanged import isort +from black import NothingChanged -def save_py_file(filepath: str, content: str): # noqa: ANN201 +def save_py_file(filepath: str, content: str) -> None: """ Save Python file @@ -23,11 +23,16 @@ def save_py_file(filepath: str, content: str): # noqa: ANN201 if ".py" not in filepath: filepath += ".py" with open(filepath, "w") as f: # noqa: PTH123 + # First write the unformatted content so we have something to debug + # against if formatters fail + f.write(content) try: - formatted_content = black.format_file_contents( - content, fast=False, mode=black.FileMode(line_length=120) - ) + formatted_content = black.format_file_contents(content, fast=False, mode=black.FileMode(line_length=120)) except NothingChanged: formatted_content = content formatted_content = isort.code(formatted_content, line_length=120) + + # Reset the file handle, and write the formatted content + f.seek(0) + f.truncate() f.write(formatted_content) diff --git a/tests/clients/test_connectwise_client.py b/tests/clients/test_connectwise_client.py index 37e5b7303..cb9b911b5 100644 --- a/tests/clients/test_connectwise_client.py +++ b/tests/clients/test_connectwise_client.py @@ -5,7 +5,7 @@ from pyconnectwise.clients.connectwise_client import ConnectWiseClient from pyconnectwise.config import Config -from pyconnectwise.exceptions import ServerError +from pyconnectwise.exceptions import ObjectExistsError, ServerError class FakeConnectWiseClient(ConnectWiseClient): @@ -54,7 +54,7 @@ def test_one_timeout_500(requests_mock: RequestMocker): @pytest.mark.parametrize( - "response_text, response_reason, expected_error, should_retry", + ("response_text", "response_reason", "expected_error", "should_retry"), [ # Timeout errors should be retried, and then bubble up if they persist. ( @@ -87,6 +87,7 @@ def test_one_timeout_500(requests_mock: RequestMocker): ], ) def test_timeout_500( + *, response_text: str, response_reason: str, expected_error: type[Exception], @@ -118,3 +119,45 @@ def test_timeout_500( assert len(requests_mock.request_history) == 1 + max_retries else: assert len(requests_mock.request_history) == 1 + + +@pytest.mark.parametrize( + ( + "response_code", + "response_content", + "expected_error", + ), + [ + ( + # Sometimes the ConnectWise API returns this type of timeout + 400, + b'{\r\n "code": "InvalidObject",\r\n "message": "callbackEntry object is invalid",\r\n "errors": [\r\n {\r\n "code": "ObjectExists",\r\n "message": "A matching callback entry already exists",\r\n "resource": "callbackEntry",\r\n "field": "objectId"\r\n }\r\n ]\r\n}', + ObjectExistsError, + ), + ], +) +def test_exceptions( + *, + response_code: int, + response_content: bytes, + expected_error: type[Exception], + requests_mock: RequestMocker, +): + test_url = "https://staging.connectwisedev.com/v2022_2/apis/3.0/system/callbacks" + + # Retrying once should be sufficient for testing purposes + max_retries = 1 + + # setup requests_mock to intercept the http requests + requests_mock.get( + test_url, + content=response_content, + status_code=response_code, + ) + + client = FakeConnectWiseClient(max_retries=max_retries) + with pytest.raises(expected_error): + client._make_request( + "GET", + test_url, + )